summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2015-09-23 07:49:27 (GMT)
committerTony Theodore <tonyt@logyst.com>2015-09-23 07:49:27 (GMT)
commit5b74c8e9de86cb213d7bc6f6c154705506857e77 (patch)
treed11144e1a492a57e0fc17ec293f17f557f81cdf9 /src
parentac7344aaef2b074ee5d58a1bbfee9c43f54b6999 (diff)
parentdbe8eef5f5c500758dd3ddafe9e6f94771d7fd97 (diff)
downloadmxe-5b74c8e9de86cb213d7bc6f6c154705506857e77.zip
mxe-5b74c8e9de86cb213d7bc6f6c154705506857e77.tar.gz
mxe-5b74c8e9de86cb213d7bc6f6c154705506857e77.tar.bz2
Merge pull request #851 from LuaAndC/qt-improve-test
Qt: test more Qt tools (moc, rcc)
Diffstat (limited to 'src')
-rw-r--r--src/qt-test.cpp7
-rw-r--r--src/qt-test.hpp30
-rw-r--r--src/qt-test.pro2
-rw-r--r--src/qt-test.qrc5
4 files changed, 40 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 3b420a8..fd4f55b 100644
--- a/src/qt-test.pro
+++ b/src/qt-test.pro
@@ -5,5 +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
diff --git a/src/qt-test.qrc b/src/qt-test.qrc
new file mode 100644
index 0000000..119d898
--- /dev/null
+++ b/src/qt-test.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>qt.mk</file>
+</qresource>
+</RCC>