diff options
| author | carols <[email protected]> | 2020-04-06 22:06:03 +0800 |
|---|---|---|
| committer | carols <[email protected]> | 2020-04-06 22:06:03 +0800 |
| commit | fb427e840d5d193b958b607137b516662edd6446 (patch) | |
| tree | 00dba82181d20bcb7a78c37bd33ea878dc008879 | |
| parent | 7e8c09127594572bdf01127d14d5bd090b0c26f1 (diff) | |
add qt with private test
| -rw-r--r-- | tests/projects/qt/with_privete/src/main.cpp | 11 | ||||
| -rw-r--r-- | tests/projects/qt/with_privete/src/mainwindow.cpp | 16 | ||||
| -rw-r--r-- | tests/projects/qt/with_privete/src/mainwindow.h | 22 | ||||
| -rw-r--r-- | tests/projects/qt/with_privete/src/mainwindow.ui | 24 | ||||
| -rw-r--r-- | tests/projects/qt/with_privete/xmake.lua | 22 |
5 files changed, 95 insertions, 0 deletions
diff --git a/tests/projects/qt/with_privete/src/main.cpp b/tests/projects/qt/with_privete/src/main.cpp new file mode 100644 index 000000000..b48f94ec8 --- /dev/null +++ b/tests/projects/qt/with_privete/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/with_privete/src/mainwindow.cpp b/tests/projects/qt/with_privete/src/mainwindow.cpp new file mode 100644 index 000000000..4d9a6bcae --- /dev/null +++ b/tests/projects/qt/with_privete/src/mainwindow.cpp @@ -0,0 +1,16 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include <private/qquicktext_p.h> +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + ui->setupUi(this); + QQuickText *text = new QQuickText(); + delete text; +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/tests/projects/qt/with_privete/src/mainwindow.h b/tests/projects/qt/with_privete/src/mainwindow.h new file mode 100644 index 000000000..8e06f4918 --- /dev/null +++ b/tests/projects/qt/with_privete/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/with_privete/src/mainwindow.ui b/tests/projects/qt/with_privete/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/tests/projects/qt/with_privete/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/with_privete/xmake.lua b/tests/projects/qt/with_privete/xmake.lua new file mode 100644 index 000000000..6cc6378e7 --- /dev/null +++ b/tests/projects/qt/with_privete/xmake.lua @@ -0,0 +1,22 @@ + +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("qt_demo") + + -- add rules + add_rules("qt.widgetapp") + add_frameworks("QtCore", "QtGui", "QtWidgets", "QtQuick", "QtQuickPrivate", "QtQml", "QtQmlPrivate", "QtCorePrivate", "QtGuiPrivate") + + -- add headers + add_headerfiles("src/*.h") + + -- add files + add_files("src/*.cpp") + add_files("src/mainwindow.ui") + + -- add files with Q_OBJECT meta (only for qt.moc) + add_files("src/mainwindow.h") + + |
