-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwidget.h
97 lines (74 loc) · 1.9 KB
/
mainwidget.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include <QObject>
#include <QWidget>
#include <MyWidget.h>
#include <QtGui>
#include <QLayout>
#include <QSettings>
class MainWidget : public QWidget
{
Q_OBJECT
MyWidget* w=0;
QWidget* Menu=0;
QWidget* Options=0;
QPushButton* Size;
QPushButton* SizeDown;
QPushButton* SizeUp;
QPushButton* Type;
QPushButton* OptionsBtnBack;
QTimer* Delay;
QTimer* SizeDelay;
QPushButton* New;
QPushButton* Continue;
QPushButton* OptionsB;
QPushButton* Exit;
QList<QRect> btn_R_List;
QList<QPushButton*> btnList;
QBoxLayout* MenuLayout;
QSettings MySett;
bool ContinueEnable;
public:
//explicit
MainWidget(QWidget *parent = 0);
void ReadSett();
friend class MyApplication;
friend void WriteSett();
void keyPressEvent(QKeyEvent *key);
void closeEvent(QCloseEvent*p){
p->ignore();
}
virtual void resizeEvent(QResizeEvent* re){
if ((this!=0)&&(Menu!=0)&&(Options!=0)&&(w!=0)&&(!SizeDelay->isActive())){
Menu->setGeometry(QRect(0,0,this->geometry().width(),this->geometry().height()));
Options->setGeometry(QRect(0,0,this->geometry().width(),this->geometry().height()));
w->setGeometry(QRect(0,0,this->geometry().width(),this->geometry().height()));
if (!w->isHidden()){
w->SetCoord();
ReadSett();
}
}
}
signals:
void GameOver();
public slots:
void DelayOut();
void SizeOut();
void PushNewGame();
void PushContinue();
void PushOptionsBtn();
void OptionsBack();
void UpSizeArea();
void DownSizeArea();
void ChangeType();
void PushExit();
void rearrangeButtons();
void GameOverSlot();
void GameOver2Continue();
void WriteSett();
public slots:
void Save(){
WriteSett();
}
};
#endif // MAINWIDGET_H