diff options
| author | ruki <[email protected]> | 2018-04-18 00:20:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-04-17 20:05:25 +0800 |
| commit | de0b81ca10f04ae93e6a68278ec7f888acd0498d (patch) | |
| tree | 5d1d12cf0e5a0f810ac309286a7f80d698036209 /tests | |
| parent | e9df357185b4ed02e230a11bfe76ad7dcf3a5376 (diff) | |
add qt widget app test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/projects/qt_widgetapp/src/main.cpp | 11 | ||||
| -rw-r--r-- | tests/projects/qt_widgetapp/src/mainwindow.cpp | 14 | ||||
| -rw-r--r-- | tests/projects/qt_widgetapp/src/mainwindow.h | 22 | ||||
| -rw-r--r-- | tests/projects/qt_widgetapp/src/mainwindow.ui | 24 | ||||
| -rw-r--r-- | tests/projects/qt_widgetapp/xmake.lua | 17 |
5 files changed, 88 insertions, 0 deletions
diff --git a/tests/projects/qt_widgetapp/src/main.cpp b/tests/projects/qt_widgetapp/src/main.cpp new file mode 100644 index 000000000..b48f94ec8 --- /dev/null +++ b/tests/projects/qt_widgetapp/src/main.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" +#include <QApplication> + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/tests/projects/qt_widgetapp/src/mainwindow.cpp b/tests/projects/qt_widgetapp/src/mainwindow.cpp new file mode 100644 index 000000000..49d64fce7 --- /dev/null +++ b/tests/projects/qt_widgetapp/src/mainwindow.cpp @@ -0,0 +1,14 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/tests/projects/qt_widgetapp/src/mainwindow.h b/tests/projects/qt_widgetapp/src/mainwindow.h new file mode 100644 index 000000000..a3948a917 --- /dev/null +++ b/tests/projects/qt_widgetapp/src/mainwindow.h @@ -0,0 +1,22 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include <QMainWindow> + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/tests/projects/qt_widgetapp/src/mainwindow.ui b/tests/projects/qt_widgetapp/src/mainwindow.ui new file mode 100644 index 000000000..6050363fa --- /dev/null +++ b/tests/projects/qt_widgetapp/src/mainwindow.ui @@ -0,0 +1,24 @@ +<ui version="4.0"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle" > + <string>MainWindow</string> + </property> + <widget class="QMenuBar" name="menuBar" /> + <widget class="QToolBar" name="mainToolBar" /> + <widget class="QWidget" name="centralWidget" /> + <widget class="QStatusBar" name="statusBar" /> + </widget> + <layoutDefault spacing="6" margin="11" /> + <pixmapfunction></pixmapfunction> + <resources/> + <connections/> +</ui> diff --git a/tests/projects/qt_widgetapp/xmake.lua b/tests/projects/qt_widgetapp/xmake.lua new file mode 100644 index 000000000..0ffe26ce1 --- /dev/null +++ b/tests/projects/qt_widgetapp/xmake.lua @@ -0,0 +1,17 @@ + +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("qt_demo") + + -- add rules + add_rules("qt.widgetapp") + + -- add headers + add_headers("src/*.h") + + -- add files + add_files("src/*.cpp") + add_files("src/mainwindow.ui") + |
