diff options
| author | ruki <[email protected]> | 2020-04-06 23:15:55 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-06 23:15:55 +0800 |
| commit | cc765abc4843ca1a0bed451d7ae6d584bc9222b4 (patch) | |
| tree | 4dd8e918e14076b1a4882728c4777c8ebbc31a10 /tests | |
| parent | e39f9aa0eb208e74c827bbae1bc20fba9fbb01d7 (diff) | |
| parent | 105bab82d3a915c1adee490a42c00a400ea6566e (diff) | |
Merge pull request #752 from shaoxie1986/dev
Support Qt private header
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/projects/qt/with_private/src/main.cpp | 11 | ||||
| -rw-r--r-- | tests/projects/qt/with_private/src/mainwindow.cpp | 16 | ||||
| -rw-r--r-- | tests/projects/qt/with_private/src/mainwindow.h | 22 | ||||
| -rw-r--r-- | tests/projects/qt/with_private/src/mainwindow.ui | 24 | ||||
| -rw-r--r-- | tests/projects/qt/with_private/xmake.lua | 22 |
5 files changed, 95 insertions, 0 deletions
diff --git a/tests/projects/qt/with_private/src/main.cpp b/tests/projects/qt/with_private/src/main.cpp new file mode 100644 index 000000000..b48f94ec8 --- /dev/null +++ b/tests/projects/qt/with_private/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_private/src/mainwindow.cpp b/tests/projects/qt/with_private/src/mainwindow.cpp new file mode 100644 index 000000000..4d9a6bcae --- /dev/null +++ b/tests/projects/qt/with_private/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_private/src/mainwindow.h b/tests/projects/qt/with_private/src/mainwindow.h new file mode 100644 index 000000000..8e06f4918 --- /dev/null +++ b/tests/projects/qt/with_private/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_private/src/mainwindow.ui b/tests/projects/qt/with_private/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/tests/projects/qt/with_private/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_private/xmake.lua b/tests/projects/qt/with_private/xmake.lua new file mode 100644 index 000000000..6cc6378e7 --- /dev/null +++ b/tests/projects/qt/with_private/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") + + |
