-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.h
38 lines (28 loc) · 910 Bytes
/
macros.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
#ifndef _MACROS_H
#define _MACROS_H
#include <QDesktopWidget>
#include <QApplication>
#include <QStyle>
#include <QUiLoader>
#include <QFile>
#include <QPushButton>
void showUI(QWidget* widget);
void loadUI(QString fileName);
#define CONNECT_CLOSE_BUTTON \
QObject::connect(this->ui->btnClose, SIGNAL(clicked()), this, SLOT(close())); \
#define SET_GROUP(CLASS) \
foreach (CLASS* widget, this->findChildren<CLASS*>()) \
{ \
widget->setVariableNameSubstitutionsProperty("group=" + this->group); \
}
#define STRING(X) \
QString::number(X) \
#define FIX_SIZE \
setFixedSize(width(), height()) \
#define COLOR_DARKGREEN QColor(20, 60, 20)
#define OPEN_UI(object, CLASS, ...) \
if(!object || !object->isVisible()) \
object = new CLASS(__VA_ARGS__); \
showUI(object); \
#define TITLE_MAIN "SESAME Control System"
#endif // _MACROS_H