summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2015-09-13 17:43:00 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2015-09-21 00:06:13 (GMT)
commitdbe8eef5f5c500758dd3ddafe9e6f94771d7fd97 (patch)
treee4978a1e63ee12a728c82ef446a51099fcacb3d4 /src
parent6004e1e00affe07ea29e4e073d006ac686a00937 (diff)
downloadmxe-dbe8eef5f5c500758dd3ddafe9e6f94771d7fd97.zip
mxe-dbe8eef5f5c500758dd3ddafe9e6f94771d7fd97.tar.gz
mxe-dbe8eef5f5c500758dd3ddafe9e6f94771d7fd97.tar.bz2
qt-test: add a header
Test moc tool
Diffstat (limited to 'src')
-rw-r--r--src/qt-test.cpp7
-rw-r--r--src/qt-test.hpp30
-rw-r--r--src/qt-test.pro1
3 files changed, 34 insertions, 4 deletions
diff --git a/src/qt-test.cpp b/src/qt-test.cpp
index 83a1cb3..20794cf 100644
--- a/src/qt-test.cpp
+++ b/src/qt-test.cpp
@@ -4,14 +4,13 @@
*/
#include <QApplication>
-#include "ui_qt-test.h"
+
+#include "qt-test.hpp"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
- QMainWindow w;
- Ui::MainWindow u;
- u.setupUi(&w);
+ MainWindow w;
w.show();
a.aboutQt();
return a.exec();
diff --git a/src/qt-test.hpp b/src/qt-test.hpp
new file mode 100644
index 0000000..213f59b
--- /dev/null
+++ b/src/qt-test.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <QtGui>
+
+#include "ui_qt-test.h"
+
+class MainWindow : public QMainWindow {
+ Q_OBJECT
+public:
+ MainWindow(QWidget* parent = 0):
+ QMainWindow(parent),
+ ui(new Ui::MainWindow)
+ {
+ ui->setupUi(this);
+ }
+
+ ~MainWindow() {
+ delete ui;
+ }
+
+signals:
+ void testSignal();
+
+public slots:
+ void testSlot() {
+ }
+
+private:
+ Ui::MainWindow* ui;
+};
diff --git a/src/qt-test.pro b/src/qt-test.pro
index 5d323dc..fd4f55b 100644
--- a/src/qt-test.pro
+++ b/src/qt-test.pro
@@ -5,6 +5,7 @@ greaterThan(QT_MAJOR_VERSION, 4): TARGET = test-qt5
else: TARGET = test-qt
QT += network sql
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+HEADERS += qt-test.hpp
SOURCES += qt-test.cpp
FORMS += qt-test.ui
RESOURCES += qt-test.qrc