-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.cpp
More file actions
54 lines (41 loc) · 1.42 KB
/
MainWindow.cpp
File metadata and controls
54 lines (41 loc) · 1.42 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "MainWindow.h"
#include <qwebengineview.h>
#include <qwebengineprofile.h>
#include <qmainwindow.h>
#include <QWebEngineView>
#include <qwebenginepage.h>
#include <qurl.h>
MainWindow::MainWindow(QWidget* parent): QCustomMainWindow(parent)
{
QCustomTitleBar* titleBar = new QCustomTitleBar();
titleBar->setTitleText("QCustomMainWindow");
QObject::connect(titleBar, &QCustomTitleBar::closeButtonClicked, this, &MainWindow::close);
QObject::connect(titleBar, &QCustomTitleBar::maxButtonClicked, this, &MainWindow::showCustomNormal);
QObject::connect(titleBar, &QCustomTitleBar::minButtonClicked, this, &MainWindow::showMinimized);
QObject::connect(this,&MainWindow::windowStateChanged,titleBar,&QCustomTitleBar::updateIcon);
this->setTitleBar(titleBar);
QMainWindow * widget = new QMainWindow();
this->setMainWidget(widget);
this->setBorderColor(Qt::GlobalColor::lightGray,2);
//±³¾°É«Îª#19232D
this->setBackgroundColor(QColor("#19232D"));
//·Ö¸îÏßÑÕÉ«
this->setSplitLineColor(Qt::GlobalColor::lightGray);
this->setEdgeSize(8);
}
MainWindow::~MainWindow()
{
}
void MainWindow::paintEvent(QPaintEvent* event)
{
QCustomMainWindow::paintEvent(event);
}
//void MainWindow::setTitleBar(QWidget* titleBar)
//{
// //QCustomMainWindow::setTitleBar(titleBar);
//}
//
//void MainWindow::setMainWidget(QWidget* widget)
//{
// /*QCustomMainWindow::setMainWidget(widget);*/
//}