diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-04-01 16:22:35 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-04-01 16:22:35 +0300 |
commit | eea5b961fdcb4ad95d13264943332cc1fea5d30c (patch) | |
tree | 216fa71e0202fbf21f8d2eab764f78774f877f56 | |
parent | 3d4aad9e0d0038061960469d4d380b7e57d53144 (diff) | |
download | meson-eea5b961fdcb4ad95d13264943332cc1fea5d30c.zip meson-eea5b961fdcb4ad95d13264943332cc1fea5d30c.tar.gz meson-eea5b961fdcb4ad95d13264943332cc1fea5d30c.tar.bz2 |
Qt5 test case and some implementation.
-rw-r--r-- | dependencies.py | 8 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/main.cpp | 11 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/mainWindow.cpp | 8 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/mainWindow.h | 14 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/mainWindow.ui | 34 | ||||
-rw-r--r-- | test cases/frameworks/4 qt5/meson.build | 12 |
6 files changed, 85 insertions, 2 deletions
diff --git a/dependencies.py b/dependencies.py index 554eac4..8a66e24 100644 --- a/dependencies.py +++ b/dependencies.py @@ -288,8 +288,11 @@ class Qt5Dependency(): def __init__(self, kwargs): self.root = '/usr' self.modules = [] - for module in kwargs.get('modules', []): - self.modules.append(PkgConfigDependency('Qt5' + module)) + mods = kwargs.get('modules', []) + if isinstance(mods, str): + mods = [mods] + for module in mods: + self.modules.append(PkgConfigDependency('Qt5' + module, False)) if len(self.modules) == 0: raise DependencyException('No Qt5 modules specified.') self.moc = ExternalProgram('moc') @@ -311,6 +314,7 @@ class Qt5Dependency(): flags = [] for module in self.modules: flags += module.get_link_flags() + return flags def found(self): if not self.moc.found(): diff --git a/test cases/frameworks/4 qt5/main.cpp b/test cases/frameworks/4 qt5/main.cpp new file mode 100644 index 0000000..168b344 --- /dev/null +++ b/test cases/frameworks/4 qt5/main.cpp @@ -0,0 +1,11 @@ +#include <QApplication> +#include "mainWindow.h" + +int main(int argc, char **argv) { + QApplication app(argc, argv); + MainWindow *win = new MainWindow(); + win->setWindowTitle("Button demo app"); + win->show(); + + return app.exec(); +} diff --git a/test cases/frameworks/4 qt5/mainWindow.cpp b/test cases/frameworks/4 qt5/mainWindow.cpp new file mode 100644 index 0000000..cc82c4f --- /dev/null +++ b/test cases/frameworks/4 qt5/mainWindow.cpp @@ -0,0 +1,8 @@ +#include "mainWindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + setupUi(this); +} + +MainWindow::~MainWindow() { +} diff --git a/test cases/frameworks/4 qt5/mainWindow.h b/test cases/frameworks/4 qt5/mainWindow.h new file mode 100644 index 0000000..369c6d3 --- /dev/null +++ b/test cases/frameworks/4 qt5/mainWindow.h @@ -0,0 +1,14 @@ +#include <QMainWindow> +#include "ui_mainWindow.h" + +class NotificationModel; + +class MainWindow : public QMainWindow, private Ui_MainWindow { + Q_OBJECT + +public: + MainWindow(QWidget *parent=nullptr); + ~MainWindow(); + +private: +}; diff --git a/test cases/frameworks/4 qt5/mainWindow.ui b/test cases/frameworks/4 qt5/mainWindow.ui new file mode 100644 index 0000000..2eb226a --- /dev/null +++ b/test cases/frameworks/4 qt5/mainWindow.ui @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>270</width> + <height>115</height> + </rect> + </property> + <property name="windowTitle"> + <string>MainWindow</string> + </property> + <widget class="QWidget" name="centralwidget"> + <widget class="QPushButton" name="pushButton"> + <property name="geometry"> + <rect> + <x>10</x> + <y>10</y> + <width>241</width> + <height>91</height> + </rect> + </property> + <property name="text"> + <string>I am a button</string> + </property> + </widget> + </widget> + </widget> + <resources/> + <connections/> +</ui> diff --git a/test cases/frameworks/4 qt5/meson.build b/test cases/frameworks/4 qt5/meson.build new file mode 100644 index 0000000..6796242 --- /dev/null +++ b/test cases/frameworks/4 qt5/meson.build @@ -0,0 +1,12 @@ +project('qt5 build test', 'cxx') + +qt5dep = find_dep('qt5', modules : 'Widgets', required : true) + +q5exe = executable('qt5test', +sources : ['main.cpp', 'mainWindow.cpp'], +moc_headers : ['mainWindow.h'], +ui_files : 'mainWindow.ui', +deps : qt5dep\ +) + +add_test('qt5test', q5exe) |