aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test cases/frameworks/4 qt/main.cpp17
-rw-r--r--test cases/frameworks/4 qt/mainWindow.ui24
-rw-r--r--test cases/frameworks/4 qt/meson.build2
3 files changed, 39 insertions, 4 deletions
diff --git a/test cases/frameworks/4 qt/main.cpp b/test cases/frameworks/4 qt/main.cpp
index 4c257a4..cebe455 100644
--- a/test cases/frameworks/4 qt/main.cpp
+++ b/test cases/frameworks/4 qt/main.cpp
@@ -2,6 +2,8 @@
#include "mainWindow.h"
int main(int argc, char **argv) {
+ Q_INIT_RESOURCE(stuff);
+ Q_INIT_RESOURCE(stuff2);
QApplication app(argc, argv);
MainWindow *win = new MainWindow();
QImage qi(":/thing.png");
@@ -13,7 +15,20 @@ int main(int argc, char **argv) {
return 1;
}
win->setWindowTitle("Meson Qt5 build test");
-
+ QLabel *label_stuff = win->findChild<QLabel *>("label_stuff");
+ if(label_stuff == nullptr) {
+ return 1;
+ }
+ int w = label_stuff->width();
+ int h = label_stuff->height();
+ label_stuff->setPixmap(QPixmap::fromImage(qi).scaled(w,h,Qt::KeepAspectRatio));
+ QLabel *label_stuff2 = win->findChild<QLabel *>("label_stuff2");
+ if(label_stuff2 == nullptr) {
+ return 1;
+ }
+ w = label_stuff2->width();
+ h = label_stuff2->height();
+ label_stuff2->setPixmap(QPixmap::fromImage(qi2).scaled(w,h,Qt::KeepAspectRatio));
win->show();
return app.exec();
return 0;
diff --git a/test cases/frameworks/4 qt/mainWindow.ui b/test cases/frameworks/4 qt/mainWindow.ui
index 2eb226a..c01b8bf 100644
--- a/test cases/frameworks/4 qt/mainWindow.ui
+++ b/test cases/frameworks/4 qt/mainWindow.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>270</width>
- <height>115</height>
+ <width>260</width>
+ <height>313</height>
</rect>
</property>
<property name="windowTitle">
@@ -27,6 +27,26 @@
<string>I am a button</string>
</property>
</widget>
+ <widget class="QLabel" name="label_stuff">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>112</y>
+ <width>241</width>
+ <height>91</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_stuff2">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>212</y>
+ <width>241</width>
+ <height>91</height>
+ </rect>
+ </property>
+ </widget>
</widget>
</widget>
<resources/>
diff --git a/test cases/frameworks/4 qt/meson.build b/test cases/frameworks/4 qt/meson.build
index b817228..f2ac94e 100644
--- a/test cases/frameworks/4 qt/meson.build
+++ b/test cases/frameworks/4 qt/meson.build
@@ -40,7 +40,7 @@ foreach qt : ['qt4', 'qt5']
)
# Test that setting a unique name with a positional argument works
- qtmodule.preprocess(qt + 'teststuff', qresources : ['stuff.qrc'], method : get_option('method'))
+ qtmodule.preprocess(qt + 'teststuff', qresources : ['stuff.qrc', 'stuff2.qrc'], method : get_option('method'))
qexe = executable(qt + 'app',
sources : ['main.cpp', 'mainWindow.cpp', # Sources that don't need preprocessing.