-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.cpp
45 lines (37 loc) · 902 Bytes
/
mainwindow.cpp
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtDebug>
#include <QtCore>
#include <QMessageBox>
#include <QCloseEvent>
#include <QLayout>
#include <QFile>
static MainWindow* _instance = NULL;
MainWindow* MainWindow::_create()
{
Q_ASSERT(_instance == NULL);
_instance = new MainWindow();
Q_ASSERT(_instance);
return _instance;
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setFixedSize(960,600);
this->setStyleSheet("QPushButton {background: #cfe2f3}"
"QPushButton:pressed {background: 6699cc}");
c_palette.setColor(QPalette::WindowText,Qt::black);
w_palette.setColor(QPalette::WindowText,Qt::red);
show();
}
MainWindow* MainWindow::instance(void)
{
return _instance;
}
MainWindow::~MainWindow()
{
_instance = NULL;
delete ui;
}