summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/installer')
-rw-r--r--tests/auto/installer/scriptengine/data/form.ui32
-rw-r--r--tests/auto/installer/scriptengine/data/userinterface.qs5
-rw-r--r--tests/auto/installer/scriptengine/scriptengine.qrc2
-rw-r--r--tests/auto/installer/scriptengine/tst_scriptengine.cpp11
4 files changed, 50 insertions, 0 deletions
diff --git a/tests/auto/installer/scriptengine/data/form.ui b/tests/auto/installer/scriptengine/data/form.ui
new file mode 100644
index 000000000..4814f708f
--- /dev/null
+++ b/tests/auto/installer/scriptengine/data/form.ui
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>form</class>
+ <widget class="QWidget" name="form">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <widget class="QCheckBox" name="checkBox">
+ <property name="geometry">
+ <rect>
+ <x>90</x>
+ <y>90</y>
+ <width>78</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>CheckBox</string>
+ </property>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/auto/installer/scriptengine/data/userinterface.qs b/tests/auto/installer/scriptengine/data/userinterface.qs
new file mode 100644
index 000000000..8aed71630
--- /dev/null
+++ b/tests/auto/installer/scriptengine/data/userinterface.qs
@@ -0,0 +1,5 @@
+function Component()
+{
+ // check that the .ui file has been properly loaded
+ console.log("checked: " + component.userInterface("form").checkBox.checked);
+}
diff --git a/tests/auto/installer/scriptengine/scriptengine.qrc b/tests/auto/installer/scriptengine/scriptengine.qrc
index caffe3627..06829326e 100644
--- a/tests/auto/installer/scriptengine/scriptengine.qrc
+++ b/tests/auto/installer/scriptengine/scriptengine.qrc
@@ -5,5 +5,7 @@
<file>data/component2.qs</file>
<file>data/broken_connect.qs</file>
<file>data/dynamicpage.qs</file>
+ <file>data/form.ui</file>
+ <file>data/userinterface.qs</file>
</qresource>
</RCC>
diff --git a/tests/auto/installer/scriptengine/tst_scriptengine.cpp b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
index 10fa9b79e..12915e30a 100644
--- a/tests/auto/installer/scriptengine/tst_scriptengine.cpp
+++ b/tests/auto/installer/scriptengine/tst_scriptengine.cpp
@@ -305,6 +305,17 @@ private slots:
}
}
+ void loadComponentUserInterfaces()
+ {
+ try {
+ setExpectedScriptOutput("\"checked: false\"");
+ m_component->loadUserInterfaces(QDir(":///data"), QStringList() << QLatin1String("form.ui"));
+ m_component->loadComponentScript(":///data/userinterface.qs");
+ } catch (const Error &error) {
+ QFAIL(qPrintable(error.message()));
+ }
+ }
+
void loadSimpleAutoRunScript()
{
try {