summaryrefslogtreecommitdiffstats
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.qml5
-rw-r--r--tests/auto/controls/data/tst_slider.qml25
-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
9 files changed, 88 insertions, 20 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index f3b767716..14860dc0c 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 d47f62ba6..55283b021 100644
--- a/tests/auto/controls/data/tst_calendar.qml
+++ b/tests/auto/controls/data/tst_calendar.qml
@@ -135,7 +135,7 @@ Item {
compare(calendar.selectedDate.getDate(), expectedDate.getDate());
compare(calendar.frameVisible, true);
compare(calendar.dayOfWeekFormat, Locale.ShortFormat);
- compare(calendar.__locale, Qt.locale());
+ compare(calendar.locale, Qt.locale());
}
function test_setAfterConstructed() {
@@ -144,13 +144,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() {
@@ -208,7 +208,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
@@ -374,7 +374,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;
@@ -466,7 +466,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";
@@ -540,7 +540,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.getFullYear(), 2014);
@@ -615,7 +615,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";
@@ -890,7 +890,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 d6a5f6c3e..c380c63af 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -502,8 +502,9 @@ TestCase {
mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1)
verify(!comboBox.activeFocus)
comboBox.activeFocusOnPress = true
- // two mouse clicks to open and close the popup menu
- mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1)
+ // 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 34627daaa..e95d26d93 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
@@ -136,8 +136,22 @@ Item {
slider.destroy()
}
+ Component {
+ id: fixedHandleSizeSlider
+
+ Slider {
+ style: SliderStyle {
+ handle: Rectangle {
+ color: "red"
+ implicitWidth: 15
+ implicitHeight: 15
+ }
+ }
+ }
+ }
+
function test_mouseWheel() {
- var slider = Qt.createQmlObject('import QtQuick.Controls 1.2; Slider {}', container, '');
+ var slider = createTemporaryObject(fixedHandleSizeSlider, container)
slider.forceActiveFocus()
slider.value = 0
slider.maximumValue = 300
@@ -176,7 +190,12 @@ Item {
slider.value = 0
mouseWheel(slider, 5, 5, -40 * ratio, 0)
compare(slider.value, slider.maximumValue)
- slider.destroy()
+
+ // Mousewheel deactivated
+ slider.value = 0
+ slider.wheelEnabled = false
+ mouseWheel(slider, 5, 5, 4 * ratio, 0)
+ compare(slider.value, 0)
}
function test_activeFocusOnPress(){
diff --git a/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp b/tests/auto/customcontrolsstyle/tst_customcontrolsstyle.cpp
index 67aeb5869..42354efd6 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 20da6e43d..1f802113f 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 e11d28fb6..9ecc89beb 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 257ec7158..8801ead7b 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 36c09b502..e50e7712a 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" ]
+ }
}
}