-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaMainWindow.cpp
More file actions
33 lines (27 loc) · 810 Bytes
/
Copy pathmaMainWindow.cpp
File metadata and controls
33 lines (27 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "maMainWindow.h"
#include "ui_maMainWindow.h"
#include <QPainter>
#include "maWindowStyle.h"
CMainWindow::CMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MA_MainWindow)
{
ui->setupUi(this);
ui->pushButton->setStyle(new CWindowStyle());
//setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::Tool);
}
CMainWindow::~CMainWindow()
{
delete ui;
}
void CMainWindow::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
QStyleOptionFocusRect option;
option.initFrom(this);
option.backgroundColor = Qt::blue;//palette().color(Qt::blue);
//style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &painter, this);
painter.setBrush(Qt::blue);
painter.drawRect(option.rect);
QMainWindow::paintEvent(event);
}