diff options
26 files changed, 282 insertions, 35 deletions
diff --git a/dist/changes-5.6.3 b/dist/changes-5.6.3 new file mode 100644 index 00000000..016fc101 --- /dev/null +++ b/dist/changes-5.6.3 @@ -0,0 +1,24 @@ +Qt 5.6.3 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.6.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://doc.qt.io/qt-5/index.html + +The Qt version 5.6 series is binary compatible with the 5.5.x series. +Applications compiled for 5.5 will continue to run with 5.6. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* General * +**************************************************************************** + + - This release contains only minor code improvements. diff --git a/dist/changes-5.9.2 b/dist/changes-5.9.2 new file mode 100644 index 00000000..be791d8f --- /dev/null +++ b/dist/changes-5.9.2 @@ -0,0 +1,31 @@ +Qt 5.9.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +http://doc.qt.io/qt-5/index.html + +The Qt version 5.9 series is binary compatible with the 5.8.x series. +Applications compiled for 5.8 will continue to run with 5.9. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Controls * +**************************************************************************** + + - [QTBUG-57895] Increased Label's QtQuick import version to 2.6 to make + the new revisioned properties in the QML Text base type available. + +**************************************************************************** +* Dialogs * +**************************************************************************** + + - [QTBUG-60991] Fixed QML compiler support diff --git a/examples/quickcontrols/controls/basiclayouts/main.qml b/examples/quickcontrols/controls/basiclayouts/main.qml index b6694b45..cc4c0d4f 100644 --- a/examples/quickcontrols/controls/basiclayouts/main.qml +++ b/examples/quickcontrols/controls/basiclayouts/main.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 examples 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/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp index 55f76d67..b93641a9 100644 --- a/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp +++ b/examples/quickcontrols/controls/tableview/src/sortfilterproxymodel.cpp @@ -54,8 +54,8 @@ SortFilterProxyModel::SortFilterProxyModel(QObject *parent) : QSortFilterProxyModel(parent), m_complete(false) { - connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SIGNAL(countChanged())); - connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SIGNAL(countChanged())); + connect(this, &QSortFilterProxyModel::rowsInserted, this, &SortFilterProxyModel::countChanged); + connect(this, &QSortFilterProxyModel::rowsRemoved, this, &SortFilterProxyModel::countChanged); } int SortFilterProxyModel::count() const diff --git a/examples/quickcontrols/controls/touch/src/main.cpp b/examples/quickcontrols/controls/touch/src/main.cpp index e66387f7..be01f287 100644 --- a/examples/quickcontrols/controls/touch/src/main.cpp +++ b/examples/quickcontrols/controls/touch/src/main.cpp @@ -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 examples 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/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml b/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml index b132510e..c0fb6720 100644 --- a/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml +++ b/examples/quickcontrols/extras/dashboard/qml/TurnIndicator.qml @@ -59,7 +59,7 @@ Item { property bool flashing: false scale: direction === Qt.LeftArrow ? 1 : -1 - +//! [1] Timer { id: flashTimer interval: 500 @@ -67,7 +67,8 @@ Item { repeat: true onTriggered: flashing = !flashing } - +//! [1] +//! [2] function paintOutlinePath(ctx) { ctx.beginPath(); ctx.moveTo(0, height * 0.5); @@ -79,7 +80,7 @@ Item { ctx.lineTo(0.6 * width, height); ctx.lineTo(0, height * 0.5); } - +//! [2] Canvas { id: backgroundCanvas anchors.fill: parent @@ -95,7 +96,7 @@ Item { ctx.stroke(); } } - +//! [3] Canvas { id: foregroundCanvas anchors.fill: parent @@ -111,4 +112,5 @@ Item { ctx.fill(); } } +//! [3] } diff --git a/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml b/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml index 7225be48..44913621 100644 --- a/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml +++ b/examples/quickcontrols/extras/dashboard/qml/ValueSource.qml @@ -49,7 +49,7 @@ ****************************************************************************/ import QtQuick 2.2 - +//! [0] Item { id: valueSource property real kph: 0 @@ -79,6 +79,7 @@ Item { property int turnSignal: gear == "P" && !start ? randomDirection() : -1 property real temperature: 0.6 property bool start: true +//! [0] function randomDirection() { return Math.random() > 0.5 ? Qt.LeftArrow : Qt.RightArrow; @@ -101,7 +102,7 @@ Item { SequentialAnimation { loops: Animation.Infinite - +//! [1] ParallelAnimation { NumberAnimation { target: valueSource @@ -120,6 +121,7 @@ Item { duration: 3000 } } +//! [1] ParallelAnimation { // We changed gears so we lost a bit of speed. NumberAnimation { diff --git a/src/controls/Private/qquickcontrolsettings.cpp b/src/controls/Private/qquickcontrolsettings.cpp index c7f641cc..d8cfdaed 100644 --- a/src/controls/Private/qquickcontrolsettings.cpp +++ b/src/controls/Private/qquickcontrolsettings.cpp @@ -222,7 +222,7 @@ QQuickControlSettings1::QQuickControlSettings1(QQmlEngine *engine) // If the style name is a path.. const QString styleNameFromEnvVar = styleEnvironmentVariable(); - if (QFile::exists(styleNameFromEnvVar)) { + if (!styleNameFromEnvVar.isEmpty() && QFile::exists(styleNameFromEnvVar)) { StyleData styleData; styleData.m_styleDirPath = styleNameFromEnvVar; m_styleMap[m_name] = styleData; diff --git a/src/controls/Slider.qml b/src/controls/Slider.qml index c4d25ac2..e290640e 100644 --- a/src/controls/Slider.qml +++ b/src/controls/Slider.qml @@ -187,10 +187,10 @@ Control { /*! \internal The extra arguments positionAtMinimum and positionAtMaximum are there to force re-evaluation of the handle position when the constraints change (QTBUG-41255), - and the same for range.minimumValue (QTBUG-51765). + and the same for range.minimumValue (QTBUG-51765) and range.maximumValue (QTBUG-63354). */ property real __handlePos: range.valueForPosition(__horizontal ? fakeHandle.x : fakeHandle.y, - range.positionAtMinimum, range.positionAtMaximum, range.minimumValue) + range.positionAtMinimum, range.positionAtMaximum, range.minimumValue, range.maximumValue) activeFocusOnTab: true diff --git a/src/controls/Styles/Android/qmldir b/src/controls/Styles/Android/qmldir index 21bff691..d07efdb6 100644 --- a/src/controls/Styles/Android/qmldir +++ b/src/controls/Styles/Android/qmldir @@ -2,3 +2,28 @@ module QtQuick.Controls.Styles.Android plugin qtquickcontrolsandroidstyleplugin classname QtQuickControlsAndroidStylePlugin singleton AndroidStyle 1.0 AndroidStyle.qml +internal ApplicationWindowStyle ApplicationWindowStyle.qml +internal BusyIndicatorStyle BusyIndicatorStyle.qml +internal ButtonStyle ButtonStyle.qml +internal CalendarStyle CalendarStyle.qml +internal CheckBoxStyle CheckBoxStyle.qml +internal ComboBoxStyle ComboBoxStyle.qml +internal CursorHandleStyle CursorHandleStyle.qml +internal FocusFrameStyle FocusFrameStyle.qml +internal GroupBoxStyle GroupBoxStyle.qml +internal LabelStyle LabelStyle.qml +internal MenuBarStyle MenuBarStyle.qml +internal MenuStyle MenuStyle.qml +internal ProgressBarStyle ProgressBarStyle.qml +internal RadioButtonStyle RadioButtonStyle.qml +internal ScrollViewStyle ScrollViewStyle.qml +internal SliderStyle SliderStyle.qml +internal SpinBoxStyle SpinBoxStyle.qml +internal StatusBarStyle StatusBarStyle.qml +internal SwitchStyle SwitchStyle.qml +internal TableViewStyle TableViewStyle.qml +internal TabViewStyle TabViewStyle.qml +internal TextAreaStyle TextAreaStyle.qml +internal TextFieldStyle TextFieldStyle.qml +internal ToolBarStyle ToolBarStyle.qml +internal ToolButtonStyle ToolButtonStyle.qml diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index 5a5a9605..f78098ec 100644 --- a/src/controls/plugin.cpp +++ b/src/controls/plugin.cpp @@ -75,6 +75,7 @@ static void initResources() { #ifdef QT_STATIC Q_INIT_RESOURCE(qmake_QtQuick_Controls); + Q_INIT_RESOURCE(qmake_controls); #endif } diff --git a/src/dialogs/dialogs.pro b/src/dialogs/dialogs.pro index ca5f408e..362f5584 100644 --- a/src/dialogs/dialogs.pro +++ b/src/dialogs/dialogs.pro @@ -3,7 +3,7 @@ requires(contains(QT_CONFIG, accessibility)) CXX_MODULE = qml TARGET = dialogplugin TARGETPATH = QtQuick/Dialogs -IMPORT_VERSION = 1.2 +IMPORT_VERSION = 1.3 QMAKE_DOCS = $$PWD/doc/qtquickdialogs.qdocconf diff --git a/src/dialogs/plugin.cpp b/src/dialogs/plugin.cpp index a2fb1099..2e861fa5 100644 --- a/src/dialogs/plugin.cpp +++ b/src/dialogs/plugin.cpp @@ -72,7 +72,7 @@ static void initResources() QT_BEGIN_NAMESPACE /*! - \qmlmodule QtQuick.Dialogs 1.2 + \qmlmodule QtQuick.Dialogs 1.3 \title Qt Quick Dialogs QML Types \ingroup qmlmodules \brief Provides QML types for standard file, color picker and message dialogs @@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE To use the types in this module, import the module with the following line: \code - import QtQuick.Dialogs 1.2 + import QtQuick.Dialogs 1.3 \endcode */ @@ -185,6 +185,7 @@ public: #endif qCDebug(lcRegistration) << " registering" << dialogQmlPath << "as Dialog"; qmlRegisterType(dialogQmlPath, uri, 1, 2, "Dialog"); + qmlRegisterType(dialogQmlPath, uri, 1, 3, "Dialog"); } } diff --git a/src/dialogs/qquickabstractfiledialog.cpp b/src/dialogs/qquickabstractfiledialog.cpp index 49d98a1a..b80bf86b 100644 --- a/src/dialogs/qquickabstractfiledialog.cpp +++ b/src/dialogs/qquickabstractfiledialog.cpp @@ -318,4 +318,12 @@ QJSValue QQuickAbstractFileDialog::__shortcuts() return m_shortcutDetails; } +void QQuickAbstractFileDialog::setDefaultSuffix(const QString &suffix) +{ + if (suffix == m_options->defaultSuffix()) + return; + m_options->setDefaultSuffix(suffix); + emit defaultSuffixChanged(); +} + QT_END_NAMESPACE diff --git a/src/dialogs/qquickabstractfiledialog_p.h b/src/dialogs/qquickabstractfiledialog_p.h index b4b7165d..cb7ac27e 100644 --- a/src/dialogs/qquickabstractfiledialog_p.h +++ b/src/dialogs/qquickabstractfiledialog_p.h @@ -74,6 +74,7 @@ class QQuickAbstractFileDialog : public QQuickAbstractDialog Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY selectionAccepted) Q_PROPERTY(QList<QUrl> fileUrls READ fileUrls NOTIFY selectionAccepted) Q_PROPERTY(bool sidebarVisible READ sidebarVisible WRITE setSidebarVisible NOTIFY sidebarVisibleChanged) + Q_PROPERTY(QString defaultSuffix READ defaultSuffix WRITE setDefaultSuffix NOTIFY defaultSuffixChanged) Q_PROPERTY(QJSValue shortcuts READ shortcuts NOTIFY shortcutsChanged) // map of QStandardDirectory names to QUrls Q_PROPERTY(QJSValue __shortcuts READ __shortcuts NOTIFY shortcutsChanged) // map of details for QML dialog implementations @@ -95,6 +96,7 @@ public: bool sidebarVisible() const { return m_sidebarVisible; } QJSValue shortcuts(); QJSValue __shortcuts(); + QString defaultSuffix() const { return m_options->defaultSuffix(); } public Q_SLOTS: void setVisible(bool v); @@ -107,6 +109,7 @@ public Q_SLOTS: void selectNameFilter(const QString &f); void setSelectedNameFilterIndex(int idx); void setSidebarVisible(bool s); + void setDefaultSuffix(const QString &suffix); Q_SIGNALS: void folderChanged(); @@ -116,6 +119,7 @@ Q_SIGNALS: void selectionAccepted(); void sidebarVisibleChanged(); void shortcutsChanged(); + void defaultSuffixChanged(); protected Q_SLOTS: void updateFolder(const QUrl &f); diff --git a/src/dialogs/qquickplatformfiledialog.cpp b/src/dialogs/qquickplatformfiledialog.cpp index ab228d1f..b30f2b2b 100644 --- a/src/dialogs/qquickplatformfiledialog.cpp +++ b/src/dialogs/qquickplatformfiledialog.cpp @@ -422,4 +422,18 @@ void QQuickPlatformFileDialog::accept() \l {Qt.labs.settings}{Settings}. */ +/*! + \qmlproperty string FileDialog::defaultSuffix + \since 5.10 + + This property holds the suffix added to the filename if no other suffix was + specified. + + This property specifies a string that will be added to the filename if it + has no suffix already. The suffix is typically used to indicate the file + type (e.g. "txt" indicates a text file). + + If the first character is a dot ('.'), it is removed. +*/ + QT_END_NAMESPACE diff --git a/src/extras/doc/qtquickextras.qdocconf b/src/extras/doc/qtquickextras.qdocconf index 5c4dc472..4d6128db 100644 --- a/src/extras/doc/qtquickextras.qdocconf +++ b/src/extras/doc/qtquickextras.qdocconf @@ -43,3 +43,6 @@ imagedirs += images navigation.landingpage = "Qt Quick Extras" navigation.qmltypespage = "Qt Quick Extras QML Types" +manifestmeta.highlighted.names = "QtQuickExtras/Qt Quick Extras - Dashboard" \ + "QtQuickExtras/Qt Quick Extras - Flat" \ + "QtQuickExtras/Qt Quick Extras - Gallery" diff --git a/src/extras/doc/src/qtquickextras-examples.qdoc b/src/extras/doc/src/qtquickextras-examples.qdoc index f54834fd..8ae35ef5 100644 --- a/src/extras/doc/src/qtquickextras-examples.qdoc +++ b/src/extras/doc/src/qtquickextras-examples.qdoc @@ -31,7 +31,7 @@ \title Qt Quick Extras Examples \brief A collection of examples for \l{Qt Quick Extras}. - Below is a listing of the examples for \l{Qt Quick Extras}. + Below you will find a list with examples for \l{Qt Quick Extras}. */ /*! @@ -53,6 +53,41 @@ \image qtquickextras-example-dashboard.png This example project demonstrates the use of \l CircularGauge to create a car dashboard. + + + The ValueSource type generates random data for testing the dashboard. + The data is random but there is a logical link between some of them, + for example, \c kph and \c rpm. + + + \snippet dashboard/qml/ValueSource.qml 0 + + It runs a looping SequentialAnimation that sets the values of + the properties over time. + + The SequentialAnimation object consists of several ParallelAnimation + objects, which in turn consist of two NumberAnimations, one for + \c kph and one for \c rpm. Both let the value develop to a certain + value over a specified \c duration with the Easing type \c Easing.InOutSine + + \snippet dashboard/qml/ValueSource.qml 1 + + The flashTimer object switches the turn signals \c on or \c off. + + \snippet dashboard/qml/TurnIndicator.qml 1 + + The \c paintOutlinePath(ctx) method does the actual painting of the arrow + for the turn signal. + + \snippet dashboard/qml/TurnIndicator.qml 2 + + The screen consists of a \c foregroundCanvas and a \c backgroundCanvas. + \c foregroundCanvas displays the green turn signal if the \c on and + \c flashing booleans are \c true. + + \snippet dashboard/qml/TurnIndicator.qml 3 +*/ + */ /*! 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" ] + } } } |