summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro3
-rw-r--r--tests/auto/controls/data/tst_calendar.qml18
-rw-r--r--tests/auto/controls/data/tst_combobox.qml9
-rw-r--r--tests/auto/controls/data/tst_slider.qml9
-rw-r--r--tests/auto/controls/data/tst_tableview.qml2
-rw-r--r--tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp6
-rw-r--r--tests/auto/dialogs/tst_dialogs.cpp23
-rw-r--r--tests/auto/extras/data/tst_picture.qml6
-rw-r--r--tests/auto/extras/data/tst_statusindicator.qml6
-rw-r--r--tests/manual/viewinqwidget/main.qml16
10 files changed, 79 insertions, 19 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index f3b76771..14860dc0 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -2,6 +2,3 @@ TEMPLATE = subdirs
SUBDIRS += testplugin controls activeFocusOnTab applicationwindow dialogs \
extras qquicktreemodeladaptor customcontrolsstyle
controls.depends = testplugin
-
-# QTBUG-60268
-boot2qt: SUBDIRS -= controls activeFocusOnTab applicationwindow dialogs extras customcontrolsstyle
diff --git a/tests/auto/controls/data/tst_calendar.qml b/tests/auto/controls/data/tst_calendar.qml
index 1185aca9..814a361a 100644
--- a/tests/auto/controls/data/tst_calendar.qml
+++ b/tests/auto/controls/data/tst_calendar.qml
@@ -132,7 +132,7 @@ Item {
compare(calendar.selectedDate, new Date(new Date().setHours(0, 0, 0, 0)));
compare(calendar.frameVisible, true);
compare(calendar.dayOfWeekFormat, Locale.ShortFormat);
- compare(calendar.__locale, Qt.locale());
+ compare(calendar.locale, Qt.locale());
}
function test_setAfterConstructed() {
@@ -141,13 +141,13 @@ Item {
calendar.selectedDate = new Date(1980, 0, 1);
calendar.frameVisible = false;
calendar.dayOfWeekFormat = Locale.NarrowFormat;
- calendar.__locale = Qt.locale("de_DE");
+ calendar.locale = Qt.locale("de_DE");
compare(calendar.minimumDate, new Date(1900, 0, 1));
compare(calendar.maximumDate, new Date(1999, 11, 31));
compare(calendar.selectedDate, new Date(1980, 0, 1));
compare(calendar.frameVisible, false);
- compare(calendar.__locale, Qt.locale("de_DE"));
+ compare(calendar.locale, Qt.locale("de_DE"));
}
function test_selectedDate() {
@@ -205,7 +205,7 @@ Item {
calendar.selectedDate = new Date(2013, 0, 1);
// Set this to a certain locale, because days will be in different
// places depending on the system locale of the host machine.
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
/* January 2013 December 2012
M T W T F S S M T W T F S S
@@ -371,7 +371,7 @@ Item {
var startDate = new Date(2013, 0, 1);
calendar.selectedDate = startDate;
- calendar.__locale = Qt.locale("en_US");
+ calendar.locale = Qt.locale("en_US");
compare(calendar.selectedDate, startDate);
pressedSignalSpy.target = calendar;
@@ -457,7 +457,7 @@ Item {
calendar.minimumDate = new Date(2013, 0, 1);
calendar.selectedDate = new Date(startDate);
calendar.maximumDate = new Date(2013, 1, 5);
- calendar.__locale = Qt.locale("no_NO");
+ calendar.locale = Qt.locale("no_NO");
pressedSignalSpy.target = calendar;
pressedSignalSpy.signalName = "pressed";
@@ -531,7 +531,7 @@ Item {
22 23 24 25 26 27 28
29 30 31 1 2 3 4 */
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
calendar.selectedDate = new Date(2014, 11, 1);
mousePress(calendar, toPixelsX(0), toPixelsY(0), Qt.LeftButton);
compare(calendar.selectedDate, new Date(2014, 10, 24));
@@ -602,7 +602,7 @@ Item {
calendar.minimumDate = new Date(2014, 1, 1);
calendar.selectedDate = new Date(2014, 1, 28);
calendar.maximumDate = new Date(2014, 2, 31);
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
pressedSignalSpy.target = calendar;
pressedSignalSpy.signalName = "pressed";
@@ -875,7 +875,7 @@ Item {
function test_pressAndHold() {
calendar.selectedDate = new Date(2013, 0, 1);
- calendar.__locale = Qt.locale("en_GB");
+ calendar.locale = Qt.locale("en_GB");
pressedSignalSpy.target = calendar;
pressedSignalSpy.signalName = "pressed";
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 632a1d15..ce8b6c42 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -512,10 +512,13 @@ TestCase {
mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1)
verify(!comboBox.activeFocus)
comboBox.activeFocusOnPress = true
- if (Qt.platform.os === "osx") // on mac when the menu open, the __popup function does not return
+ if (Qt.platform.os === "osx") { // on macOS when the menu open, the __popup function does not return
timer.start()
- else // two mouse clicks to open and close the popup menu
- mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1)
+ } else {
+ // two mouse clicks to open and close the popup menu. The 1ms delay between mouse presses is
+ // needed with software quick renderer. Without the delay, this test is flaky.
+ mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1, Qt.LeftButton, Qt.NoModifier, 1)
+ }
mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1)
verify(comboBox.activeFocus)
comboBox.destroy()
diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml
index 34627daa..9e2ba0f1 100644
--- a/tests/auto/controls/data/tst_slider.qml
+++ b/tests/auto/controls/data/tst_slider.qml
@@ -51,7 +51,7 @@
import QtQuick 2.6
import QtTest 1.0
import QtQuickControlsTests 1.0
-import QtQuick.Controls 1.4
+import QtQuick.Controls 1.6
import QtQuick.Controls.Private 1.0
import QtQuick.Controls.Styles 1.4
@@ -176,6 +176,13 @@ Item {
slider.value = 0
mouseWheel(slider, 5, 5, -40 * ratio, 0)
compare(slider.value, slider.maximumValue)
+
+ // Mousewheel deactivated
+ slider.value = 0
+ slider.wheelEnabled = false
+ mouseWheel(slider, 5, 5, 4 * ratio, 0)
+ compare(slider.value, 0)
+
slider.destroy()
}
diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml
index fe50f241..0b54634e 100644
--- a/tests/auto/controls/data/tst_tableview.qml
+++ b/tests/auto/controls/data/tst_tableview.qml
@@ -971,6 +971,8 @@ TestCase {
table.getColumn(0).width = 20
compare(table.getColumn(0).width, 20)
table.resizeColumnsToContents()
+ if (Qt.platform.pluginName === "offscreen")
+ expectFail("", "QTBUG-62496")
compare(table.getColumn(0).width, 50)
table.destroy()
}
diff --git a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
index 67aeb586..42354efd 100644
--- a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
+++ b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
@@ -68,6 +68,9 @@ void tst_customcontrolsstyle::style_data()
void tst_customcontrolsstyle::style()
{
+ if (QGuiApplication::platformName() == "offscreen")
+ QSKIP("Using grabImage does not work on offscreen platform");
+
QFETCH(QString, specifiedStyle);
QFETCH(QString, expectedStyleName);
@@ -109,6 +112,9 @@ void tst_customcontrolsstyle::style()
// start with Base, switch to custom style later on (for a specific QML engine)
void tst_customcontrolsstyle::changeStyle()
{
+ if (QGuiApplication::platformName() == "offscreen")
+ QSKIP("Using grabImage does not work on offscreen platform");
+
qputenv("QT_QUICK_CONTROLS_1_STYLE", "Base");
QByteArray importPath = qgetenv("QML2_IMPORT_PATH");
if (importPath.isEmpty())
diff --git a/tests/auto/dialogs/tst_dialogs.cpp b/tests/auto/dialogs/tst_dialogs.cpp
index 20da6e43..1f802113 100644
--- a/tests/auto/dialogs/tst_dialogs.cpp
+++ b/tests/auto/dialogs/tst_dialogs.cpp
@@ -56,6 +56,7 @@ private slots:
void fileDialogDefaultModality();
void fileDialogNonModal();
void fileDialogNameFilters();
+ void fileDialogDefaultSuffix();
private:
};
@@ -207,6 +208,28 @@ void tst_dialogs::fileDialogNameFilters()
QCOMPARE(dlg->property("selectedNameFilter").toString(), filters.first());
}
+void tst_dialogs::fileDialogDefaultSuffix()
+{
+ QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickWindow> cleanup(window);
+
+ const QUrl sourceUrl = testFileUrl("RectWithFileDialog.qml");
+ window->setSource(sourceUrl);
+ window->setGeometry(240, 240, 1024, 320);
+ window->show();
+ QTRY_VERIFY(QTest::qWaitForWindowExposed(window));
+ QVERIFY(window->rootObject());
+
+ QObject *dlg = qvariant_cast<QObject *>(window->rootObject()->property("fileDialog"));
+ QCOMPARE(dlg->property("defaultSuffix").toString(), QString());
+ dlg->setProperty("defaultSuffix", "txt");
+ QCOMPARE(dlg->property("defaultSuffix").toString(), QString("txt"));
+ dlg->setProperty("defaultSuffix", ".txt");
+ QCOMPARE(dlg->property("defaultSuffix").toString(), QString("txt"));
+ dlg->setProperty("defaultSuffix", QString());
+ QCOMPARE(dlg->property("defaultSuffix").toString(), QString());
+}
+
QTEST_MAIN(tst_dialogs)
#include "tst_dialogs.moc"
diff --git a/tests/auto/extras/data/tst_picture.qml b/tests/auto/extras/data/tst_picture.qml
index e11d28fb..9ecc89be 100644
--- a/tests/auto/extras/data/tst_picture.qml
+++ b/tests/auto/extras/data/tst_picture.qml
@@ -107,6 +107,9 @@ TestCase {
}
function test_source(data) {
+ if (Qt.platform.pluginName === "offscreen")
+ skip("Using grabImage does not work on offscreen platform");
+
picture = Qt.createQmlObject("import QtQuick.Extras 1.4; Picture {}", testCase, "");
verify(picture, "Picture: failed to create an instance");
picture.source = data.tag;
@@ -134,6 +137,9 @@ TestCase {
}
function test_color(data) {
+ if (Qt.platform.pluginName === "offscreen")
+ skip("Using grabImage does not work on offscreen platform");
+
picture = Qt.createQmlObject("import QtQuick.Extras 1.4; Picture {}", testCase, "");
verify(picture, "Picture: failed to create an instance");
diff --git a/tests/auto/extras/data/tst_statusindicator.qml b/tests/auto/extras/data/tst_statusindicator.qml
index 257ec715..8801ead7 100644
--- a/tests/auto/extras/data/tst_statusindicator.qml
+++ b/tests/auto/extras/data/tst_statusindicator.qml
@@ -90,6 +90,9 @@ TestCase {
}
function test_active(data) {
+ if (Qt.platform.pluginName === "offscreen")
+ skip("Using grabImage does not work on offscreen platform");
+
indicator = Qt.createQmlObject("import QtQuick.Extras 1.4; StatusIndicator { }", testCase, "");
verify(indicator);
compare(indicator.active, false);
@@ -106,6 +109,9 @@ TestCase {
}
function test_color() {
+ if (Qt.platform.pluginName === "offscreen")
+ skip("Using grabImage does not work on offscreen platform");
+
var flatStyle = Settings.styleName === "Flat";
indicator = Qt.createQmlObject("import QtQuick.Extras 1.4; StatusIndicator { }", testCase, "");
diff --git a/tests/manual/viewinqwidget/main.qml b/tests/manual/viewinqwidget/main.qml
index 36c09b50..e50e7712 100644
--- a/tests/manual/viewinqwidget/main.qml
+++ b/tests/manual/viewinqwidget/main.qml
@@ -28,14 +28,24 @@
import QtQuick 2.2
import QtQuick.Controls 1.3
+import QtQuick.Layouts 1.3
Item {
visible: true
width: 200
height: 200
- ComboBox {
- anchors.centerIn: parent
- model: [ "Banana", "Apple", "Coconut" ]
+ ColumnLayout {
+ anchors.fill: parent
+
+ TextField {
+ Layout.alignment: Qt.AlignCenter
+ text : "Text with context menu"
+ }
+
+ ComboBox {
+ Layout.alignment: Qt.AlignCenter
+ model: [ "Banana", "Apple", "Coconut" ]
+ }
}
}