diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/rangemodel/init.qml | 16 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_slider.qml | 15 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_tableview.qml | 2 | ||||
-rw-r--r-- | tests/auto/dialogs/data/DialogImplicitSize.qml | 16 | ||||
-rw-r--r-- | tests/auto/dialogs/data/DialogMinimumSize.qml | 16 | ||||
-rw-r--r-- | tests/auto/dialogs/tst_dialogs.cpp | 23 | ||||
-rw-r--r-- | tests/benchmarks/startup/startup_bench.cpp | 1 | ||||
-rw-r--r-- | tests/manual/viewinqwidget/main.qml | 16 |
8 files changed, 91 insertions, 14 deletions
diff --git a/tests/auto/controls/data/rangemodel/init.qml b/tests/auto/controls/data/rangemodel/init.qml index 9d050143..12395276 100644 --- a/tests/auto/controls/data/rangemodel/init.qml +++ b/tests/auto/controls/data/rangemodel/init.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index a27cf70e..9e2ba0f1 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -399,7 +399,7 @@ Item { } } - function test_minimumValueLargerThanValue() { + function test_minimumMaximumValueLargerThanValue() { var control = sliderComponent.createObject(container, { "style": namedHandleStyle, "minimumValue": 0, "maximumValue": 2, value: "minimumValue" }); verify(control); @@ -412,6 +412,19 @@ Item { compare(control.value, control.minimumValue); compare(handle.mapToItem(null, 0, 0).x, 0) + control.maximumValue = 5; + control.value = 5; + compare(control.value, 5); + + // get the slider position at max + var maxPos = handle.mapToItem(null, 0, 0).x; + + // reduce the maximum value, resulting in the value becoming 4 as well + control.maximumValue = 4; + compare(control.value, 4); + // make sure that the actual position of the handle is the same (it used to be off - see QTBUG-63354) + compare(handle.mapToItem(null, 0, 0).x, maxPos); + control.destroy(); } } diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml index 0b54634e..8bd40ae3 100644 --- a/tests/auto/controls/data/tst_tableview.qml +++ b/tests/auto/controls/data/tst_tableview.qml @@ -972,7 +972,7 @@ TestCase { compare(table.getColumn(0).width, 20) table.resizeColumnsToContents() if (Qt.platform.pluginName === "offscreen") - expectFail("", "QTBUG-62496") + skip("", "QTBUG-62496") compare(table.getColumn(0).width, 50) table.destroy() } diff --git a/tests/auto/dialogs/data/DialogImplicitSize.qml b/tests/auto/dialogs/data/DialogImplicitSize.qml index 8239c451..2cac1df5 100644 --- a/tests/auto/dialogs/data/DialogImplicitSize.qml +++ b/tests/auto/dialogs/data/DialogImplicitSize.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are diff --git a/tests/auto/dialogs/data/DialogMinimumSize.qml b/tests/auto/dialogs/data/DialogMinimumSize.qml index 7f5baa63..0ab3c0d8 100644 --- a/tests/auto/dialogs/data/DialogMinimumSize.qml +++ b/tests/auto/dialogs/data/DialogMinimumSize.qml @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are 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/benchmarks/startup/startup_bench.cpp b/tests/benchmarks/startup/startup_bench.cpp index 4127f8d0..cdc754ec 100644 --- a/tests/benchmarks/startup/startup_bench.cpp +++ b/tests/benchmarks/startup/startup_bench.cpp @@ -52,6 +52,7 @@ #include <QtQml/QQmlApplicationEngine> #include <QtCore/QElapsedTimer> #include <functional> +#include <stdio.h> int runBenchmark(std::function<int()> f) { { 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" ] + } } } |