aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-07-17 15:40:17 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-07-17 15:40:17 +0200
commit50244fc5d6f0730a447f1ac1ce19827890bc1456 (patch)
treefd937513dc616c270a1b8da23f982c2b9a7b6ac2
parentbf727efa7aa9a4738ae86a2c699832129813c670 (diff)
parent49ffc6e6af83b295c67fd119b79c925879cc292e (diff)
Merge branch 'dev' into nativestyle
-rw-r--r--coin/module_config.yaml2
-rw-r--r--dependencies.yaml6
-rw-r--r--dist/changes-5.14.240
-rw-r--r--dist/changes-5.15.080
-rw-r--r--examples/quickcontrols2/gallery/.prev_CMakeLists.txt103
-rw-r--r--examples/quickcontrols2/gallery/CMakeLists.txt10
-rw-r--r--examples/quickcontrols2/sidepanel/sidepanel.qml2
-rw-r--r--examples/quickcontrols2/texteditor/documenthandler.cpp15
-rw-r--r--src/imports/controls/ApplicationWindow.qml8
-rw-r--r--src/imports/controls/designer/ControlSection.qml4
-rw-r--r--src/imports/controls/designer/DialSpecifics.qml14
-rw-r--r--src/imports/controls/designer/InsetSection.qml119
-rw-r--r--src/imports/controls/designer/LabelSpecifics.qml4
-rw-r--r--src/imports/controls/designer/PageIndicatorSpecifics.qml16
-rw-r--r--src/imports/controls/designer/RangeSliderSpecifics.qml14
-rw-r--r--src/imports/controls/designer/RoundButtonSpecifics.qml5
-rw-r--r--src/imports/controls/designer/SliderSpecifics.qml14
-rw-r--r--src/imports/controls/designer/SpinBoxSpecifics.qml12
-rw-r--r--src/imports/controls/designer/TextAreaSpecifics.qml27
-rw-r--r--src/imports/controls/designer/TextFieldSpecifics.qml27
-rw-r--r--src/imports/controls/designer/designer.pri1
-rw-r--r--src/imports/controls/doc/qtquickcontrols.qdocconf2
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-overview.cmake4
-rw-r--r--src/imports/controls/doc/src/includes/qquickicon.qdocinc2
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-cppclasses.qdoc1
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc12
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc1
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc5
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-index.qdoc29
-rw-r--r--src/imports/controls/fusion/ApplicationWindow.qml8
-rw-r--r--src/imports/controls/fusion/plugins.qmltypes2
-rw-r--r--src/imports/controls/imagine/ApplicationWindow.qml20
-rw-r--r--src/imports/controls/imagine/Drawer.qml2
-rw-r--r--src/imports/controls/imagine/plugins.qmltypes14
-rw-r--r--src/imports/controls/imagine/qquickninepatchimage.cpp36
-rw-r--r--src/imports/controls/material/ApplicationWindow.qml10
-rw-r--r--src/imports/controls/material/ComboBox.qml2
-rw-r--r--src/imports/controls/material/plugins.qmltypes3
-rw-r--r--src/imports/controls/material/qquickmaterialstyle.cpp1
-rw-r--r--src/imports/controls/plugins.qmltypes18
-rw-r--r--src/imports/controls/universal/ApplicationWindow.qml8
-rw-r--r--src/imports/controls/universal/plugins.qmltypes2
-rw-r--r--src/imports/controls/universal/qquickuniversalfocusrectangle.cpp2
-rw-r--r--src/imports/platform/qquickplatformfiledialog.cpp17
-rw-r--r--src/imports/platform/qquickplatformfolderdialog.cpp1
-rw-r--r--src/imports/platform/qquickplatformmenu.cpp48
-rw-r--r--src/imports/platform/qquickplatformmenu_p.h10
-rw-r--r--src/imports/platform/qquickplatformmenuitem.cpp42
-rw-r--r--src/imports/platform/qquickplatformmenuitem_p.h10
-rw-r--r--src/imports/platform/qquickplatformmenuitemgroup_p.h4
-rw-r--r--src/imports/platform/qquickplatformmessagedialog.cpp1
-rw-r--r--src/imports/platform/qquickplatformsystemtrayicon.cpp42
-rw-r--r--src/imports/platform/qquickplatformsystemtrayicon_p.h10
-rw-r--r--src/imports/platform/widgets/qwidgetplatform_p.h4
-rw-r--r--src/imports/platform/widgets/qwidgetplatformmenu_p.h2
-rw-r--r--src/imports/templates/plugins.qmltypes80
-rw-r--r--src/quickcontrols2/configure.cmake17
-rw-r--r--src/quickcontrols2/qquickmnemoniclabel.cpp2
-rw-r--r--src/quickcontrols2/qquickstyle.cpp6
-rw-r--r--src/quickcontrols2/qquickstyleplugin.cpp2
-rw-r--r--src/quicktemplates2/configure.cmake8
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp1
-rw-r--r--src/quicktemplates2/qquickaction.cpp1
-rw-r--r--src/quicktemplates2/qquickaction_p_p.h2
-rw-r--r--src/quicktemplates2/qquickactiongroup.cpp2
-rw-r--r--src/quicktemplates2/qquickapplicationwindow.cpp78
-rw-r--r--src/quicktemplates2/qquickapplicationwindow_p.h7
-rw-r--r--src/quicktemplates2/qquickbuttongroup.cpp2
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp178
-rw-r--r--src/quicktemplates2/qquickcombobox_p.h17
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp10
-rw-r--r--src/quicktemplates2/qquickdialogbuttonbox.cpp2
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp2
-rw-r--r--src/quicktemplates2/qquickheaderview.cpp4
-rw-r--r--src/quicktemplates2/qquicklabel.cpp2
-rw-r--r--src/quicktemplates2/qquickmenu_p_p.h4
-rw-r--r--src/quicktemplates2/qquickoverlay.cpp18
-rw-r--r--src/quicktemplates2/qquickoverlay_p_p.h8
-rw-r--r--src/quicktemplates2/qquickpane.cpp4
-rw-r--r--src/quicktemplates2/qquickpopup.cpp14
-rw-r--r--src/quicktemplates2/qquickpopupanchors.cpp26
-rw-r--r--src/quicktemplates2/qquickpopupanchors_p.h6
-rw-r--r--src/quicktemplates2/qquickpresshandler.cpp13
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp16
-rw-r--r--src/quicktemplates2/qquickscrollbar.cpp2
-rw-r--r--src/quicktemplates2/qquickslider.cpp12
-rw-r--r--src/quicktemplates2/qquickspinbox.cpp4
-rw-r--r--src/quicktemplates2/qquicksplitview.cpp4
-rw-r--r--src/quicktemplates2/qquicksplitview_p_p.h2
-rw-r--r--src/quicktemplates2/qquickstackview.cpp13
-rw-r--r--src/quicktemplates2/qquickstackview_p.h2
-rw-r--r--src/quicktemplates2/qquickswipedelegate.cpp16
-rw-r--r--src/quicktemplates2/qquickswitch.cpp6
-rw-r--r--src/quicktemplates2/qquickswitchdelegate.cpp6
-rw-r--r--src/quicktemplates2/qquicktabbar.cpp2
-rw-r--r--src/quicktemplates2/qquicktextfield.cpp2
-rw-r--r--tests/auto/accessibility/tst_accessibility.cpp8
-rw-r--r--tests/auto/controls/data/tst_combobox.qml186
-rw-r--r--tests/auto/controls/data/tst_popup.qml43
-rw-r--r--tests/auto/cursor/tst_cursor.cpp1
-rw-r--r--tests/auto/designer/tst_designer.cpp2
-rw-r--r--tests/auto/focus/tst_focus.cpp28
-rw-r--r--tests/auto/platform/data/tst_menuitem.qml31
-rw-r--r--tests/auto/platform/data/tst_systemtrayicon.qml46
-rw-r--r--tests/auto/qquickapplicationwindow/data/attachedProperties.qml11
-rw-r--r--tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp19
-rw-r--r--tests/auto/qquickcontrol/tst_qquickcontrol.cpp15
-rw-r--r--tests/auto/qquickdrawer/tst_qquickdrawer.cpp35
-rw-r--r--tests/auto/qquickheaderview/tst_qquickheaderview.cpp2
-rw-r--r--tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp8
-rw-r--r--tests/auto/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp2
-rw-r--r--tests/auto/qquickmenu/data/applicationwindow.qml1
-rw-r--r--tests/auto/qquickmenu/tst_qquickmenu.cpp81
-rw-r--r--tests/auto/qquickpopup/data/centerInOverlayWithinStackViewItem.qml80
-rw-r--r--tests/auto/qquickpopup/tst_qquickpopup.cpp54
-rw-r--r--tests/auto/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp1
-rw-r--r--tests/auto/sanity/tst_sanity.cpp4
-rw-r--r--tests/auto/shared/visualtestutil.h35
-rw-r--r--tests/manual/gifs/eventcapturer.cpp4
-rw-r--r--tests/manual/gifs/eventcapturer.h6
-rw-r--r--tests/manual/gifs/tst_gifs.cpp20
-rw-r--r--tests/manual/headerview/main.cpp2
-rw-r--r--tests/manual/systemtrayicon/systemtrayicon.qml2
-rw-r--r--tests/manual/viewinqwidget/main.cpp4
124 files changed, 1516 insertions, 716 deletions
diff --git a/coin/module_config.yaml b/coin/module_config.yaml
index 7f31a554..16d158c6 100644
--- a/coin/module_config.yaml
+++ b/coin/module_config.yaml
@@ -9,4 +9,4 @@ instructions:
- !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml"
Test:
- - !include "{{qt/qtbase}}/coin_module_test_template_v2.yaml"
+ - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
diff --git a/dependencies.yaml b/dependencies.yaml
index e0a7041d..448e1e02 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,10 +1,10 @@
dependencies:
../qtdeclarative:
- ref: f621603692ccc76c077ba3911048d823f80e4bd5
+ ref: 08dbc9940bcb4d139313f03f2aec5a1cbccdbfd3
required: true
../qtgraphicaleffects:
- ref: 93e05abbbebc9ff5d2daecbe3b03978cfc00af03
+ ref: 91f09163d8f818e94387dc17ab316eb85ade77ae
required: false
../qtimageformats:
- ref: c81d38a6bf9eb5f11e71c45f8dbd0f8cd9c59d6b
+ ref: b9e758061a118d212ad0cab5de9425de6bb134c8
required: false
diff --git a/dist/changes-5.14.2 b/dist/changes-5.14.2
new file mode 100644
index 00000000..95572790
--- /dev/null
+++ b/dist/changes-5.14.2
@@ -0,0 +1,40 @@
+Qt 5.14.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.14.0 through 5.14.1.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.14 series is binary compatible with the 5.13.x series.
+Applications compiled for 5.13 will continue to run with 5.14.
+
+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-82032] AbstractButton: fixed clicked() being emitted after
+ doubleClicked().
+ - [QTBUG-81935] ToolTip: fixed timeout not activating if opened during exit
+ transition.
+ - [QTBUG-77202] Control: we now account for when a touch event is
+ synthesized by Qt as a mouse event.
+ - [QTBUG-81796] DialogButtonBox: fixed explicitly set button text not being
+ rendered.
+ - [QTBUG-75682] Fixed issue where Qt Quick Designer was not able to work
+ with the module on WebAssembly/static builds.
+ - [QTBUG-80970] RangeSlider: fixed errors in the documentation's example
+ code.
+ - [QDS-456] placeholderText is now set by default in Qt Design Studio
+ instead of text when dragging a TextField or TextArea onto the form
+ editor.
+ - [QTBUG-81216] Fixed QQuickStyle::setFallbackStyle() not working on
+ Android.
diff --git a/dist/changes-5.15.0 b/dist/changes-5.15.0
new file mode 100644
index 00000000..b20691ea
--- /dev/null
+++ b/dist/changes-5.15.0
@@ -0,0 +1,80 @@
+Qt 5.15 introduces many new features and improvements as well as bugfixes
+over the 5.14.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+https://doc.qt.io/qt-5/index.html
+
+The Qt version 5.15 series is binary compatible with the 5.14.x series.
+Applications compiled for 5.14 will continue to run with 5.15.
+
+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.
+
+Qt 5.15 introduces many new features and improvements as well as bugfixes
+over the 5.14.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+ https://doc.qt.io/qt-5.15/index.html
+
+The Qt version 5.15 series is binary compatible with the 5.14.x series.
+Applications compiled for 5.14 will continue to run with 5.15.
+
+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.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - [QTBUG-72085] Old delegate items (background, contentItem, etc.) are no
+ longer destroyed, as they are technically owned by user code. Instead,
+ they are hidden, unparented from the control (QQuickItem parent, not
+ QObject), and Accessible.ignored is set to true. This prevents them from
+ being unintentionally visible and interfering with the accessibility
+ tree when a new delegate item is set.
+
+ See the following page for more information:
+
+ https://doc.qt.io/qt-5/qtquickcontrols2-customize.html#considerations-for-custom-styles
+
+****************************************************************************
+* Controls *
+****************************************************************************
+
+- Added HorizontalHeaderView and VerticalHeaderView for use with TableView.
+- Added selectTextByMouse property to ComboBox.
+- [QTBUG-82473] Fixed Menu not taking padding into account when checking
+ if it is interactive.
+- [QTBUG-73687] Fixed Menu positioning when a scale is set.
+- [QTBUG-81867] Fixed hidden SplitView items causing visible items to not
+ be resizable.
+- [QTBUG-82020] Fixed ComboBox text not being retranslated after a
+ translator is installed.
+- [QTBUG-79501] Fixed keyboard navigation via tab in non-modal popups
+ (i.e. Drawer).
+- [QTBUG-78858] Fixed Editable ComboBox's auto-completion performance.
+
+****************************************************************************
+* Styles *
+****************************************************************************
+
+Material
+--------
+- [QTBUG-70768] Added missing visual distinction between enabled and
+ disabled sliders.
+- [QTBUG-70768] Aligned Slider's visuals closer to the Material Design
+ guidelines.
+
+Imagine
+-------
+- [QTBUG-82463] Fixed squished Dial.
diff --git a/examples/quickcontrols2/gallery/.prev_CMakeLists.txt b/examples/quickcontrols2/gallery/.prev_CMakeLists.txt
new file mode 100644
index 00000000..a175afa9
--- /dev/null
+++ b/examples/quickcontrols2/gallery/.prev_CMakeLists.txt
@@ -0,0 +1,103 @@
+# Generated from gallery.pro.
+
+cmake_minimum_required(VERSION 3.14)
+project(gallery LANGUAGES CXX)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_AUTOUIC ON)
+
+if(NOT DEFINED INSTALL_EXAMPLESDIR)
+ set(INSTALL_EXAMPLESDIR "examples")
+endif()
+
+set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols2/gallery")
+
+find_package(Qt6 COMPONENTS Core)
+find_package(Qt6 COMPONENTS Gui)
+find_package(Qt6 COMPONENTS Quick)
+find_package(Qt6 COMPONENTS QuickControls2)
+
+add_qt_gui_executable(gallery
+ gallery.cpp
+)
+target_link_libraries(gallery PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::Quick
+ Qt::QuickControls2
+)
+
+
+# Resources:
+set(qmake_immediate_resource_files
+ "gallery.qml"
+ "icons/gallery/20x20/back.png"
+ "icons/gallery/20x20/drawer.png"
+ "icons/gallery/20x20/menu.png"
+ "icons/gallery/20x20@2/back.png"
+ "icons/gallery/20x20@2/drawer.png"
+ "icons/gallery/20x20@2/menu.png"
+ "icons/gallery/20x20@3/back.png"
+ "icons/gallery/20x20@3/drawer.png"
+ "icons/gallery/20x20@3/menu.png"
+ "icons/gallery/20x20@4/back.png"
+ "icons/gallery/20x20@4/drawer.png"
+ "icons/gallery/20x20@4/menu.png"
+ "icons/gallery/index.theme"
+ "images/arrow.png"
+ "images/arrow@2x.png"
+ "images/arrow@3x.png"
+ "images/arrow@4x.png"
+ "images/arrows.png"
+ "images/arrows@2x.png"
+ "images/arrows@3x.png"
+ "images/arrows@4x.png"
+ "images/qt-logo.png"
+ "images/qt-logo@2x.png"
+ "images/qt-logo@3x.png"
+ "images/qt-logo@4x.png"
+ "pages/BusyIndicatorPage.qml"
+ "pages/ButtonPage.qml"
+ "pages/CheckBoxPage.qml"
+ "pages/ComboBoxPage.qml"
+ "pages/DelayButtonPage.qml"
+ "pages/DelegatePage.qml"
+ "pages/DialPage.qml"
+ "pages/DialogPage.qml"
+ "pages/FramePage.qml"
+ "pages/GroupBoxPage.qml"
+ "pages/PageIndicatorPage.qml"
+ "pages/ProgressBarPage.qml"
+ "pages/RadioButtonPage.qml"
+ "pages/RangeSliderPage.qml"
+ "pages/ScrollBarPage.qml"
+ "pages/ScrollIndicatorPage.qml"
+ "pages/ScrollablePage.qml"
+ "pages/SliderPage.qml"
+ "pages/SpinBoxPage.qml"
+ "pages/StackViewPage.qml"
+ "pages/SwipeViewPage.qml"
+ "pages/SwitchPage.qml"
+ "pages/TabBarPage.qml"
+ "pages/TextAreaPage.qml"
+ "pages/TextFieldPage.qml"
+ "pages/ToolTipPage.qml"
+ "pages/TumblerPage.qml"
+ "qtquickcontrols2.conf"
+)
+
+qt6_add_resources(gallery "qmake_immediate"
+ PREFIX
+ "/"
+ FILES
+ ${qmake_immediate_resource_files}
+)
+
+install(TARGETS gallery
+ RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
+ BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
+ LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
+)
diff --git a/examples/quickcontrols2/gallery/CMakeLists.txt b/examples/quickcontrols2/gallery/CMakeLists.txt
index a175afa9..d4c9df04 100644
--- a/examples/quickcontrols2/gallery/CMakeLists.txt
+++ b/examples/quickcontrols2/gallery/CMakeLists.txt
@@ -1,7 +1,7 @@
# Generated from gallery.pro.
cmake_minimum_required(VERSION 3.14)
-project(gallery LANGUAGES CXX)
+project(gallery_controls2 LANGUAGES CXX) # special case
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -20,10 +20,10 @@ find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS Quick)
find_package(Qt6 COMPONENTS QuickControls2)
-add_qt_gui_executable(gallery
+add_qt_gui_executable(gallery_controls2 # special case
gallery.cpp
)
-target_link_libraries(gallery PUBLIC
+target_link_libraries(gallery_controls2 PUBLIC # special case
Qt::Core
Qt::Gui
Qt::Quick
@@ -89,14 +89,14 @@ set(qmake_immediate_resource_files
"qtquickcontrols2.conf"
)
-qt6_add_resources(gallery "qmake_immediate"
+qt6_add_resources(gallery_controls2 "qmake_immediate" # special case
PREFIX
"/"
FILES
${qmake_immediate_resource_files}
)
-install(TARGETS gallery
+install(TARGETS gallery_controls2 # special case
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/examples/quickcontrols2/sidepanel/sidepanel.qml b/examples/quickcontrols2/sidepanel/sidepanel.qml
index a0c69fb2..7f207e2f 100644
--- a/examples/quickcontrols2/sidepanel/sidepanel.qml
+++ b/examples/quickcontrols2/sidepanel/sidepanel.qml
@@ -68,7 +68,7 @@ ApplicationWindow {
z: 1
width: parent.width
- parent: window.overlay
+ parent: Overlay.overlay
Label {
id: label
diff --git a/examples/quickcontrols2/texteditor/documenthandler.cpp b/examples/quickcontrols2/texteditor/documenthandler.cpp
index e840d411..090e0684 100644
--- a/examples/quickcontrols2/texteditor/documenthandler.cpp
+++ b/examples/quickcontrols2/texteditor/documenthandler.cpp
@@ -57,7 +57,7 @@
#include <QQmlFileSelector>
#include <QQuickTextDocument>
#include <QTextCharFormat>
-#include <QTextCodec>
+#include <QStringDecoder>
#include <QTextDocument>
#include <QDebug>
@@ -295,12 +295,19 @@ void DocumentHandler::load(const QUrl &fileUrl)
if (QFile::exists(fileName)) {
QFile file(fileName);
if (file.open(QFile::ReadOnly)) {
- QByteArray data = file.readAll();
- QTextCodec *codec = QTextCodec::codecForHtml(data);
if (QTextDocument *doc = textDocument())
doc->setModified(false);
- emit loaded(codec->toUnicode(data));
+ QByteArray data = file.readAll();
+ auto encoding = QStringConverter::encodingForHtml(data.constData(), data.size());
+ if (encoding) {
+ QStringDecoder decoder(*encoding);
+ emit loaded(decoder(data));
+ } else {
+ // fall back to utf8
+ emit loaded(QString::fromUtf8(data));
+ }
+
reset();
}
}
diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml
index 85dfd279..235ebf13 100644
--- a/src/imports/controls/ApplicationWindow.qml
+++ b/src/imports/controls/ApplicationWindow.qml
@@ -44,12 +44,4 @@ T.ApplicationWindow {
id: window
color: window.palette.window
-
- overlay.modal: Rectangle {
- color: Color.transparent(window.palette.shadow, 0.5)
- }
-
- overlay.modeless: Rectangle {
- color: Color.transparent(window.palette.shadow, 0.12)
- }
}
diff --git a/src/imports/controls/designer/ControlSection.qml b/src/imports/controls/designer/ControlSection.qml
index 7c53ac73..3446c08f 100644
--- a/src/imports/controls/designer/ControlSection.qml
+++ b/src/imports/controls/designer/ControlSection.qml
@@ -69,7 +69,7 @@ Section {
Label {
text: qsTr("Hover")
- tooltip: qsTr("Whether control accepts hover evets.")
+ tooltip: qsTr("Whether control accepts hover events.")
}
SecondColumnLayout {
CheckBox {
@@ -95,7 +95,7 @@ Section {
Label {
text: qsTr("Wheel")
- tooltip: qsTr("Whether control accepts wheel evets.")
+ tooltip: qsTr("Whether control accepts wheel events.")
}
SecondColumnLayout {
CheckBox {
diff --git a/src/imports/controls/designer/DialSpecifics.qml b/src/imports/controls/designer/DialSpecifics.qml
index fc5b5e83..a0df81ef 100644
--- a/src/imports/controls/designer/DialSpecifics.qml
+++ b/src/imports/controls/designer/DialSpecifics.qml
@@ -112,7 +112,7 @@ Column {
}
SecondColumnLayout {
ComboBox {
- backendValue: backendValues.orientation
+ backendValue: backendValues.snapMode
model: [ "NoSnap", "SnapOnRelease", "SnapAlways" ]
scope: "Dial"
Layout.fillWidth: true
@@ -143,6 +143,18 @@ Column {
Layout.fillWidth: true
}
}
+
+ Label {
+ text: qsTr("Wrap")
+ tooltip: qsTr("Whether the dial wraps when dragged.")
+ }
+ SecondColumnLayout {
+ CheckBox {
+ text: backendValues.wrap.valueToString
+ backendValue: backendValues.wrap
+ Layout.fillWidth: true
+ }
+ }
}
}
diff --git a/src/imports/controls/designer/InsetSection.qml b/src/imports/controls/designer/InsetSection.qml
new file mode 100644
index 00000000..4253b170
--- /dev/null
+++ b/src/imports/controls/designer/InsetSection.qml
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** 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 http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.12
+import HelperWidgets 2.0
+import QtQuick.Layouts 1.12
+
+Section {
+ caption: qsTr("Inset")
+
+ SectionLayout {
+ Label {
+ text: qsTr("Vertical")
+ }
+ SecondColumnLayout {
+ Label {
+ text: qsTr("Top")
+ tooltip: qsTr("Top inset for the background.")
+ width: 42
+ }
+ SpinBox {
+ maximumValue: 10000
+ minimumValue: -10000
+ realDragRange: 5000
+ decimals: 0
+ backendValue: backendValues.topInset
+ Layout.fillWidth: true
+ }
+ Item {
+ width: 4
+ height: 4
+ }
+
+ Label {
+ text: qsTr("Bottom")
+ tooltip: qsTr("Bottom inset for the background.")
+ width: 42
+ }
+ SpinBox {
+ maximumValue: 10000
+ minimumValue: -10000
+ realDragRange: 5000
+ decimals: 0
+ backendValue: backendValues.bottomInset
+ Layout.fillWidth: true
+ }
+ }
+
+ Label {
+ text: qsTr("Horizontal")
+ }
+ SecondColumnLayout {
+ Label {
+ text: qsTr("Left")
+ tooltip: qsTr("Left inset for the background.")
+ width: 42
+ }
+ SpinBox {
+ maximumValue: 10000
+ minimumValue: -10000
+ realDragRange: 5000
+ decimals: 0
+ backendValue: backendValues.leftInset
+ Layout.fillWidth: true
+ }
+ Item {
+ width: 4
+ height: 4
+ }
+
+ Label {
+ text: qsTr("Right")
+ tooltip: qsTr("Right inset for the background.")
+ width: 42
+ }
+ SpinBox {
+ maximumValue: 10000
+ minimumValue: -10000
+ realDragRange: 5000
+ decimals: 0
+ backendValue: backendValues.rightInset
+ Layout.fillWidth: true
+ }
+ }
+ }
+}
diff --git a/src/imports/controls/designer/LabelSpecifics.qml b/src/imports/controls/designer/LabelSpecifics.qml
index c832f894..e5d5e04f 100644
--- a/src/imports/controls/designer/LabelSpecifics.qml
+++ b/src/imports/controls/designer/LabelSpecifics.qml
@@ -79,4 +79,8 @@ Column {
PaddingSection {
width: parent.width
}
+
+ InsetSection {
+ width: parent.width
+ }
}
diff --git a/src/imports/controls/designer/PageIndicatorSpecifics.qml b/src/imports/controls/designer/PageIndicatorSpecifics.qml
index 042672a9..20aa8577 100644
--- a/src/imports/controls/designer/PageIndicatorSpecifics.qml
+++ b/src/imports/controls/designer/PageIndicatorSpecifics.qml
@@ -73,6 +73,18 @@ Column {
Layout.fillWidth: true
}
}
+
+ Label {
+ text: qsTr("Interactive")
+ tooltip: qsTr("Whether the control is interactive.")
+ }
+ SecondColumnLayout {
+ CheckBox {
+ text: backendValues.interactive.valueToString
+ backendValue: backendValues.interactive
+ Layout.fillWidth: true
+ }
+ }
}
}
@@ -80,10 +92,6 @@ Column {
width: parent.width
}
- FontSection {
- width: parent.width
- }
-
PaddingSection {
width: parent.width
}
diff --git a/src/imports/controls/designer/RangeSliderSpecifics.qml b/src/imports/controls/designer/RangeSliderSpecifics.qml
index 79d2404f..2324a66f 100644
--- a/src/imports/controls/designer/RangeSliderSpecifics.qml
+++ b/src/imports/controls/designer/RangeSliderSpecifics.qml
@@ -158,6 +158,20 @@ Column {
Layout.fillWidth: true
}
}
+
+ Label {
+ text: qsTr("Touch drag threshold")
+ tooltip: qsTr("The threshold (in logical pixels) at which a touch drag event will be initiated.")
+ }
+ SecondColumnLayout {
+ SpinBox {
+ minimumValue: 0
+ maximumValue: 10000
+ decimals: 0
+ backendValue: backendValues.touchDragThreshold
+ Layout.fillWidth: true
+ }
+ }
}
}
diff --git a/src/imports/controls/designer/RoundButtonSpecifics.qml b/src/imports/controls/designer/RoundButtonSpecifics.qml
index 2da4cda6..af4ab5d0 100644
--- a/src/imports/controls/designer/RoundButtonSpecifics.qml
+++ b/src/imports/controls/designer/RoundButtonSpecifics.qml
@@ -42,6 +42,7 @@ Column {
width: parent.width
Section {
+ width: parent.width
caption: qsTr("RoundButton")
SectionLayout {
@@ -51,8 +52,8 @@ Column {
}
SecondColumnLayout {
SpinBox {
- maximumValue: 9999999
- minimumValue: -9999999
+ minimumValue: 0
+ maximumValue: 10000
decimals: 0
backendValue: backendValues.radius
Layout.fillWidth: true
diff --git a/src/imports/controls/designer/SliderSpecifics.qml b/src/imports/controls/designer/SliderSpecifics.qml
index 076d8a1c..d126dd06 100644
--- a/src/imports/controls/designer/SliderSpecifics.qml
+++ b/src/imports/controls/designer/SliderSpecifics.qml
@@ -143,6 +143,20 @@ Column {
Layout.fillWidth: true
}
}
+
+ Label {
+ text: qsTr("Touch drag threshold")
+ tooltip: qsTr("The threshold (in logical pixels) at which a touch drag event will be initiated.")
+ }
+ SecondColumnLayout {
+ SpinBox {
+ minimumValue: 0
+ maximumValue: 10000
+ decimals: 0
+ backendValue: backendValues.touchDragThreshold
+ Layout.fillWidth: true
+ }
+ }
}
}
diff --git a/src/imports/controls/designer/SpinBoxSpecifics.qml b/src/imports/controls/designer/SpinBoxSpecifics.qml
index d6375d7c..db59f074 100644
--- a/src/imports/controls/designer/SpinBoxSpecifics.qml
+++ b/src/imports/controls/designer/SpinBoxSpecifics.qml
@@ -113,6 +113,18 @@ Column {
Layout.fillWidth: true
}
}
+
+ Label {
+ text: qsTr("Wrap")
+ tooltip: qsTr("Whether the spinbox wraps.")
+ }
+ SecondColumnLayout {
+ CheckBox {
+ text: backendValues.wrap.valueToString
+ backendValue: backendValues.wrap
+ Layout.fillWidth: true
+ }
+ }
}
}
diff --git a/src/imports/controls/designer/TextAreaSpecifics.qml b/src/imports/controls/designer/TextAreaSpecifics.qml
index a14584e7..f8cf92e8 100644
--- a/src/imports/controls/designer/TextAreaSpecifics.qml
+++ b/src/imports/controls/designer/TextAreaSpecifics.qml
@@ -57,6 +57,29 @@ Column {
}
}
+
+ Label {
+ text: qsTr("Hover")
+ tooltip: qsTr("Whether text area accepts hover events.")
+ }
+ SecondColumnLayout {
+ CheckBox {
+ text: backendValues.hoverEnabled.valueToString
+ backendValue: backendValues.hoverEnabled
+ Layout.fillWidth: true
+ }
+ }
+ }
+ }
+
+ Section {
+ width: parent.width
+ caption: qsTr("Placeholder Text Color")
+
+ ColorEditor {
+ caption: qsTr("Placeholder Text Color")
+ backendValue: backendValues.placeholderTextColor
+ supportGradient: false
}
}
@@ -74,4 +97,8 @@ Column {
PaddingSection {
width: parent.width
}
+
+ InsetSection {
+ width: parent.width
+ }
}
diff --git a/src/imports/controls/designer/TextFieldSpecifics.qml b/src/imports/controls/designer/TextFieldSpecifics.qml
index 67a63ec4..f95f282c 100644
--- a/src/imports/controls/designer/TextFieldSpecifics.qml
+++ b/src/imports/controls/designer/TextFieldSpecifics.qml
@@ -57,6 +57,29 @@ Column {
}
}
+
+ Label {
+ text: qsTr("Hover")
+ tooltip: qsTr("Whether text field accepts hover events.")
+ }
+ SecondColumnLayout {
+ CheckBox {
+ text: backendValues.hoverEnabled.valueToString
+ backendValue: backendValues.hoverEnabled
+ Layout.fillWidth: true
+ }
+ }
+ }
+ }
+
+ Section {
+ width: parent.width
+ caption: qsTr("Placeholder Text Color")
+
+ ColorEditor {
+ caption: qsTr("Placeholder Text Color")
+ backendValue: backendValues.placeholderTextColor
+ supportGradient: false
}
}
@@ -71,4 +94,8 @@ Column {
PaddingSection {
width: parent.width
}
+
+ InsetSection {
+ width: parent.width
+ }
}
diff --git a/src/imports/controls/designer/designer.pri b/src/imports/controls/designer/designer.pri
index 3ad99df7..6692b203 100644
--- a/src/imports/controls/designer/designer.pri
+++ b/src/imports/controls/designer/designer.pri
@@ -17,6 +17,7 @@ AUX_QML_FILES += \
$$PWD/DialSpecifics.qml \
$$PWD/FrameSpecifics.qml \
$$PWD/GroupBoxSpecifics.qml \
+ $$PWD/InsetSection.qml \
$$PWD/ItemDelegateSection.qml \
$$PWD/ItemDelegateSpecifics.qml \
$$PWD/LabelSpecifics.qml \
diff --git a/src/imports/controls/doc/qtquickcontrols.qdocconf b/src/imports/controls/doc/qtquickcontrols.qdocconf
index d52aceb8..604b4b7d 100644
--- a/src/imports/controls/doc/qtquickcontrols.qdocconf
+++ b/src/imports/controls/doc/qtquickcontrols.qdocconf
@@ -33,7 +33,7 @@ qhp.QtQuickControls.subprojects.examples.title = Examples
qhp.QtQuickControls.subprojects.examples.indexTitle = Qt Quick Controls Examples
qhp.QtQuickControls.subprojects.examples.selectors = fake:example
-depends = qtcore qtgui qtdoc qtqml qtqmlmodels qtquick qtquickdialogs qtquickcontrols1 qtquickextras qmake qtsql qtwidgets qtlabscalendar qtlabsplatform qtgraphicaleffects
+depends = qtcore qtgui qtdoc qtqml qtqmlmodels qtquick qtquickdialogs qtquickcontrols1 qtquickextras qtsql qtwidgets qtlabscalendar qtlabsplatform qtgraphicaleffects qmake qtcmake
# Specify the install path under QT_INSTALL_EXAMPLES
# Note: paths passed to \example command must contain the parent directory, e.g.
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-overview.cmake b/src/imports/controls/doc/snippets/qtquickcontrols2-overview.cmake
new file mode 100644
index 00000000..2e9d2f3f
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-overview.cmake
@@ -0,0 +1,4 @@
+#! [0]
+find_package(Qt6 COMPONENTS QuickControls2 REQUIRED)
+target_link_libraries(mytarget Qt::QuickControls2)
+#! [0]
diff --git a/src/imports/controls/doc/src/includes/qquickicon.qdocinc b/src/imports/controls/doc/src/includes/qquickicon.qdocinc
index ba7cede9..beef5624 100644
--- a/src/imports/controls/doc/src/includes/qquickicon.qdocinc
+++ b/src/imports/controls/doc/src/includes/qquickicon.qdocinc
@@ -44,5 +44,7 @@
\li This property specifies whether the icon should be cached.
The default value is true.
+
+ This property was introduced in QtQuick.Controls 2.13.
\endtable
//! [grouped-properties]
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-cppclasses.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-cppclasses.qdoc
index 4a8ecfea..a9147086 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-cppclasses.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-cppclasses.qdoc
@@ -31,6 +31,7 @@
\title Qt Quick Controls C++ Classes
\keyword Qt Quick Controls 2 C++ Classes
\ingroup modules
+ \qtcmakepackage QuickControls2
\qtvariable quickcontrols2
\brief Provides classes for setting up the controls from C++.
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
index 5901663a..938b8d42 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -488,9 +488,7 @@
\section2 Customizing ApplicationWindow
ApplicationWindow consists of one visual item:
- \l {ApplicationWindow::background}{background}. It is also possible
- to customize the \l {ApplicationWindow::overlay}{modal} and
- \l {ApplicationWindow::overlay}{modeless} items.
+ \l {ApplicationWindow::background}{background}.
\code \QtMinorVersion
import QtQuick 2.\1
@@ -505,14 +503,6 @@
GradientStop { position: 1; color: "#c1bbf9" }
}
}
-
- overlay.modal: Rectangle {
- color: "#8f28282a"
- }
-
- overlay.modeless: Rectangle {
- color: "#2f28282a"
- }
}
\endcode
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc
index f8cb1f52..190aafd9 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc
@@ -44,6 +44,7 @@
\li \c icon.width
\li \c icon.height
\li \c icon.color
+ \li \c icon.cache
\endlist
Theme icons are referenced by a name, and regular icons by a source URL. Both
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
index ac2e9cc1..bca826fd 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
@@ -87,11 +87,6 @@
\li active
\li .9.png (or .png)
\row
- \li
- \li overlay
- \li modal
- \li .9.png (or .png)
- \row
\li \l BusyIndicator
\li animation
\li disabled, running, mirrored, hovered
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
index fee009e6..c0047c30 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
@@ -41,7 +41,10 @@
Qt Quick Controls comes with a selection customizable styles.
See \l {Styling Qt Quick Controls} for more details.
- \section1 Prerequisites
+
+ \section1 Using the Module
+
+ \section2 QML API
The \l{Qt Quick Controls QML Types}{QML types} can be imported into your
application using the following import statement in your \c {.qml} file:
@@ -50,22 +53,27 @@
import QtQuick.Controls 2.\1
\endqml
- The \l{Qt Quick Controls C++ Classes}{C++ classes} can be included into
- your application using the following include statement:
+ \section2 C++ API
- \code
- #include <QtQuickControls2>
- \endcode
+ Using the \l{Qt Quick Controls C++ Classes}{C++ API} requires linking against the module library,
+ either directly or through other dependencies.
+ Several build tools have dedicated support for this, including CMake and qmake.
- To link against the corresponding C++ libraries, add the following to your
- qmake project file:
+ \section3 Building with CMake
+ Use the \c find_package() command to locate the needed module components in the Qt6 package:
+
+ \snippet qtquickcontrols2-overview.cmake 0
+
+ See also the \l{Build with CMake} overview.
+
+ \section3 Building with qmake
+ To configure the module for building with qmake,
+ add the module as a value of the QT variable in the project's .pro file:
\code
QT += quickcontrols2
\endcode
- For more details, see \l {Getting Started with Qt Quick Controls}.
-
\section2 Building From Source
When building from source, ensure that the \l {Qt Graphical Effects} module
@@ -145,6 +153,7 @@
\section1 Topics
\list
+ \li \l{Getting Started with Qt Quick Controls}{Getting Started}
\li \l{Qt Quick Controls Guidelines}{Guidelines}
\li \l{Styling Qt Quick Controls}{Styling}
\li \l{Icons in Qt Quick Controls}{Icons}
diff --git a/src/imports/controls/fusion/ApplicationWindow.qml b/src/imports/controls/fusion/ApplicationWindow.qml
index 30c921cb..26dfbbdf 100644
--- a/src/imports/controls/fusion/ApplicationWindow.qml
+++ b/src/imports/controls/fusion/ApplicationWindow.qml
@@ -44,12 +44,4 @@ T.ApplicationWindow {
id: window
color: window.palette.window
-
- overlay.modal: Rectangle {
- color: Fusion.topShadow
- }
-
- overlay.modeless: Rectangle {
- color: Fusion.topShadow
- }
}
diff --git a/src/imports/controls/fusion/plugins.qmltypes b/src/imports/controls/fusion/plugins.qmltypes
index 5140d1e8..681b8b90 100644
--- a/src/imports/controls/fusion/plugins.qmltypes
+++ b/src/imports/controls/fusion/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Fusion 2.14'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Fusion 2.15'
Module {
dependencies: ["QtQuick.Controls 2.0"]
diff --git a/src/imports/controls/imagine/ApplicationWindow.qml b/src/imports/controls/imagine/ApplicationWindow.qml
index 7bfcc3f9..092da1f6 100644
--- a/src/imports/controls/imagine/ApplicationWindow.qml
+++ b/src/imports/controls/imagine/ApplicationWindow.qml
@@ -43,26 +43,6 @@ import QtQuick.Controls.Imagine.impl 2.12
T.ApplicationWindow {
id: window
- // ### remove?
- overlay.modal: NinePatchImage {
- source: Imagine.url + "applicationwindow-overlay"
- NinePatchImageSelector on source {
- states: [
- {"modal": true}
- ]
- }
- }
-
- // ### remove?
- overlay.modeless: NinePatchImage {
- source: Imagine.url + "applicationwindow-overlay"
- NinePatchImageSelector on source {
- states: [
- {"modal": false}
- ]
- }
- }
-
background: NinePatchImage {
width: window.width
height: window.height
diff --git a/src/imports/controls/imagine/Drawer.qml b/src/imports/controls/imagine/Drawer.qml
index 2c93ba75..8f278621 100644
--- a/src/imports/controls/imagine/Drawer.qml
+++ b/src/imports/controls/imagine/Drawer.qml
@@ -42,7 +42,7 @@ import QtQuick.Controls.Imagine.impl 2.12
T.Drawer {
id: control
- parent: T.ApplicationWindow.overlay
+ parent: T.Overlay.overlay
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding)
diff --git a/src/imports/controls/imagine/plugins.qmltypes b/src/imports/controls/imagine/plugins.qmltypes
index 191807ae..785b6dba 100644
--- a/src/imports/controls/imagine/plugins.qmltypes
+++ b/src/imports/controls/imagine/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Imagine 2.14'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Imagine 2.15'
Module {
dependencies: ["QtQuick.Controls 2.0"]
@@ -54,6 +54,7 @@ Module {
Property { name: "verticalAlignment"; type: "VAlignment" }
Property { name: "mipmap"; revision: 3; type: "bool" }
Property { name: "autoTransform"; revision: 5; type: "bool" }
+ Property { name: "sourceClipRect"; revision: 15; type: "QRectF" }
Signal { name: "paintedGeometryChanged" }
Signal {
name: "horizontalAlignmentChanged"
@@ -75,6 +76,14 @@ Module {
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
Enum {
+ name: "LoadPixmapOptions"
+ values: {
+ "NoOption": 0,
+ "HandleDPR": 1,
+ "UseProviderOptions": 2
+ }
+ }
+ Enum {
name: "Status"
values: {
"Null": 0,
@@ -92,6 +101,7 @@ Module {
Property { name: "mirror"; type: "bool" }
Property { name: "currentFrame"; revision: 14; type: "int" }
Property { name: "frameCount"; revision: 14; type: "int"; isReadonly: true }
+ Property { name: "colorSpace"; revision: 15; type: "QColorSpace" }
Signal {
name: "sourceChanged"
Parameter { type: "QUrl" }
@@ -106,6 +116,8 @@ Module {
}
Signal { name: "currentFrameChanged"; revision: 14 }
Signal { name: "frameCountChanged"; revision: 14 }
+ Signal { name: "sourceClipRectChanged"; revision: 15 }
+ Signal { name: "colorSpaceChanged"; revision: 15 }
}
Component {
name: "QQuickImageSelector"
diff --git a/src/imports/controls/imagine/qquickninepatchimage.cpp b/src/imports/controls/imagine/qquickninepatchimage.cpp
index 7d5e4f71..1d6d60dd 100644
--- a/src/imports/controls/imagine/qquickninepatchimage.cpp
+++ b/src/imports/controls/imagine/qquickninepatchimage.cpp
@@ -46,22 +46,22 @@ QT_BEGIN_NAMESPACE
struct QQuickNinePatchData
{
- QVector<qreal> coordsForSize(qreal count) const;
+ QList<qreal> coordsForSize(qreal count) const;
inline bool isNull() const { return data.isEmpty(); }
inline int count() const { return data.size(); }
inline qreal at(int index) const { return data.at(index); }
inline qreal size() const { return data.last(); }
- void fill(const QVector<qreal> &coords, qreal count);
+ void fill(const QList<qreal> &coords, qreal count);
void clear();
private:
bool inverted = false;
- QVector<qreal> data;
+ QList<qreal> data;
};
-QVector<qreal> QQuickNinePatchData::coordsForSize(qreal size) const
+QList<qreal> QQuickNinePatchData::coordsForSize(qreal size) const
{
// n = number of stretchable sections
// We have to compensate when adding 0 and/or
@@ -70,7 +70,7 @@ QVector<qreal> QQuickNinePatchData::coordsForSize(qreal size) const
const int n = (inverted ? l - 1 : l) / 2;
const qreal stretch = (size - data.last()) / n;
- QVector<qreal> coords;
+ QList<qreal> coords;
coords.reserve(l);
coords.append(0);
@@ -87,7 +87,7 @@ QVector<qreal> QQuickNinePatchData::coordsForSize(qreal size) const
return coords;
}
-void QQuickNinePatchData::fill(const QVector<qreal> &coords, qreal size)
+void QQuickNinePatchData::fill(const QList<qreal> &coords, qreal size)
{
data.clear();
inverted = coords.isEmpty() || coords.first() != 0;
@@ -151,8 +151,8 @@ void QQuickNinePatchNode::initialize(QSGTexture *texture, const QSizeF &targetSi
m_geometry.allocate(xlen * ylen, verticesPerQuad * quads);
QSGGeometry::TexturedPoint2D *vertices = m_geometry.vertexDataAsTexturedPoint2D();
- QVector<qreal> xCoords = xDivs.coordsForSize(targetSize.width());
- QVector<qreal> yCoords = yDivs.coordsForSize(targetSize.height());
+ QList<qreal> xCoords = xDivs.coordsForSize(targetSize.width());
+ QList<qreal> yCoords = yDivs.coordsForSize(targetSize.height());
for (int y = 0; y < ylen; ++y) {
for (int x = 0; x < xlen; ++x, ++vertices)
@@ -189,8 +189,8 @@ class QQuickNinePatchImagePrivate : public QQuickImagePrivate
public:
void updatePatches();
- void updatePaddings(const QSizeF &size, const QVector<qreal> &horizontal, const QVector<qreal> &vertical);
- void updateInsets(const QVector<qreal> &horizontal, const QVector<qreal> &vertical);
+ void updatePaddings(const QSizeF &size, const QList<qreal> &horizontal, const QList<qreal> &vertical);
+ void updateInsets(const QList<qreal> &horizontal, const QList<qreal> &vertical);
bool resetNode = false;
qreal topPadding = 0;
@@ -207,10 +207,10 @@ public:
QQuickNinePatchData yDivs;
};
-static QVector<qreal> readCoords(const QRgb *data, int from, int count, int offset, QRgb color)
+static QList<qreal> readCoords(const QRgb *data, int from, int count, int offset, QRgb color)
{
int p1 = -1;
- QVector<qreal> coords;
+ QList<qreal> coords;
for (int i = 0; i < count; ++i) {
int p2 = from + i * offset;
if (data[p2] == color) {
@@ -243,17 +243,17 @@ void QQuickNinePatchImagePrivate::updatePatches()
xDivs.fill(readCoords(data, 1, w - 1, 1, black), w - 2); // top left -> top right
yDivs.fill(readCoords(data, w, h - 1, w, black), h - 2); // top left -> bottom left
- QVector<qreal> hInsets = readCoords(data, (h - 1) * w + 1, w - 1, 1, red); // bottom left -> bottom right
- QVector<qreal> vInsets = readCoords(data, 2 * w - 1, h - 1, w, red); // top right -> bottom right
+ QList<qreal> hInsets = readCoords(data, (h - 1) * w + 1, w - 1, 1, red); // bottom left -> bottom right
+ QList<qreal> vInsets = readCoords(data, 2 * w - 1, h - 1, w, red); // top right -> bottom right
updateInsets(hInsets, vInsets);
const QSizeF sz(w - leftInset - rightInset, h - topInset - bottomInset);
- QVector<qreal> hPaddings = readCoords(data, (h - 1) * w + leftInset + 1, sz.width() - 2, 1, black); // bottom left -> bottom right
- QVector<qreal> vPaddings = readCoords(data, (2 + topInset) * w - 1, sz.height() - 2, w, black); // top right -> bottom right
+ QList<qreal> hPaddings = readCoords(data, (h - 1) * w + leftInset + 1, sz.width() - 2, 1, black); // bottom left -> bottom right
+ QList<qreal> vPaddings = readCoords(data, (2 + topInset) * w - 1, sz.height() - 2, w, black); // top right -> bottom right
updatePaddings(sz, hPaddings, vPaddings);
}
-void QQuickNinePatchImagePrivate::updatePaddings(const QSizeF &size, const QVector<qreal> &horizontal, const QVector<qreal> &vertical)
+void QQuickNinePatchImagePrivate::updatePaddings(const QSizeF &size, const QList<qreal> &horizontal, const QList<qreal> &vertical)
{
Q_Q(QQuickNinePatchImage);
qreal oldTopPadding = topPadding;
@@ -287,7 +287,7 @@ void QQuickNinePatchImagePrivate::updatePaddings(const QSizeF &size, const QVect
emit q->rightPaddingChanged();
}
-void QQuickNinePatchImagePrivate::updateInsets(const QVector<qreal> &horizontal, const QVector<qreal> &vertical)
+void QQuickNinePatchImagePrivate::updateInsets(const QList<qreal> &horizontal, const QList<qreal> &vertical)
{
Q_Q(QQuickNinePatchImage);
qreal oldTopInset = topInset;
diff --git a/src/imports/controls/material/ApplicationWindow.qml b/src/imports/controls/material/ApplicationWindow.qml
index 6a10ed7f..5b8cefac 100644
--- a/src/imports/controls/material/ApplicationWindow.qml
+++ b/src/imports/controls/material/ApplicationWindow.qml
@@ -43,14 +43,4 @@ T.ApplicationWindow {
id: window
color: Material.backgroundColor
-
- overlay.modal: Rectangle {
- color: window.Material.backgroundDimColor
- Behavior on opacity { NumberAnimation { duration: 150 } }
- }
-
- overlay.modeless: Rectangle {
- color: window.Material.backgroundDimColor
- Behavior on opacity { NumberAnimation { duration: 150 } }
- }
}
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml
index e4e5f935..a9bdd934 100644
--- a/src/imports/controls/material/ComboBox.qml
+++ b/src/imports/controls/material/ComboBox.qml
@@ -65,7 +65,7 @@ T.ComboBox {
delegate: MenuItem {
width: ListView.view.width
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
- Material.foreground: control.currentIndex === index ? parent.Material.accent : parent.Material.foreground
+ Material.foreground: control.currentIndex === index ? ListView.view.contentItem.Material.accent : ListView.view.contentItem.Material.foreground
highlighted: control.highlightedIndex === index
hoverEnabled: control.hoverEnabled
}
diff --git a/src/imports/controls/material/plugins.qmltypes b/src/imports/controls/material/plugins.qmltypes
index 7546a7b0..e290e0ea 100644
--- a/src/imports/controls/material/plugins.qmltypes
+++ b/src/imports/controls/material/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Material 2.14'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Material 2.15'
Module {
dependencies: ["QtQuick.Controls 2.0"]
@@ -328,6 +328,7 @@ Module {
Property { name: "toolBarColor"; type: "QColor"; isReadonly: true }
Property { name: "toolTextColor"; type: "QColor"; isReadonly: true }
Property { name: "spinBoxDisabledIconColor"; type: "QColor"; isReadonly: true }
+ Property { name: "sliderDisabledColor"; revision: 15; type: "QColor"; isReadonly: true }
Property { name: "touchTarget"; type: "int"; isReadonly: true }
Property { name: "buttonHeight"; type: "int"; isReadonly: true }
Property { name: "delegateHeight"; type: "int"; isReadonly: true }
diff --git a/src/imports/controls/material/qquickmaterialstyle.cpp b/src/imports/controls/material/qquickmaterialstyle.cpp
index 35afeb00..08f47990 100644
--- a/src/imports/controls/material/qquickmaterialstyle.cpp
+++ b/src/imports/controls/material/qquickmaterialstyle.cpp
@@ -661,6 +661,7 @@ void QQuickMaterialStyle::setForeground(const QVariant &var)
m_foreground = foreground;
propagateForeground();
emit foregroundChanged();
+ emit paletteChanged();
}
void QQuickMaterialStyle::inheritForeground(uint foreground, bool custom, bool has)
diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes
index c3e53431..e8212c55 100644
--- a/src/imports/controls/plugins.qmltypes
+++ b/src/imports/controls/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls 2.14'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls 2.15'
Module {
dependencies: [
@@ -589,6 +589,14 @@ Module {
defaultProperty: "contentData"
}
Component {
+ prototype: "QQuickHorizontalHeaderView"
+ name: "QtQuick.Controls/HorizontalHeaderView 2.15"
+ exports: ["QtQuick.Controls/HorizontalHeaderView 2.15"]
+ exportMetaObjectRevisions: [15]
+ isComposite: true
+ defaultProperty: "flickableData"
+ }
+ Component {
prototype: "QQuickItemDelegate"
name: "QtQuick.Controls/ItemDelegate 2.0"
exports: ["QtQuick.Controls/ItemDelegate 2.0"]
@@ -876,4 +884,12 @@ Module {
isComposite: true
defaultProperty: "data"
}
+ Component {
+ prototype: "QQuickVerticalHeaderView"
+ name: "QtQuick.Controls/VerticalHeaderView 2.15"
+ exports: ["QtQuick.Controls/VerticalHeaderView 2.15"]
+ exportMetaObjectRevisions: [15]
+ isComposite: true
+ defaultProperty: "flickableData"
+ }
}
diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml
index 153b9e8e..80cda477 100644
--- a/src/imports/controls/universal/ApplicationWindow.qml
+++ b/src/imports/controls/universal/ApplicationWindow.qml
@@ -45,14 +45,6 @@ T.ApplicationWindow {
color: Universal.background
- overlay.modal: Rectangle {
- color: window.Universal.baseLowColor
- }
-
- overlay.modeless: Rectangle {
- color: window.Universal.baseLowColor
- }
-
FocusRectangle {
parent: window.activeFocusControl
width: parent ? parent.width : 0
diff --git a/src/imports/controls/universal/plugins.qmltypes b/src/imports/controls/universal/plugins.qmltypes
index 1734c01b..c38e39e1 100644
--- a/src/imports/controls/universal/plugins.qmltypes
+++ b/src/imports/controls/universal/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Universal 2.14'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Universal 2.15'
Module {
dependencies: ["QtQuick.Controls 2.0"]
diff --git a/src/imports/controls/universal/qquickuniversalfocusrectangle.cpp b/src/imports/controls/universal/qquickuniversalfocusrectangle.cpp
index 88b78e10..51508c6f 100644
--- a/src/imports/controls/universal/qquickuniversalfocusrectangle.cpp
+++ b/src/imports/controls/universal/qquickuniversalfocusrectangle.cpp
@@ -72,7 +72,7 @@ void QQuickUniversalFocusRectangle::paint(QPainter *painter)
p.drawRect(bounds);
pen.setColor(Qt::black);
- pen.setDashPattern(QVector<qreal>(2, 1));
+ pen.setDashPattern(QList<qreal>(2, 1));
p.setPen(pen);
p.drawRect(bounds);
diff --git a/src/imports/platform/qquickplatformfiledialog.cpp b/src/imports/platform/qquickplatformfiledialog.cpp
index 2ef08ef6..3b9ceab2 100644
--- a/src/imports/platform/qquickplatformfiledialog.cpp
+++ b/src/imports/platform/qquickplatformfiledialog.cpp
@@ -36,7 +36,7 @@
#include "qquickplatformfiledialog_p.h"
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
@@ -86,7 +86,6 @@ QT_BEGIN_NAMESPACE
\li Linux (when running with the GTK+ platform theme)
\li macOS
\li Windows
- \li WinRT
\endlist
\input includes/widgets.qdocinc 1
@@ -611,21 +610,21 @@ static QString extractName(const QString &filter)
return filter.left(filter.indexOf(QLatin1Char('(')) - 1);
}
-static QString extractExtension(const QString &filter)
+static QString extractExtension(QStringView filter)
{
- return filter.mid(filter.indexOf(QLatin1Char('.')) + 1);
+ return filter.mid(filter.indexOf(QLatin1Char('.')) + 1).toString();
}
-static QStringList extractExtensions(const QString &filter)
+static QStringList extractExtensions(QStringView filter)
{
QStringList extensions;
const int from = filter.indexOf(QLatin1Char('('));
const int to = filter.lastIndexOf(QLatin1Char(')')) - 1;
if (from >= 0 && from < to) {
- const QStringRef ref = filter.midRef(from + 1, to - from);
- const QVector<QStringRef> exts = ref.split(QLatin1Char(' '), Qt::SkipEmptyParts);
- for (const QStringRef &ref : exts)
- extensions += extractExtension(ref.toString());
+ const QStringView ref = filter.mid(from + 1, to - from);
+ const QList<QStringView> exts = ref.split(QLatin1Char(' '), Qt::SkipEmptyParts);
+ for (const QStringView &ref : exts)
+ extensions += extractExtension(ref);
}
return extensions;
diff --git a/src/imports/platform/qquickplatformfolderdialog.cpp b/src/imports/platform/qquickplatformfolderdialog.cpp
index 4ae6341e..a28dc828 100644
--- a/src/imports/platform/qquickplatformfolderdialog.cpp
+++ b/src/imports/platform/qquickplatformfolderdialog.cpp
@@ -83,7 +83,6 @@ QT_BEGIN_NAMESPACE
\li Linux (when running with the GTK+ platform theme)
\li macOS
\li Windows
- \li WinRT
\endlist
\input includes/widgets.qdocinc 1
diff --git a/src/imports/platform/qquickplatformmenu.cpp b/src/imports/platform/qquickplatformmenu.cpp
index 8954d439..7219ef54 100644
--- a/src/imports/platform/qquickplatformmenu.cpp
+++ b/src/imports/platform/qquickplatformmenu.cpp
@@ -419,8 +419,7 @@ QQuickPlatformMenuItem *QQuickPlatformMenu::menuItem() const
m_menuItem = new QQuickPlatformMenuItem(that);
m_menuItem->setSubMenu(that);
m_menuItem->setText(m_title);
- m_menuItem->setIconName(iconName());
- m_menuItem->setIconSource(iconSource());
+ m_menuItem->setIcon(icon());
m_menuItem->setVisible(m_visible);
m_menuItem->setEnabled(m_enabled);
m_menuItem->componentComplete();
@@ -542,51 +541,6 @@ void QQuickPlatformMenu::setTitle(const QString &title)
}
/*!
- \qmlproperty url Qt.labs.platform::Menu::iconSource
- \deprecated Use icon.source instead
-*/
-QUrl QQuickPlatformMenu::iconSource() const
-{
- return icon().source();
-}
-
-void QQuickPlatformMenu::setIconSource(const QUrl& source)
-{
- QQuickPlatformIcon newIcon = icon();
- if (source == newIcon.source())
- return;
-
- if (m_menuItem)
- m_menuItem->setIconSource(source);
-
- newIcon.setSource(source);
- iconLoader()->setIcon(newIcon);
- emit iconSourceChanged();
-}
-
-/*!
- \qmlproperty string Qt.labs.platform::Menu::iconName
- \deprecated Use icon.name instead
-*/
-QString QQuickPlatformMenu::iconName() const
-{
- return icon().name();
-}
-
-void QQuickPlatformMenu::setIconName(const QString& name)
-{
- QQuickPlatformIcon newIcon = icon();
- if (name == newIcon.name())
- return;
-
- if (m_menuItem)
- m_menuItem->setIconName(name);
-
- newIcon.setName(name);
- iconLoader()->setIcon(newIcon);
- emit iconNameChanged();}
-
-/*!
\qmlproperty font Qt.labs.platform::Menu::font
This property holds the menu's font.
diff --git a/src/imports/platform/qquickplatformmenu_p.h b/src/imports/platform/qquickplatformmenu_p.h
index eb18f66b..089e1f89 100644
--- a/src/imports/platform/qquickplatformmenu_p.h
+++ b/src/imports/platform/qquickplatformmenu_p.h
@@ -85,8 +85,6 @@ class QQuickPlatformMenu : public QObject, public QQmlParserStatus
Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged FINAL)
Q_PROPERTY(QPlatformMenu::MenuType type READ type WRITE setType NOTIFY typeChanged FINAL)
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
- Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL)
- Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 1)
Q_ENUMS(QPlatformMenu::MenuType)
@@ -130,12 +128,6 @@ public:
QString title() const;
void setTitle(const QString &title);
- QUrl iconSource() const;
- void setIconSource(const QUrl &source);
-
- QString iconName() const;
- void setIconName(const QString &name);
-
QFont font() const;
void setFont(const QFont &font);
@@ -165,8 +157,6 @@ Q_SIGNALS:
void parentMenuChanged();
void systemTrayIconChanged();
void titleChanged();
- void iconSourceChanged();
- void iconNameChanged();
void enabledChanged();
void visibleChanged();
void minimumWidthChanged();
diff --git a/src/imports/platform/qquickplatformmenuitem.cpp b/src/imports/platform/qquickplatformmenuitem.cpp
index b63f7202..11cf98b4 100644
--- a/src/imports/platform/qquickplatformmenuitem.cpp
+++ b/src/imports/platform/qquickplatformmenuitem.cpp
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
\image qtlabsplatform-menu.png
- A menu item consists of an \l {iconSource}{icon}, \l text, and \l shortcut.
+ A menu item consists of an \l icon, \l text, and \l shortcut.
\code
Menu {
@@ -458,46 +458,6 @@ void QQuickPlatformMenuItem::setText(const QString &text)
}
/*!
- \qmlproperty url Qt.labs.platform::MenuItem::iconSource
- \deprecated Use icon.source instead
-*/
-QUrl QQuickPlatformMenuItem::iconSource() const
-{
- return icon().source();
-}
-
-void QQuickPlatformMenuItem::setIconSource(const QUrl& source)
-{
- QQuickPlatformIcon newIcon = icon();
- if (source == newIcon.source())
- return;
-
- newIcon.setSource(source);
- iconLoader()->setIcon(newIcon);
- emit iconSourceChanged();
-}
-
-/*!
- \qmlproperty string Qt.labs.platform::MenuItem::iconName
- \deprecated Use icon.name instead
-*/
-QString QQuickPlatformMenuItem::iconName() const
-{
- return icon().name();
-}
-
-void QQuickPlatformMenuItem::setIconName(const QString& name)
-{
- QQuickPlatformIcon newIcon = icon();
- if (name == newIcon.name())
- return;
-
- newIcon.setName(name);
- iconLoader()->setIcon(newIcon);
- emit iconNameChanged();
-}
-
-/*!
\qmlproperty keysequence Qt.labs.platform::MenuItem::shortcut
This property holds the menu item's shortcut.
diff --git a/src/imports/platform/qquickplatformmenuitem_p.h b/src/imports/platform/qquickplatformmenuitem_p.h
index e3d5258a..c1e6cc30 100644
--- a/src/imports/platform/qquickplatformmenuitem_p.h
+++ b/src/imports/platform/qquickplatformmenuitem_p.h
@@ -78,8 +78,6 @@ class QQuickPlatformMenuItem : public QObject, public QQmlParserStatus
Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged FINAL)
Q_PROPERTY(QPlatformMenuItem::MenuRole role READ role WRITE setRole NOTIFY roleChanged FINAL)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL)
- Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL)
- Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL)
Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged FINAL)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 1)
@@ -123,12 +121,6 @@ public:
QString text() const;
void setText(const QString &text);
- QUrl iconSource() const;
- void setIconSource(const QUrl &source);
-
- QString iconName() const;
- void setIconName(const QString &name);
-
QVariant shortcut() const;
void setShortcut(const QVariant& shortcut);
@@ -155,8 +147,6 @@ Q_SIGNALS:
void checkedChanged();
void roleChanged();
void textChanged();
- void iconSourceChanged();
- void iconNameChanged();
void shortcutChanged();
void fontChanged();
Q_REVISION(1) void iconChanged();
diff --git a/src/imports/platform/qquickplatformmenuitemgroup_p.h b/src/imports/platform/qquickplatformmenuitemgroup_p.h
index 8b3531d9..57499347 100644
--- a/src/imports/platform/qquickplatformmenuitemgroup_p.h
+++ b/src/imports/platform/qquickplatformmenuitemgroup_p.h
@@ -49,7 +49,7 @@
//
#include <QtCore/qobject.h>
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <QtQml/qqml.h>
QT_BEGIN_NAMESPACE
@@ -113,7 +113,7 @@ private:
bool m_visible;
bool m_exclusive;
QQuickPlatformMenuItem *m_checkedItem;
- QVector<QQuickPlatformMenuItem*> m_items;
+ QList<QQuickPlatformMenuItem*> m_items;
};
QT_END_NAMESPACE
diff --git a/src/imports/platform/qquickplatformmessagedialog.cpp b/src/imports/platform/qquickplatformmessagedialog.cpp
index 075b4d62..f2e0970c 100644
--- a/src/imports/platform/qquickplatformmessagedialog.cpp
+++ b/src/imports/platform/qquickplatformmessagedialog.cpp
@@ -99,7 +99,6 @@ QT_BEGIN_NAMESPACE
\list
\li iOS
\li Android
- \li WinRT
\endlist
\input includes/widgets.qdocinc 1
diff --git a/src/imports/platform/qquickplatformsystemtrayicon.cpp b/src/imports/platform/qquickplatformsystemtrayicon.cpp
index 4a96b38f..1631e449 100644
--- a/src/imports/platform/qquickplatformsystemtrayicon.cpp
+++ b/src/imports/platform/qquickplatformsystemtrayicon.cpp
@@ -253,48 +253,6 @@ void QQuickPlatformSystemTrayIcon::setVisible(bool visible)
}
/*!
- \qmlproperty url Qt.labs.platform::SystemTrayIcon::iconSource
- \deprecated Use icon.source instead.
- \sa icon
-*/
-QUrl QQuickPlatformSystemTrayIcon::iconSource() const
-{
- return icon().source();
-}
-
-void QQuickPlatformSystemTrayIcon::setIconSource(const QUrl& source)
-{
- QQuickPlatformIcon newIcon = icon();
- if (source == newIcon.source())
- return;
-
- newIcon.setSource(source);
- iconLoader()->setIcon(newIcon);
- emit iconSourceChanged();
-}
-
-/*!
- \qmlproperty string Qt.labs.platform::SystemTrayIcon::iconName
- \deprecated Use icon.name instead.
- \sa icon
-*/
-QString QQuickPlatformSystemTrayIcon::iconName() const
-{
- return icon().name();
-}
-
-void QQuickPlatformSystemTrayIcon::setIconName(const QString& name)
-{
- QQuickPlatformIcon newIcon = icon();
- if (name == newIcon.name())
- return;
-
- newIcon.setName(name);
- iconLoader()->setIcon(newIcon);
- emit iconNameChanged();
-}
-
-/*!
\qmlproperty string Qt.labs.platform::SystemTrayIcon::tooltip
This property holds the tooltip of the system tray icon.
diff --git a/src/imports/platform/qquickplatformsystemtrayicon_p.h b/src/imports/platform/qquickplatformsystemtrayicon_p.h
index e43366cb..0216aee3 100644
--- a/src/imports/platform/qquickplatformsystemtrayicon_p.h
+++ b/src/imports/platform/qquickplatformsystemtrayicon_p.h
@@ -70,8 +70,6 @@ class QQuickPlatformSystemTrayIcon : public QObject, public QQmlParserStatus
Q_PROPERTY(bool available READ isAvailable CONSTANT FINAL)
Q_PROPERTY(bool supportsMessages READ supportsMessages CONSTANT FINAL)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
- Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL)
- Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL)
Q_PROPERTY(QString tooltip READ tooltip WRITE setTooltip NOTIFY tooltipChanged FINAL)
Q_PROPERTY(QQuickPlatformMenu *menu READ menu WRITE setMenu NOTIFY menuChanged FINAL)
Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged FINAL REVISION 1)
@@ -90,12 +88,6 @@ public:
bool isVisible() const;
void setVisible(bool visible);
- QUrl iconSource() const;
- void setIconSource(const QUrl &source);
-
- QString iconName() const;
- void setIconName(const QString &name);
-
QString tooltip() const;
void setTooltip(const QString &tooltip);
@@ -118,8 +110,6 @@ Q_SIGNALS:
void activated(QPlatformSystemTrayIcon::ActivationReason reason);
void messageClicked();
void visibleChanged();
- void iconSourceChanged();
- void iconNameChanged();
void tooltipChanged();
void menuChanged();
Q_REVISION(1) void geometryChanged();
diff --git a/src/imports/platform/widgets/qwidgetplatform_p.h b/src/imports/platform/widgets/qwidgetplatform_p.h
index c203406c..cbdaa24a 100644
--- a/src/imports/platform/widgets/qwidgetplatform_p.h
+++ b/src/imports/platform/widgets/qwidgetplatform_p.h
@@ -111,8 +111,8 @@ namespace QWidgetPlatform
if (available)
return new T(parent);
#else
- Q_UNUSED(parent)
- Q_UNUSED(available)
+ Q_UNUSED(parent);
+ Q_UNUSED(available);
#endif
return nullptr;
}
diff --git a/src/imports/platform/widgets/qwidgetplatformmenu_p.h b/src/imports/platform/widgets/qwidgetplatformmenu_p.h
index 4d58f528..9d1ef57e 100644
--- a/src/imports/platform/widgets/qwidgetplatformmenu_p.h
+++ b/src/imports/platform/widgets/qwidgetplatformmenu_p.h
@@ -90,7 +90,7 @@ public:
private:
QScopedPointer<QMenu> m_menu;
- QVector<QWidgetPlatformMenuItem *> m_items;
+ QList<QWidgetPlatformMenuItem *> m_items;
};
QT_END_NAMESPACE
diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes
index da81e095..42c04c80 100644
--- a/src/imports/templates/plugins.qmltypes
+++ b/src/imports/templates/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Templates 2.14'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Templates 2.15'
Module {
dependencies: ["QtQuick 2.9", "QtQuick.Window 2.2"]
@@ -273,10 +273,11 @@ Module {
"QtQuick.Templates/ComboBox 2.0",
"QtQuick.Templates/ComboBox 2.1",
"QtQuick.Templates/ComboBox 2.14",
+ "QtQuick.Templates/ComboBox 2.15",
"QtQuick.Templates/ComboBox 2.2",
"QtQuick.Templates/ComboBox 2.5"
]
- exportMetaObjectRevisions: [0, 1, 14, 2, 5]
+ exportMetaObjectRevisions: [0, 1, 14, 15, 2, 5]
Property { name: "count"; type: "int"; isReadonly: true }
Property { name: "model"; type: "QVariant" }
Property { name: "delegateModel"; type: "QQmlInstanceModel"; isReadonly: true; isPointer: true }
@@ -301,6 +302,7 @@ Module {
Property { name: "implicitIndicatorHeight"; revision: 5; type: "double"; isReadonly: true }
Property { name: "currentValue"; revision: 14; type: "QVariant"; isReadonly: true }
Property { name: "valueRole"; revision: 14; type: "string" }
+ Property { name: "selectTextByMouse"; revision: 15; type: "bool" }
Signal {
name: "activated"
Parameter { name: "index"; type: "int" }
@@ -322,6 +324,7 @@ Module {
Signal { name: "implicitIndicatorHeightChanged"; revision: 5 }
Signal { name: "valueRoleChanged"; revision: 14 }
Signal { name: "currentValueChanged"; revision: 14 }
+ Signal { name: "selectTextByMouseChanged"; revision: 15 }
Method { name: "incrementCurrentIndex" }
Method { name: "decrementCurrentIndex" }
Method { name: "selectAll"; revision: 2 }
@@ -651,6 +654,20 @@ Module {
Signal { name: "implicitLabelHeightChanged"; revision: 5 }
}
Component {
+ name: "QQuickHeaderViewBase"
+ defaultProperty: "flickableData"
+ prototype: "QQuickTableView"
+ Property { name: "textRole"; type: "string" }
+ }
+ Component {
+ name: "QQuickHorizontalHeaderView"
+ defaultProperty: "flickableData"
+ prototype: "QQuickHeaderViewBase"
+ exports: ["QtQuick.Templates/HorizontalHeaderView 2.15"]
+ exportMetaObjectRevisions: [0]
+ attachedType: "QQuickTableViewAttached"
+ }
+ Component {
name: "QQuickIcon"
Property { name: "name"; type: "string" }
Property { name: "source"; type: "QUrl" }
@@ -1265,7 +1282,6 @@ Module {
prototype: "QObject"
Property { name: "centerIn"; type: "QQuickItem"; isPointer: true }
}
- Component { name: "QQuickPopupItem"; defaultProperty: "contentData"; prototype: "QQuickPage" }
Component {
name: "QQuickProgressBar"
defaultProperty: "data"
@@ -1355,19 +1371,6 @@ Module {
Method { name: "decrease" }
}
Component {
- name: "QQuickRootItem"
- defaultProperty: "data"
- prototype: "QQuickItem"
- Method {
- name: "setWidth"
- Parameter { name: "w"; type: "int" }
- }
- Method {
- name: "setHeight"
- Parameter { name: "h"; type: "int" }
- }
- }
- Component {
name: "QQuickRoundButton"
defaultProperty: "data"
prototype: "QQuickButton"
@@ -1852,6 +1855,37 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
+ name: "QQuickTableView"
+ defaultProperty: "flickableData"
+ prototype: "QQuickFlickable"
+ exports: ["QtQuick.Templates/__TableView__ 2.15"]
+ exportMetaObjectRevisions: [15]
+ attachedType: "QQuickTableViewAttached"
+ Property { name: "rows"; type: "int"; isReadonly: true }
+ Property { name: "columns"; type: "int"; isReadonly: true }
+ Property { name: "rowSpacing"; type: "double" }
+ Property { name: "columnSpacing"; type: "double" }
+ Property { name: "rowHeightProvider"; type: "QJSValue" }
+ Property { name: "columnWidthProvider"; type: "QJSValue" }
+ Property { name: "model"; type: "QVariant" }
+ Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
+ Property { name: "reuseItems"; type: "bool" }
+ Property { name: "contentWidth"; type: "double" }
+ Property { name: "contentHeight"; type: "double" }
+ Property { name: "syncView"; revision: 14; type: "QQuickTableView"; isPointer: true }
+ Property { name: "syncDirection"; revision: 14; type: "Qt::Orientations" }
+ Signal { name: "syncViewChanged"; revision: 14 }
+ Signal { name: "syncDirectionChanged"; revision: 14 }
+ Method { name: "forceLayout" }
+ }
+ Component {
+ name: "QQuickTableViewAttached"
+ prototype: "QObject"
+ Property { name: "view"; type: "QQuickTableView"; isReadonly: true; isPointer: true }
+ Signal { name: "pooled" }
+ Signal { name: "reused" }
+ }
+ Component {
name: "QQuickText"
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
@@ -2794,6 +2828,14 @@ Module {
Property { name: "displacement"; type: "double"; isReadonly: true }
}
Component {
+ name: "QQuickVerticalHeaderView"
+ defaultProperty: "flickableData"
+ prototype: "QQuickHeaderViewBase"
+ exports: ["QtQuick.Templates/VerticalHeaderView 2.15"]
+ exportMetaObjectRevisions: [0]
+ attachedType: "QQuickTableViewAttached"
+ }
+ Component {
name: "QQuickWindow"
defaultProperty: "data"
prototype: "QWindow"
@@ -3018,6 +3060,12 @@ Module {
Method { name: "raise" }
Method { name: "lower" }
Method {
+ name: "startSystemResize"
+ type: "bool"
+ Parameter { name: "edges"; type: "Qt::Edges" }
+ }
+ Method { name: "startSystemMove"; type: "bool" }
+ Method {
name: "setTitle"
Parameter { type: "string" }
}
diff --git a/src/quickcontrols2/configure.cmake b/src/quickcontrols2/configure.cmake
index 768a7c8c..456b3e37 100644
--- a/src/quickcontrols2/configure.cmake
+++ b/src/quickcontrols2/configure.cmake
@@ -14,30 +14,37 @@
#### Features
-qt_feature("quickcontrols2_default" PRIVATE
+qt_feature("quickcontrols2-default" PRIVATE
LABEL "Default"
)
-qt_feature("quickcontrols2_fusion" PRIVATE
+qt_feature("quickcontrols2-fusion" PRIVATE
SECTION "Quick Controls 2"
LABEL "Fusion"
PURPOSE "Provides the platform agnostic desktop-oriented Fusion style."
CONDITION QT_FEATURE_quickcontrols2_default
)
-qt_feature("quickcontrols2_imagine" PRIVATE
+qt_feature("quickcontrols2-imagine" PRIVATE
SECTION "Quick Controls 2"
LABEL "Imagine"
PURPOSE "Provides a style based on configurable image assets."
CONDITION QT_FEATURE_quickcontrols2_default
)
-qt_feature("quickcontrols2_material" PRIVATE
+qt_feature("quickcontrols2-material" PRIVATE
SECTION "Quick Controls 2"
LABEL "Material"
PURPOSE "Provides a style based on the Material Design guidelines."
CONDITION QT_FEATURE_quickcontrols2_default
)
-qt_feature("quickcontrols2_universal" PRIVATE
+qt_feature("quickcontrols2-universal" PRIVATE
SECTION "Quick Controls 2"
LABEL "Universal"
PURPOSE "Provides a style based on the Universal Design guidelines."
CONDITION QT_FEATURE_quickcontrols2_default
)
+qt_configure_add_summary_section(NAME "Qt Quick Controls 2")
+qt_configure_add_summary_entry(
+ TYPE "featureList"
+ ARGS "quickcontrols2-default quickcontrols2-fusion quickcontrols2-imagine quickcontrols2-material quickcontrols2-universal"
+ MESSAGE "Styles"
+)
+qt_configure_end_summary_section() # end of "Qt Quick Controls 2" section
diff --git a/src/quickcontrols2/qquickmnemoniclabel.cpp b/src/quickcontrols2/qquickmnemoniclabel.cpp
index 193365b5..309d076a 100644
--- a/src/quickcontrols2/qquickmnemoniclabel.cpp
+++ b/src/quickcontrols2/qquickmnemoniclabel.cpp
@@ -92,7 +92,7 @@ void QQuickMnemonicLabel::updateMnemonic()
int idx = 0;
int pos = 0;
int len = m_fullText.length();
- QVector<QTextLayout::FormatRange> formats;
+ QList<QTextLayout::FormatRange> formats;
while (len) {
if (m_fullText.at(pos) == QLatin1Char('&') && (len == 1 || m_fullText.at(pos + 1) != QLatin1Char('&'))) {
if (m_mnemonicVisible && (pos == 0 || m_fullText.at(pos - 1) != QLatin1Char('&')))
diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp
index e1cf4bfe..6e1f17b1 100644
--- a/src/quickcontrols2/qquickstyle.cpp
+++ b/src/quickcontrols2/qquickstyle.cpp
@@ -578,7 +578,8 @@ void QQuickStyle::setStyle(const QString &style)
{
qCDebug(lcQtQuickControlsStyle) << "setStyle called with" << style;
- if (QQmlMetaType::isModule(QStringLiteral("QtQuick.Controls"), QTypeRevision::fromVersion(2, 0))) {
+ if (QQmlMetaType::matchingModuleVersion(
+ QStringLiteral("QtQuick.Controls"), QTypeRevision::fromVersion(2, 0)).isValid()) {
qWarning() << "ERROR: QQuickStyle::setStyle() must be called before loading QML that imports Qt Quick Controls 2.";
return;
}
@@ -602,7 +603,8 @@ void QQuickStyle::setStyle(const QString &style)
*/
void QQuickStyle::setFallbackStyle(const QString &style)
{
- if (QQmlMetaType::isModule(QStringLiteral("QtQuick.Controls"), QTypeRevision::fromVersion(2, 0))) {
+ if (QQmlMetaType::matchingModuleVersion(
+ QStringLiteral("QtQuick.Controls"), QTypeRevision::fromVersion(2, 0)).isValid()) {
qWarning() << "ERROR: QQuickStyle::setFallbackStyle() must be called before loading QML that imports Qt Quick Controls 2.";
return;
}
diff --git a/src/quickcontrols2/qquickstyleplugin.cpp b/src/quickcontrols2/qquickstyleplugin.cpp
index c35c8735..9bbaad11 100644
--- a/src/quickcontrols2/qquickstyleplugin.cpp
+++ b/src/quickcontrols2/qquickstyleplugin.cpp
@@ -63,7 +63,7 @@ QString QQuickStylePlugin::name() const
void QQuickStylePlugin::initializeTheme(QQuickTheme *theme)
{
- Q_UNUSED(theme)
+ Q_UNUSED(theme);
}
void QQuickStylePlugin::unregisterTypes()
diff --git a/src/quicktemplates2/configure.cmake b/src/quicktemplates2/configure.cmake
index 6ccd920c..4e097569 100644
--- a/src/quicktemplates2/configure.cmake
+++ b/src/quicktemplates2/configure.cmake
@@ -14,13 +14,17 @@
#### Features
-qt_feature("quicktemplates2_hover" PRIVATE
+qt_feature("quicktemplates2-hover" PRIVATE
SECTION "Quick Templates 2"
LABEL "Hover support"
PURPOSE "Provides support for hover effects."
)
-qt_feature("quicktemplates2_multitouch" PRIVATE
+qt_feature("quicktemplates2-multitouch" PRIVATE
SECTION "Quick Templates 2"
LABEL "Multi-touch support"
PURPOSE "Provides support for multi-touch."
)
+qt_configure_add_summary_section(NAME "Qt Quick Templates 2")
+qt_configure_add_summary_entry(ARGS "quicktemplates2-hover")
+qt_configure_add_summary_entry(ARGS "quicktemplates2-multitouch")
+qt_configure_end_summary_section() # end of "Qt Quick Templates 2" section
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index 8a61e570..0c481d01 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -748,6 +748,7 @@ void QQuickAbstractButton::setIndicator(QQuickItem *indicator)
\qmlproperty int QtQuick.Controls::AbstractButton::icon.width
\qmlproperty int QtQuick.Controls::AbstractButton::icon.height
\qmlproperty color QtQuick.Controls::AbstractButton::icon.color
+ \qmlproperty bool QtQuick.Controls::AbstractButton::icon.cache
This property group was added in QtQuick.Controls 2.3.
diff --git a/src/quicktemplates2/qquickaction.cpp b/src/quicktemplates2/qquickaction.cpp
index 0b083339..0dab3b97 100644
--- a/src/quicktemplates2/qquickaction.cpp
+++ b/src/quicktemplates2/qquickaction.cpp
@@ -387,6 +387,7 @@ void QQuickAction::setText(const QString &text)
\qmlproperty int QtQuick.Controls::Action::icon.width
\qmlproperty int QtQuick.Controls::Action::icon.height
\qmlproperty color QtQuick.Controls::Action::icon.color
+ \qmlproperty bool QtQuick.Controls::Action::icon.cache
\include qquickicon.qdocinc grouped-properties
*/
diff --git a/src/quicktemplates2/qquickaction_p_p.h b/src/quicktemplates2/qquickaction_p_p.h
index 252b0075..d9b83548 100644
--- a/src/quicktemplates2/qquickaction_p_p.h
+++ b/src/quicktemplates2/qquickaction_p_p.h
@@ -125,7 +125,7 @@ public:
QKeySequence keySequence;
QVariant vshortcut;
ShortcutEntry *defaultShortcutEntry = nullptr;
- QVector<ShortcutEntry *> shortcutEntries;
+ QList<ShortcutEntry *> shortcutEntries;
#endif
QQuickActionGroup *group = nullptr;
};
diff --git a/src/quicktemplates2/qquickactiongroup.cpp b/src/quicktemplates2/qquickactiongroup.cpp
index a78489e2..301957b6 100644
--- a/src/quicktemplates2/qquickactiongroup.cpp
+++ b/src/quicktemplates2/qquickactiongroup.cpp
@@ -156,7 +156,7 @@ public:
bool enabled = true;
bool exclusive = true;
QPointer<QQuickAction> checkedAction;
- QVector<QQuickAction*> actions;
+ QList<QQuickAction*> actions;
};
void QQuickActionGroupPrivate::clear()
diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp
index d7ff9a26..3d39a04e 100644
--- a/src/quicktemplates2/qquickapplicationwindow.cpp
+++ b/src/quicktemplates2/qquickapplicationwindow.cpp
@@ -36,7 +36,6 @@
#include "qquickapplicationwindow_p.h"
#include "qquickcontentitem_p.h"
-#include "qquickoverlay_p.h"
#include "qquickpopup_p_p.h"
#include "qquickcontrol_p_p.h"
#include "qquicktextarea_p.h"
@@ -178,7 +177,6 @@ public:
QQuickItem *menuBar = nullptr;
QQuickItem *header = nullptr;
QQuickItem *footer = nullptr;
- QQuickOverlay *overlay = nullptr;
QFont font;
QLocale locale;
QQuickItem *activeFocusControl = nullptr;
@@ -231,9 +229,9 @@ void QQuickApplicationWindowPrivate::relayout()
void QQuickApplicationWindowPrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff)
{
- Q_UNUSED(item)
- Q_UNUSED(change)
- Q_UNUSED(diff)
+ Q_UNUSED(item);
+ Q_UNUSED(change);
+ Q_UNUSED(diff);
relayout();
}
@@ -589,57 +587,6 @@ QQuickItem *QQuickApplicationWindow::activeFocusControl() const
}
/*!
- \deprecated
- \qmlpropertygroup QtQuick.Controls::ApplicationWindow::overlay
- \qmlproperty Item QtQuick.Controls::ApplicationWindow::overlay
- \qmlproperty Component QtQuick.Controls::ApplicationWindow::overlay.modal
- \qmlproperty Component QtQuick.Controls::ApplicationWindow::overlay.modeless
-
- Use the \l Overlay attached properties and signals instead.
-
- This property holds the window overlay item. Popups are automatically
- reparented to the overlay.
-
- \table
- \header
- \li Property
- \li Description
- \row
- \li overlay.modal
- \li This property holds a component to use as a visual item that implements
- background dimming for modal popups. It is created for and stacked below
- visible modal popups.
- \row
- \li overlay.modeless
- \li This property holds a component to use as a visual item that implements
- background dimming for modeless popups. It is created for and stacked below
- visible dimming popups.
- \row
- \li overlay.pressed()
- \li This signal is emitted when the overlay is pressed by the user while
- a popup is visible.
- \row
- \li overlay.released()
- \li This signal is emitted when the overlay is released by the user while
- a modal popup is visible.
- \endtable
-
- \sa Popup::modal, Popup::dim
-*/
-QQuickOverlay *QQuickApplicationWindow::overlay() const
-{
- QQuickApplicationWindowPrivate *d = const_cast<QQuickApplicationWindowPrivate *>(d_func());
- if (!d) // being deleted
- return nullptr;
-
- if (!d->overlay) {
- d->overlay = new QQuickOverlay(QQuickWindow::contentItem());
- d->overlay->stackAfter(QQuickApplicationWindow::contentItem());
- }
- return d->overlay;
-}
-
-/*!
\qmlproperty font QtQuick.Controls::ApplicationWindow::font
This property holds the font currently set for the window.
@@ -852,7 +799,6 @@ void QQuickApplicationWindowAttachedPrivate::windowChange(QQuickWindow *wnd)
window = wnd;
emit q->windowChanged();
emit q->contentItemChanged();
- emit q->overlayChanged();
activeFocusChange();
if ((oldWindow && oldWindow->menuBar()) || (newWindow && newWindow->menuBar()))
@@ -986,24 +932,6 @@ QQuickItem *QQuickApplicationWindowAttached::footer() const
}
/*!
- \deprecated
- \qmlattachedproperty Item QtQuick.Controls::ApplicationWindow::overlay
- \readonly
-
- Use the \l Overlay::overlay attached property instead.
-
- This attached property holds the window overlay item. The property can be attached
- to any item. The value is \c null if the item is not in an ApplicationWindow.
-
- \sa {Attached ApplicationWindow Properties}
-*/
-QQuickOverlay *QQuickApplicationWindowAttached::overlay() const
-{
- Q_D(const QQuickApplicationWindowAttached);
- return QQuickOverlay::overlay(d->window);
-}
-
-/*!
\since QtQuick.Controls 2.3 (Qt 5.10)
\qmlattachedproperty Item QtQuick.Controls::ApplicationWindow::menuBar
\readonly
diff --git a/src/quicktemplates2/qquickapplicationwindow_p.h b/src/quicktemplates2/qquickapplicationwindow_p.h
index 14ef6c67..9c0292ed 100644
--- a/src/quicktemplates2/qquickapplicationwindow_p.h
+++ b/src/quicktemplates2/qquickapplicationwindow_p.h
@@ -56,7 +56,6 @@
QT_BEGIN_NAMESPACE
-class QQuickOverlay;
class QQuickApplicationWindowPrivate;
class QQuickApplicationWindowAttached;
class QQuickApplicationWindowAttachedPrivate;
@@ -70,7 +69,6 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickApplicationWindow : public QQuickWi
Q_PROPERTY(QQuickItem *activeFocusControl READ activeFocusControl NOTIFY activeFocusControlChanged FINAL)
Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL)
Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL)
- Q_PROPERTY(QQuickOverlay *overlay READ overlay CONSTANT FINAL)
Q_PROPERTY(QFont font READ font WRITE setFont RESET resetFont NOTIFY fontChanged FINAL)
Q_PROPERTY(QLocale locale READ locale WRITE setLocale RESET resetLocale NOTIFY localeChanged FINAL)
// 2.3 (Qt 5.10)
@@ -99,8 +97,6 @@ public:
QQuickItem *footer() const;
void setFooter(QQuickItem *footer);
- QQuickOverlay *overlay() const;
-
QFont font() const;
void setFont(const QFont &font);
void resetFont();
@@ -141,7 +137,6 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickApplicationWindowAttached : public
Q_PROPERTY(QQuickItem *activeFocusControl READ activeFocusControl NOTIFY activeFocusControlChanged FINAL)
Q_PROPERTY(QQuickItem *header READ header NOTIFY headerChanged FINAL)
Q_PROPERTY(QQuickItem *footer READ footer NOTIFY footerChanged FINAL)
- Q_PROPERTY(QQuickOverlay *overlay READ overlay NOTIFY overlayChanged FINAL)
Q_PROPERTY(QQuickItem *menuBar READ menuBar NOTIFY menuBarChanged FINAL) // REVISION 3
public:
@@ -152,7 +147,6 @@ public:
QQuickItem *activeFocusControl() const;
QQuickItem *header() const;
QQuickItem *footer() const;
- QQuickOverlay *overlay() const;
QQuickItem *menuBar() const;
Q_SIGNALS:
@@ -161,7 +155,6 @@ Q_SIGNALS:
void activeFocusControlChanged();
void headerChanged();
void footerChanged();
- void overlayChanged();
// 2.3 (Qt 5.10)
/*Q_REVISION(3)*/ void menuBarChanged();
diff --git a/src/quicktemplates2/qquickbuttongroup.cpp b/src/quicktemplates2/qquickbuttongroup.cpp
index 3886dce9..974cd029 100644
--- a/src/quicktemplates2/qquickbuttongroup.cpp
+++ b/src/quicktemplates2/qquickbuttongroup.cpp
@@ -170,7 +170,7 @@ public:
bool settingCheckState = false;
Qt::CheckState checkState = Qt::Unchecked;
QPointer<QQuickAbstractButton> checkedButton;
- QVector<QQuickAbstractButton*> buttons;
+ QList<QQuickAbstractButton*> buttons;
};
void QQuickButtonGroupPrivate::clear()
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index 85f135c7..426adbd3 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -54,10 +54,13 @@
#include <QtQuick/private/qquickaccessibleattached_p.h>
#include <QtQuick/private/qquickevents_p_p.h>
#include <QtQuick/private/qquicktextinput_p.h>
+#include <QtQuick/private/qquicktextinput_p_p.h>
#include <QtQuick/private/qquickitemview_p.h>
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcCalculateWidestTextWidth, "qt.quick.controls.combobox.calculatewidesttextwidth")
+
/*!
\qmltype ComboBox
\inherits Control
@@ -230,6 +233,7 @@ public:
void modelUpdated();
void countChanged();
+ QString effectiveTextRole() const;
void updateEditText();
void updateCurrentText();
void updateCurrentValue();
@@ -265,6 +269,10 @@ public:
void itemImplicitWidthChanged(QQuickItem *item) override;
void itemImplicitHeightChanged(QQuickItem *item) override;
+ virtual qreal getContentWidth() const override;
+ qreal calculateWidestTextWidth() const;
+ void maybeUpdateImplicitContentWidth();
+
static void hideOldPopup(QQuickPopup *popup);
QPalette defaultPalette() const override { return QQuickTheme::palette(QQuickTheme::ComboBox); }
@@ -277,8 +285,10 @@ public:
bool keyNavigating = false;
bool hasDisplayText = false;
bool hasCurrentIndex = false;
+ bool hasCalculatedWidestText = false;
int highlightedIndex = -1;
int currentIndex = -1;
+ QQuickComboBox::ImplicitContentWidthPolicy implicitContentWidthPolicy = QQuickComboBox::ContentItemImplicitWidth;
QVariant model;
QString textRole;
QString currentText;
@@ -411,8 +421,12 @@ void QQuickComboBoxPrivate::createdItem(int index, QObject *object)
void QQuickComboBoxPrivate::modelUpdated()
{
- if (!extra.isAllocated() || !extra->accepting)
+ if (componentComplete && (!extra.isAllocated() || !extra->accepting)) {
updateCurrentTextAndValue();
+
+ if (implicitContentWidthPolicy == QQuickComboBox::WidestText)
+ updateImplicitContentSize();
+ }
}
void QQuickComboBoxPrivate::countChanged()
@@ -423,6 +437,11 @@ void QQuickComboBoxPrivate::countChanged()
emit q->countChanged();
}
+QString QQuickComboBoxPrivate::effectiveTextRole() const
+{
+ return textRole.isEmpty() ? QStringLiteral("modelData") : textRole;
+}
+
void QQuickComboBoxPrivate::updateEditText()
{
Q_Q(QQuickComboBox);
@@ -780,6 +799,72 @@ void QQuickComboBoxPrivate::itemImplicitHeightChanged(QQuickItem *item)
emit q->implicitIndicatorHeightChanged();
}
+qreal QQuickComboBoxPrivate::getContentWidth() const
+{
+ if (componentComplete) {
+ switch (implicitContentWidthPolicy) {
+ case QQuickComboBox::WidestText:
+ return calculateWidestTextWidth();
+ case QQuickComboBox::WidestTextWhenCompleted:
+ if (!hasCalculatedWidestText)
+ return calculateWidestTextWidth();
+ break;
+ default:
+ break;
+ }
+ }
+
+ return QQuickControlPrivate::getContentWidth();
+}
+
+qreal QQuickComboBoxPrivate::calculateWidestTextWidth() const
+{
+ Q_Q(const QQuickComboBox);
+ if (!componentComplete)
+ return 0;
+
+ const int count = q->count();
+ if (count == 0)
+ return 0;
+
+ auto textInput = qobject_cast<QQuickTextInput*>(contentItem);
+ if (!textInput)
+ return 0;
+
+ qCDebug(lcCalculateWidestTextWidth) << "calculating widest text from" << count << "items...";
+
+ // Avoid the index check and repeated calls to effectiveTextRole()
+ // that would result from calling textAt() in a loop.
+ const QString textRole = effectiveTextRole();
+ auto textInputPrivate = QQuickTextInputPrivate::get(textInput);
+ qreal widest = 0;
+ for (int i = 0; i < count; ++i) {
+ const QString text = delegateModel->stringValue(i, textRole);
+ const qreal textImplicitWidth = textInputPrivate->calculateImplicitWidthForText(text);
+ widest = qMax(widest, textImplicitWidth);
+ }
+
+ qCDebug(lcCalculateWidestTextWidth) << "... widest text is" << widest;
+ return widest;
+}
+
+/*!
+ If the user requested it (and we haven't already done it, depending on the policy),
+ update the implicit content width to the largest text in the model.
+*/
+void QQuickComboBoxPrivate::maybeUpdateImplicitContentWidth()
+{
+ if (!componentComplete)
+ return;
+
+ if (implicitContentWidthPolicy == QQuickComboBox::ContentItemImplicitWidth
+ || (implicitContentWidthPolicy == QQuickComboBox::WidestTextWhenCompleted && hasCalculatedWidestText))
+ return;
+
+ updateImplicitContentWidth();
+ hasCalculatedWidestText = true;
+}
+
void QQuickComboBoxPrivate::hideOldPopup(QQuickPopup *popup)
{
if (!popup)
@@ -885,6 +970,8 @@ void QQuickComboBox::setModel(const QVariant& m)
d->updateCurrentTextAndValue();
}
emit modelChanged();
+
+ d->maybeUpdateImplicitContentWidth();
}
/*!
@@ -1597,6 +1684,80 @@ void QQuickComboBox::setSelectTextByMouse(bool canSelect)
d->extra.value().selectTextByMouse = canSelect;
emit selectTextByMouseChanged();
}
+
+/*!
+ \since QtQuick.Controls 6.0 (Qt 6.0)
+ \qmlproperty enumeration QtQuick.Controls::ComboBox::implicitContentWidthPolicy
+
+ This property controls how the \l implicitContentWidth of the ComboBox is
+ calculated.
+
+ When the width of a ComboBox is not large enough to display text, that text
+ is elided. Depending on which parts of the text are elided, this can make
+ selecting an item difficult for the end user. An efficient way of ensuring
+ that a ComboBox is wide enough to avoid text being elided is to set a width
+ that is known to be large enough:
+
+ \code
+ width: 300
+ implicitContentWidthPolicy: ComboBox.ContentItemImplicitWidth
+ \endcode
+
+ However, it is often not possible to know whether or not a hard-coded value
+ will be large enough, as the size of text depends on many factors, such as
+ font family, font size, translations, and so on.
+
+ implicitContentWidthPolicy provides an easy way to control how the
+ implicitContentWidth is calculated, which in turn affects the
+ \l implicitWidth of the ComboBox and ensures that text will not be elided.
+
+ The available values are:
+
+ \value ContentItemImplicitWidth
+ The implicitContentWidth will default to that of the \l contentItem.
+
+ This is the most efficient option, as no extra text layout is done.
+ \value WidestText
+ The implicitContentWidth will be set to the implicit width of the
+ the largest text for the given \l textRole every time the model
+ changes.
+
+ This option should be used with smaller models, as it can be expensive.
+ \value WidestTextWhenCompleted
+ The implicitContentWidth will be set to the implicit width of the
+ the largest text for the given \l textRole once after
+ \l {QQmlParserStatus::componentComplete()}{component completion}.
+
+ This option should be used with smaller models, as it can be expensive.
+
+ The default value is \c ContentItemImplicitWidth.
+
+ As this property only affects the \l implicitWidth of the ComboBox, setting
+ an explicit \l width can still result in eliding.
+
+ \note This feature requires the contentItem to be a type derived from
+ \l TextInput.
+
+ \note This feature requires text to be laid out, and can therefore be
+ expensive for large models or models whose contents are updated
+ frequently.
+*/
+QQuickComboBox::ImplicitContentWidthPolicy QQuickComboBox::implicitContentWidthPolicy() const
+{
+ Q_D(const QQuickComboBox);
+ return d->implicitContentWidthPolicy;
+}
+
+void QQuickComboBox::setImplicitContentWidthPolicy(QQuickComboBox::ImplicitContentWidthPolicy policy)
+{
+ Q_D(QQuickComboBox);
+ if (policy == d->implicitContentWidthPolicy)
+ return;
+
+ d->implicitContentWidthPolicy = policy;
+ d->maybeUpdateImplicitContentWidth();
+ emit implicitContentWidthPolicyChanged();
+}
/*!
\qmlmethod string QtQuick.Controls::ComboBox::textAt(int index)
@@ -1611,8 +1772,7 @@ QString QQuickComboBox::textAt(int index) const
if (!d->isValidIndex(index))
return QString();
- const QString effectiveTextRole = d->textRole.isEmpty() ? QStringLiteral("modelData") : d->textRole;
- return d->delegateModel->stringValue(index, effectiveTextRole);
+ return d->delegateModel->stringValue(index, d->effectiveTextRole());
}
/*!
@@ -1894,6 +2054,11 @@ void QQuickComboBox::componentComplete()
setCurrentIndex(0);
else
d->updateCurrentTextAndValue();
+
+ // If the widest text was already calculated in the call to
+ // QQmlDelegateModel::componentComplete() above, then we shouldn't do it here too.
+ if (!d->hasCalculatedWidestText)
+ d->maybeUpdateImplicitContentWidth();
}
}
@@ -1907,6 +2072,13 @@ void QQuickComboBox::itemChange(QQuickItem::ItemChange change, const QQuickItem:
}
}
+void QQuickComboBox::fontChange(const QFont &newFont, const QFont &oldFont)
+{
+ Q_D(QQuickComboBox);
+ QQuickControl::fontChange(newFont, oldFont);
+ d->maybeUpdateImplicitContentWidth();
+}
+
void QQuickComboBox::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
{
Q_D(QQuickComboBox);
diff --git a/src/quicktemplates2/qquickcombobox_p.h b/src/quicktemplates2/qquickcombobox_p.h
index 4874eb5d..18c1275c 100644
--- a/src/quicktemplates2/qquickcombobox_p.h
+++ b/src/quicktemplates2/qquickcombobox_p.h
@@ -94,6 +94,9 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickComboBox : public QQuickControl
Q_PROPERTY(QString valueRole READ valueRole WRITE setValueRole NOTIFY valueRoleChanged FINAL REVISION 14)
// 2.15 (Qt 5.15)
Q_PROPERTY(bool selectTextByMouse READ selectTextByMouse WRITE setSelectTextByMouse NOTIFY selectTextByMouseChanged FINAL REVISION 15)
+ // TODO: 6.0 (Qt 6.0) - QTBUG-84190
+ Q_PROPERTY(ImplicitContentWidthPolicy implicitContentWidthPolicy READ implicitContentWidthPolicy
+ WRITE setImplicitContentWidthPolicy NOTIFY implicitContentWidthPolicyChanged FINAL REVISION 15)
public:
explicit QQuickComboBox(QQuickItem *parent = nullptr);
@@ -175,6 +178,17 @@ public:
bool selectTextByMouse() const;
void setSelectTextByMouse(bool canSelect);
+ // 6.0 (Qt 6.0)
+ enum ImplicitContentWidthPolicy {
+ ContentItemImplicitWidth,
+ WidestText,
+ WidestTextWhenCompleted
+ };
+ Q_ENUM(ImplicitContentWidthPolicy)
+
+ ImplicitContentWidthPolicy implicitContentWidthPolicy() const;
+ void setImplicitContentWidthPolicy(ImplicitContentWidthPolicy policy);
+
public Q_SLOTS:
void incrementCurrentIndex();
void decrementCurrentIndex();
@@ -214,6 +228,8 @@ Q_SIGNALS:
Q_REVISION(14) void currentValueChanged();
// 2.15 (Qt 5.15)
Q_REVISION(15) void selectTextByMouseChanged();
+ // 6.0 (Qt 6.0)
+ Q_REVISION(6, 0) void implicitContentWidthPolicyChanged();
protected:
bool eventFilter(QObject *object, QEvent *event) override;
@@ -231,6 +247,7 @@ protected:
void componentComplete() override;
void itemChange(ItemChange change, const ItemChangeData &value) override;
+ void fontChange(const QFont &newFont, const QFont &oldFont) override;
void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override;
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index c5a5fd7a..8463c60d 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -1442,7 +1442,7 @@ void QQuickControl::setHoverEnabled(bool enabled)
d->updateHoverEnabled(enabled, true); // explicit=true
#else
- Q_UNUSED(enabled)
+ Q_UNUSED(enabled);
#endif
}
@@ -2154,7 +2154,7 @@ void QQuickControl::maybeSetAccessibleName(const QString &name)
accessibleAttached->setNameImplicitly(name);
}
#else
- Q_UNUSED(name)
+ Q_UNUSED(name);
#endif
}
@@ -2164,7 +2164,7 @@ QVariant QQuickControl::accessibleProperty(const char *propertyName)
if (QAccessible::isActive())
return QQuickAccessibleAttached::property(this, propertyName);
#endif
- Q_UNUSED(propertyName)
+ Q_UNUSED(propertyName);
return QVariant();
}
@@ -2174,8 +2174,8 @@ bool QQuickControl::setAccessibleProperty(const char *propertyName, const QVaria
if (QAccessible::isActive())
return QQuickAccessibleAttached::setProperty(this, propertyName, value);
#endif
- Q_UNUSED(propertyName)
- Q_UNUSED(value)
+ Q_UNUSED(propertyName);
+ Q_UNUSED(value);
return false;
}
diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp
index b9e9674b..d6ed366f 100644
--- a/src/quicktemplates2/qquickdialogbuttonbox.cpp
+++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp
@@ -258,7 +258,7 @@ void QQuickDialogButtonBoxPrivate::updateLayout()
const int halign = alignment & Qt::AlignHorizontal_Mask;
const int valign = alignment & Qt::AlignVertical_Mask;
- QVector<QQuickAbstractButton *> buttons;
+ QList<QQuickAbstractButton *> buttons;
const qreal cw = (alignment & Qt::AlignHorizontal_Mask) == 0 ? q->availableWidth() : contentWidth;
const qreal itemWidth = (cw - qMax(0, count - 1) * spacing) / count;
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index b6d70dd7..433346ba 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -416,7 +416,7 @@ bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event)
}
if (overThreshold) {
- popupItem->grabTouchPoints(QVector<int>() << touchId);
+ popupItem->grabTouchPoints(QList<int>() << touchId);
popupItem->setKeepTouchGrab(true);
offset = offsetAt(movePoint);
}
diff --git a/src/quicktemplates2/qquickheaderview.cpp b/src/quicktemplates2/qquickheaderview.cpp
index 85291bcb..8593fa0f 100644
--- a/src/quicktemplates2/qquickheaderview.cpp
+++ b/src/quicktemplates2/qquickheaderview.cpp
@@ -360,7 +360,7 @@ QModelIndex QHeaderDataProxyModel::index(int row, int column, const QModelIndex
QModelIndex QHeaderDataProxyModel::parent(const QModelIndex &child) const
{
- Q_UNUSED(child)
+ Q_UNUSED(child);
return QModelIndex();
}
@@ -401,7 +401,7 @@ bool QHeaderDataProxyModel::setData(const QModelIndex &index, const QVariant &va
bool QHeaderDataProxyModel::hasChildren(const QModelIndex &parent) const
{
- Q_UNUSED(parent)
+ Q_UNUSED(parent);
return false;
}
diff --git a/src/quicktemplates2/qquicklabel.cpp b/src/quicktemplates2/qquicklabel.cpp
index f8c1c489..144d2fe7 100644
--- a/src/quicktemplates2/qquicklabel.cpp
+++ b/src/quicktemplates2/qquicklabel.cpp
@@ -213,7 +213,7 @@ void QQuickLabelPrivate::textChanged(const QString &text)
#if QT_CONFIG(accessibility)
maybeSetAccessibleName(text);
#else
- Q_UNUSED(text)
+ Q_UNUSED(text);
#endif
}
diff --git a/src/quicktemplates2/qquickmenu_p_p.h b/src/quicktemplates2/qquickmenu_p_p.h
index 41837a15..f1a5b3f9 100644
--- a/src/quicktemplates2/qquickmenu_p_p.h
+++ b/src/quicktemplates2/qquickmenu_p_p.h
@@ -48,7 +48,7 @@
// We mean it.
//
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <QtCore/qpointer.h>
#include <QtQuickTemplates2/private/qquickmenu_p.h>
@@ -131,7 +131,7 @@ public:
QPointer<QQuickMenu> parentMenu;
QPointer<QQuickMenuItem> currentItem;
QQuickItem *contentItem = nullptr; // TODO: cleanup
- QVector<QObject *> contentData;
+ QList<QObject *> contentData;
QQmlObjectModel *contentModel;
QQmlComponent *delegate = nullptr;
QString title;
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp
index 6eb0d0e8..5cb1ab0b 100644
--- a/src/quicktemplates2/qquickoverlay.cpp
+++ b/src/quicktemplates2/qquickoverlay.cpp
@@ -69,11 +69,11 @@ QT_BEGIN_NAMESPACE
\sa ApplicationWindow
*/
-QVector<QQuickPopup *> QQuickOverlayPrivate::stackingOrderPopups() const
+QList<QQuickPopup *> QQuickOverlayPrivate::stackingOrderPopups() const
{
const QList<QQuickItem *> children = paintOrderChildItems();
- QVector<QQuickPopup *> popups;
+ QList<QQuickPopup *> popups;
popups.reserve(children.count());
for (auto it = children.crbegin(), end = children.crend(); it != end; ++it) {
@@ -85,9 +85,9 @@ QVector<QQuickPopup *> QQuickOverlayPrivate::stackingOrderPopups() const
return popups;
}
-QVector<QQuickDrawer *> QQuickOverlayPrivate::stackingOrderDrawers() const
+QList<QQuickDrawer *> QQuickOverlayPrivate::stackingOrderDrawers() const
{
- QVector<QQuickDrawer *> sorted(allDrawers);
+ QList<QQuickDrawer *> sorted(allDrawers);
std::sort(sorted.begin(), sorted.end(), [](const QQuickDrawer *one, const QQuickDrawer *another) {
return one->z() > another->z();
});
@@ -116,7 +116,7 @@ bool QQuickOverlayPrivate::startDrag(QEvent *event, const QPointF &pos)
}
}
- const QVector<QQuickDrawer *> drawers = stackingOrderDrawers();
+ const QList<QQuickDrawer *> drawers = stackingOrderDrawers();
for (QQuickDrawer *drawer : drawers) {
QQuickDrawerPrivate *p = QQuickDrawerPrivate::get(drawer);
if (p->startDrag(event)) {
@@ -194,7 +194,7 @@ bool QQuickOverlayPrivate::handleMouseEvent(QQuickItem *source, QMouseEvent *eve
{
switch (event->type()) {
case QEvent::MouseButtonPress:
- if (!target && startDrag(event, event->windowPos()))
+ if (!target && startDrag(event, event->scenePosition()))
return true;
return handlePress(source, event, target);
case QEvent::MouseMove:
@@ -218,7 +218,7 @@ bool QQuickOverlayPrivate::handleTouchEvent(QQuickItem *source, QTouchEvent *eve
for (const QTouchEvent::TouchPoint &point : event->touchPoints()) {
switch (point.state()) {
case Qt::TouchPointPressed:
- if (!target && startDrag(event, point.scenePos()))
+ if (!target && startDrag(event, point.scenePosition()))
handled = true;
else
handled |= handlePress(source, event, target);
@@ -368,10 +368,6 @@ QQuickOverlay *QQuickOverlay::overlay(QQuickWindow *window)
if (!window)
return nullptr;
- QQuickApplicationWindow *applicationWindow = qobject_cast<QQuickApplicationWindow *>(window);
- if (applicationWindow)
- return applicationWindow->overlay();
-
const char *name = "_q_QQuickOverlay";
QQuickOverlay *overlay = window->property(name).value<QQuickOverlay *>();
if (!overlay) {
diff --git a/src/quicktemplates2/qquickoverlay_p_p.h b/src/quicktemplates2/qquickoverlay_p_p.h
index b445f87a..ef3d9ee2 100644
--- a/src/quicktemplates2/qquickoverlay_p_p.h
+++ b/src/quicktemplates2/qquickoverlay_p_p.h
@@ -82,8 +82,8 @@ public:
void removePopup(QQuickPopup *popup);
void setMouseGrabberPopup(QQuickPopup *popup);
- QVector<QQuickPopup *> stackingOrderPopups() const;
- QVector<QQuickDrawer *> stackingOrderDrawers() const;
+ QList<QQuickPopup *> stackingOrderPopups() const;
+ QList<QQuickDrawer *> stackingOrderDrawers() const;
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
@@ -91,8 +91,8 @@ public:
QQmlComponent *modal = nullptr;
QQmlComponent *modeless = nullptr;
- QVector<QQuickPopup *> allPopups;
- QVector<QQuickDrawer *> allDrawers;
+ QList<QQuickPopup *> allPopups;
+ QList<QQuickDrawer *> allDrawers;
QPointer<QQuickPopup> mouseGrabberPopup;
};
diff --git a/src/quicktemplates2/qquickpane.cpp b/src/quicktemplates2/qquickpane.cpp
index bf902b6b..ecdc27db 100644
--- a/src/quicktemplates2/qquickpane.cpp
+++ b/src/quicktemplates2/qquickpane.cpp
@@ -410,8 +410,8 @@ void QQuickPane::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
void QQuickPane::contentSizeChange(const QSizeF &newSize, const QSizeF &oldSize)
{
- Q_UNUSED(newSize)
- Q_UNUSED(oldSize)
+ Q_UNUSED(newSize);
+ Q_UNUSED(oldSize);
}
#if QT_CONFIG(accessibility)
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index bafa3110..1d6f125e 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -372,11 +372,11 @@ bool QQuickPopupPrivate::handleMouseEvent(QQuickItem *item, QMouseEvent *event)
{
switch (event->type()) {
case QEvent::MouseButtonPress:
- return handlePress(item, event->windowPos(), event->timestamp());
+ return handlePress(item, event->scenePosition(), event->timestamp());
case QEvent::MouseMove:
- return handleMove(item, event->windowPos(), event->timestamp());
+ return handleMove(item, event->scenePosition(), event->timestamp());
case QEvent::MouseButtonRelease:
- return handleRelease(item, event->windowPos(), event->timestamp());
+ return handleRelease(item, event->scenePosition(), event->timestamp());
default:
Q_UNREACHABLE();
return false;
@@ -392,15 +392,15 @@ bool QQuickPopupPrivate::handleTouchEvent(QQuickItem *item, QTouchEvent *event)
case QEvent::TouchEnd:
for (const QTouchEvent::TouchPoint &point : event->touchPoints()) {
if (!acceptTouch(point))
- return blockInput(item, point.pos());
+ return blockInput(item, point.position());
switch (point.state()) {
case Qt::TouchPointPressed:
- return handlePress(item, item->mapToScene(point.pos()), event->timestamp());
+ return handlePress(item, item->mapToScene(point.position()), event->timestamp());
case Qt::TouchPointMoved:
- return handleMove(item, item->mapToScene(point.pos()), event->timestamp());
+ return handleMove(item, item->mapToScene(point.position()), event->timestamp());
case Qt::TouchPointReleased:
- return handleRelease(item, item->mapToScene(point.pos()), event->timestamp());
+ return handleRelease(item, item->mapToScene(point.position()), event->timestamp());
default:
break;
}
diff --git a/src/quicktemplates2/qquickpopupanchors.cpp b/src/quicktemplates2/qquickpopupanchors.cpp
index c48ca5ff..0d286cc0 100644
--- a/src/quicktemplates2/qquickpopupanchors.cpp
+++ b/src/quicktemplates2/qquickpopupanchors.cpp
@@ -47,6 +47,15 @@ QQuickPopupAnchors::QQuickPopupAnchors(QQuickPopup *popup)
d->popup = popup;
}
+QQuickPopupAnchors::~QQuickPopupAnchors()
+{
+ Q_D(const QQuickPopupAnchors);
+ if (d->centerIn) {
+ auto centerInPrivate = QQuickItemPrivate::get(d->centerIn);
+ centerInPrivate->removeItemChangeListener(this, QQuickItemPrivate::Destroyed);
+ }
+}
+
QQuickItem *QQuickPopupAnchors::centerIn() const
{
Q_D(const QQuickPopupAnchors);
@@ -59,8 +68,20 @@ void QQuickPopupAnchors::setCenterIn(QQuickItem *item)
if (item == d->centerIn)
return;
+ if (d->centerIn) {
+ auto centerInPrivate = QQuickItemPrivate::get(d->centerIn);
+ centerInPrivate->removeItemChangeListener(this, QQuickItemPrivate::Destroyed);
+ }
+
d->centerIn = item;
+
+ if (d->centerIn) {
+ auto centerInPrivate = QQuickItemPrivate::get(d->centerIn);
+ centerInPrivate->addItemChangeListener(this, QQuickItemPrivate::Destroyed);
+ }
+
QQuickPopupPrivate::get(d->popup)->reposition();
+
emit centerInChanged();
}
@@ -69,6 +90,11 @@ void QQuickPopupAnchors::resetCenterIn()
setCenterIn(nullptr);
}
+void QQuickPopupAnchors::itemDestroyed(QQuickItem *)
+{
+ resetCenterIn();
+}
+
QT_END_NAMESPACE
#include "moc_qquickpopupanchors_p.cpp"
diff --git a/src/quicktemplates2/qquickpopupanchors_p.h b/src/quicktemplates2/qquickpopupanchors_p.h
index 531c494e..eff4e23d 100644
--- a/src/quicktemplates2/qquickpopupanchors_p.h
+++ b/src/quicktemplates2/qquickpopupanchors_p.h
@@ -50,6 +50,7 @@
#include <QtCore/qobject.h>
#include <QtQml/qqml.h>
+#include <QtQuick/private/qquickitem_p.h>
#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
QT_BEGIN_NAMESPACE
@@ -58,13 +59,14 @@ class QQuickItem;
class QQuickPopupAnchorsPrivate;
class QQuickPopup;
-class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopupAnchors : public QObject
+class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopupAnchors : public QObject, public QQuickItemChangeListener
{
Q_OBJECT
Q_PROPERTY(QQuickItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn NOTIFY centerInChanged)
public:
explicit QQuickPopupAnchors(QQuickPopup *popup);
+ ~QQuickPopupAnchors();
QQuickItem *centerIn() const;
void setCenterIn(QQuickItem *item);
@@ -74,6 +76,8 @@ Q_SIGNALS:
void centerInChanged();
private:
+ void itemDestroyed(QQuickItem *item) override;
+
Q_DISABLE_COPY(QQuickPopupAnchors)
Q_DECLARE_PRIVATE(QQuickPopupAnchors)
};
diff --git a/src/quicktemplates2/qquickpresshandler.cpp b/src/quicktemplates2/qquickpresshandler.cpp
index b9018573..d9ed484b 100644
--- a/src/quicktemplates2/qquickpresshandler.cpp
+++ b/src/quicktemplates2/qquickpresshandler.cpp
@@ -49,10 +49,10 @@ QT_BEGIN_NAMESPACE
void QQuickPressHandler::mousePressEvent(QMouseEvent *event)
{
longPress = false;
- pressPos = event->localPos();
+ pressPos = event->position();
if (Qt::LeftButton == (event->buttons() & Qt::LeftButton)) {
timer.start(QGuiApplication::styleHints()->mousePressAndHoldInterval(), control);
- delayedMousePressEvent = new QMouseEvent(event->type(), event->pos(), event->button(), event->buttons(), event->modifiers());
+ delayedMousePressEvent = new QMouseEvent(event->type(), event->position().toPoint(), event->button(), event->buttons(), event->modifiers());
} else {
timer.stop();
}
@@ -60,7 +60,7 @@ void QQuickPressHandler::mousePressEvent(QMouseEvent *event)
if (isSignalConnected(control, "pressed(QQuickMouseEvent*)", pressedSignalIndex)) {
QQuickMouseEvent mev;
mev.reset(pressPos.x(), pressPos.y(), event->button(), event->buttons(),
- QGuiApplication::keyboardModifiers(), false/*isClick*/, false/*wasHeld*/);
+ event->modifiers(), false/*isClick*/, false/*wasHeld*/);
mev.setAccepted(true);
QQuickMouseEvent *mevPtr = &mev;
void *args[] = { nullptr, &mevPtr };
@@ -71,7 +71,7 @@ void QQuickPressHandler::mousePressEvent(QMouseEvent *event)
void QQuickPressHandler::mouseMoveEvent(QMouseEvent *event)
{
- if (qAbs(int(event->localPos().x() - pressPos.x())) > QGuiApplication::styleHints()->startDragDistance())
+ if (qAbs(int(event->position().x() - pressPos.x())) > QGuiApplication::styleHints()->startDragDistance())
timer.stop();
}
@@ -83,7 +83,7 @@ void QQuickPressHandler::mouseReleaseEvent(QMouseEvent *event)
if (isSignalConnected(control, "released(QQuickMouseEvent*)", releasedSignalIndex)) {
QQuickMouseEvent mev;
mev.reset(pressPos.x(), pressPos.y(), event->button(), event->buttons(),
- QGuiApplication::keyboardModifiers(), false/*isClick*/, false/*wasHeld*/);
+ event->modifiers(), false/*isClick*/, false/*wasHeld*/);
mev.setAccepted(true);
QQuickMouseEvent *mevPtr = &mev;
void *args[] = { nullptr, &mevPtr };
@@ -101,8 +101,11 @@ void QQuickPressHandler::timerEvent(QTimerEvent *)
longPress = isSignalConnected(control, "pressAndHold(QQuickMouseEvent*)", pressAndHoldSignalIndex);
if (longPress) {
QQuickMouseEvent mev;
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
mev.reset(pressPos.x(), pressPos.y(), Qt::LeftButton, Qt::LeftButton,
QGuiApplication::keyboardModifiers(), false/*isClick*/, true/*wasHeld*/);
+QT_WARNING_POP
mev.setAccepted(true);
// Use fast signal invocation since we already got its index
QQuickMouseEvent *mevPtr = &mev;
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp
index 9ad12102..2b0f2961 100644
--- a/src/quicktemplates2/qquickrangeslider.cpp
+++ b/src/quicktemplates2/qquickrangeslider.cpp
@@ -1151,14 +1151,14 @@ void QQuickRangeSlider::hoverEnterEvent(QHoverEvent *event)
{
Q_D(QQuickRangeSlider);
QQuickControl::hoverEnterEvent(event);
- d->updateHover(event->posF());
+ d->updateHover(event->position());
}
void QQuickRangeSlider::hoverMoveEvent(QHoverEvent *event)
{
Q_D(QQuickRangeSlider);
QQuickControl::hoverMoveEvent(event);
- d->updateHover(event->posF());
+ d->updateHover(event->position());
}
void QQuickRangeSlider::hoverLeaveEvent(QHoverEvent *event)
@@ -1181,7 +1181,7 @@ void QQuickRangeSlider::mousePressEvent(QMouseEvent *event)
{
Q_D(QQuickRangeSlider);
QQuickControl::mousePressEvent(event);
- d->handleMove(event->localPos());
+ d->handleMove(event->position());
setKeepMouseGrab(true);
}
@@ -1197,20 +1197,20 @@ void QQuickRangeSlider::touchEvent(QTouchEvent *event)
switch (point.state()) {
case Qt::TouchPointPressed:
- d->handlePress(point.pos());
+ d->handlePress(point.position());
break;
case Qt::TouchPointMoved:
if (!keepTouchGrab()) {
if (d->orientation == Qt::Horizontal)
- setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.pos().x() - point.startPos().x(), Qt::XAxis, &point, qRound(d->touchDragThreshold)));
+ setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.position().x() - point.pressPosition().x(), Qt::XAxis, &point, qRound(d->touchDragThreshold)));
else
- setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.pos().y() - point.startPos().y(), Qt::YAxis, &point, qRound(d->touchDragThreshold)));
+ setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.position().y() - point.pressPosition().y(), Qt::YAxis, &point, qRound(d->touchDragThreshold)));
}
if (keepTouchGrab())
- d->handleMove(point.pos());
+ d->handleMove(point.position());
break;
case Qt::TouchPointReleased:
- d->handleRelease(point.pos());
+ d->handleRelease(point.position());
break;
default:
break;
diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp
index 678b7942..b352224c 100644
--- a/src/quicktemplates2/qquickscrollbar.cpp
+++ b/src/quicktemplates2/qquickscrollbar.cpp
@@ -710,7 +710,7 @@ void QQuickScrollBar::mousePressEvent(QMouseEvent *event)
{
Q_D(QQuickScrollBar);
QQuickControl::mousePressEvent(event);
- d->handleMove(event->localPos());
+ d->handleMove(event->position());
}
#if QT_CONFIG(quicktemplates2_hover)
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp
index f4a459fa..9d223f25 100644
--- a/src/quicktemplates2/qquickslider.cpp
+++ b/src/quicktemplates2/qquickslider.cpp
@@ -790,7 +790,7 @@ void QQuickSlider::mousePressEvent(QMouseEvent *event)
{
Q_D(QQuickSlider);
QQuickControl::mousePressEvent(event);
- d->handleMove(event->localPos());
+ d->handleMove(event->position());
setKeepMouseGrab(true);
}
@@ -806,20 +806,20 @@ void QQuickSlider::touchEvent(QTouchEvent *event)
switch (point.state()) {
case Qt::TouchPointPressed:
- d->handlePress(point.pos());
+ d->handlePress(point.position());
break;
case Qt::TouchPointMoved:
if (!keepTouchGrab()) {
if (d->orientation == Qt::Horizontal)
- setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.pos().x() - d->pressPoint.x(), Qt::XAxis, &point, qRound(d->touchDragThreshold)));
+ setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.position().x() - d->pressPoint.x(), Qt::XAxis, &point, qRound(d->touchDragThreshold)));
else
- setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.pos().y() - d->pressPoint.y(), Qt::YAxis, &point, qRound(d->touchDragThreshold)));
+ setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.position().y() - d->pressPoint.y(), Qt::YAxis, &point, qRound(d->touchDragThreshold)));
}
if (keepTouchGrab())
- d->handleMove(point.pos());
+ d->handleMove(point.position());
break;
case Qt::TouchPointReleased:
- d->handleRelease(point.pos());
+ d->handleRelease(point.position());
break;
default:
break;
diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp
index 687ccafd..c1541a99 100644
--- a/src/quicktemplates2/qquickspinbox.cpp
+++ b/src/quicktemplates2/qquickspinbox.cpp
@@ -891,14 +891,14 @@ void QQuickSpinBox::hoverEnterEvent(QHoverEvent *event)
{
Q_D(QQuickSpinBox);
QQuickControl::hoverEnterEvent(event);
- d->updateHover(event->posF());
+ d->updateHover(event->position());
}
void QQuickSpinBox::hoverMoveEvent(QHoverEvent *event)
{
Q_D(QQuickSpinBox);
QQuickControl::hoverMoveEvent(event);
- d->updateHover(event->posF());
+ d->updateHover(event->position());
}
void QQuickSpinBox::hoverLeaveEvent(QHoverEvent *event)
diff --git a/src/quicktemplates2/qquicksplitview.cpp b/src/quicktemplates2/qquicksplitview.cpp
index a1016792..df00f522 100644
--- a/src/quicktemplates2/qquicksplitview.cpp
+++ b/src/quicktemplates2/qquicksplitview.cpp
@@ -1389,7 +1389,7 @@ void QQuickSplitView::hoverMoveEvent(QHoverEvent *event)
Q_D(QQuickSplitView);
QQuickContainer::hoverMoveEvent(event);
- QQuickItem *hoveredItem = childAt(event->pos().x(), event->pos().y());
+ QQuickItem *hoveredItem = childAt(event->position().toPoint().x(), event->position().toPoint().y());
d->updateHoveredHandle(hoveredItem);
}
@@ -2029,7 +2029,7 @@ const QQuickSplitHandleAttachedPrivate *QQuickSplitHandleAttachedPrivate::get(co
}
QQuickSplitHandleAttached::QQuickSplitHandleAttached(QObject *parent)
- : QObject(*(new QQuickSplitViewAttachedPrivate), parent)
+ : QObject(*(new QQuickSplitHandleAttachedPrivate), parent)
{
}
diff --git a/src/quicktemplates2/qquicksplitview_p_p.h b/src/quicktemplates2/qquicksplitview_p_p.h
index 2430eac1..6123f83d 100644
--- a/src/quicktemplates2/qquicksplitview_p_p.h
+++ b/src/quicktemplates2/qquicksplitview_p_p.h
@@ -109,7 +109,7 @@ public:
Qt::Orientation m_orientation = Qt::Horizontal;
QQmlComponent *m_handle = nullptr;
- QVector<QQuickItem*> m_handleItems;
+ QList<QQuickItem*> m_handleItems;
int m_hoveredHandleIndex = -1;
int m_pressedHandleIndex = -1;
int m_nextVisibleIndexAfterPressedHandle = -1;
diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp
index e5e2c39b..83f99843 100644
--- a/src/quicktemplates2/qquickstackview.cpp
+++ b/src/quicktemplates2/qquickstackview.cpp
@@ -498,7 +498,7 @@ QQuickItem *QQuickStackView::find(const QJSValue &callback, LoadBehavior behavio
/*!
\qmlmethod Item QtQuick.Controls::StackView::push(item, properties, operation)
- Pushes an \a item onto the stack using the specified \a operation, and
+ Pushes an \a item onto the stack using an optional \a operation, and
optionally applies a set of \a properties on the item. The item can be
an \l Item, \l Component, or a \l [QML] url. Returns the item that became
current.
@@ -545,12 +545,13 @@ QQuickItem *QQuickStackView::find(const QJSValue &callback, LoadBehavior behavio
An \a operation can be optionally specified as the last argument. Supported
operations:
- \value StackView.Transition An operation with default transitions (default).
\value StackView.Immediate An immediate operation without transitions.
\value StackView.PushTransition An operation with push transitions (since QtQuick.Controls 2.1).
\value StackView.ReplaceTransition An operation with replace transitions (since QtQuick.Controls 2.1).
\value StackView.PopTransition An operation with pop transitions (since QtQuick.Controls 2.1).
+ If no operation is provided, \c PushTransition will be used.
+
\note Items that already exist in the stack are not pushed.
\sa initialItem, {Pushing Items}
@@ -639,12 +640,13 @@ void QQuickStackView::push(QQmlV4Function *args)
An \a operation can be optionally specified as the last argument. Supported
operations:
- \value StackView.Transition An operation with default transitions (default).
\value StackView.Immediate An immediate operation without transitions.
\value StackView.PushTransition An operation with push transitions (since QtQuick.Controls 2.1).
\value StackView.ReplaceTransition An operation with replace transitions (since QtQuick.Controls 2.1).
\value StackView.PopTransition An operation with pop transitions (since QtQuick.Controls 2.1).
+ If no operation is provided, \c PopTransition will be used.
+
Examples:
\code
stackView.pop()
@@ -733,7 +735,7 @@ void QQuickStackView::pop(QQmlV4Function *args)
\qmlmethod Item QtQuick.Controls::StackView::replace(target, item, properties, operation)
Replaces one or more items on the stack with the specified \a item and
- \a operation, and optionally applies a set of \a properties on the
+ optional \a operation, and optionally applies a set of \a properties on the
item. The item can be an \l Item, \l Component, or a \l [QML] url.
Returns the item that became current.
@@ -782,12 +784,13 @@ void QQuickStackView::pop(QQmlV4Function *args)
An \a operation can be optionally specified as the last argument. Supported
operations:
- \value StackView.Transition An operation with default transitions (default).
\value StackView.Immediate An immediate operation without transitions.
\value StackView.PushTransition An operation with push transitions (since QtQuick.Controls 2.1).
\value StackView.ReplaceTransition An operation with replace transitions (since QtQuick.Controls 2.1).
\value StackView.PopTransition An operation with pop transitions (since QtQuick.Controls 2.1).
+ If no operation is provided, \c ReplaceTransition will be used.
+
The following example illustrates the use of push and pop transitions with replace().
\code
diff --git a/src/quicktemplates2/qquickstackview_p.h b/src/quicktemplates2/qquickstackview_p.h
index 9bb9c8f4..f551f027 100644
--- a/src/quicktemplates2/qquickstackview_p.h
+++ b/src/quicktemplates2/qquickstackview_p.h
@@ -124,7 +124,7 @@ public:
Q_INVOKABLE QQuickItem *find(const QJSValue &callback, LoadBehavior behavior = DontLoad);
enum Operation {
- Transition = -1, // deprecated
+ Transition = -1, // ### Deprecated in Qt 6; remove in Qt 7.
Immediate = 0,
PushTransition = 1,
ReplaceTransition = 2,
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp
index 8c8d8c6e..a28d8ecf 100644
--- a/src/quicktemplates2/qquickswipedelegate.cpp
+++ b/src/quicktemplates2/qquickswipedelegate.cpp
@@ -720,7 +720,7 @@ bool QQuickSwipeDelegatePrivate::handleMousePressEvent(QQuickItem *item, QMouseE
// The press point could be incorrect if the press happened over a child item,
// so we correct it after calling the base class' mousePressEvent(), rather
// than having to duplicate its code just so we can set the pressPoint.
- setPressPoint(item->mapToItem(q, event->pos()));
+ setPressPoint(item->mapToItem(q, event->position().toPoint()));
return true;
}
@@ -728,8 +728,8 @@ bool QQuickSwipeDelegatePrivate::handleMousePressEvent(QQuickItem *item, QMouseE
// (the control can be clicked to e.g. close the swipe). Either way, we must begin measuring
// mouse movement in case it turns into a swipe, in which case we grab the mouse.
swipePrivate->positionBeforePress = swipePrivate->position;
- swipePrivate->velocityCalculator.startMeasuring(event->pos(), event->timestamp());
- setPressPoint(item->mapToItem(q, event->pos()));
+ swipePrivate->velocityCalculator.startMeasuring(event->position().toPoint(), event->timestamp());
+ setPressPoint(item->mapToItem(q, event->position().toPoint()));
// When a delegate uses the attached properties and signals, it declares that it wants mouse events.
Attached *attached = attachedObject(item);
@@ -748,7 +748,7 @@ bool QQuickSwipeDelegatePrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEv
Q_Q(QQuickSwipeDelegate);
if (holdTimer > 0) {
- if (QLineF(pressPoint, event->localPos()).length() > QGuiApplication::styleHints()->startDragDistance())
+ if (QLineF(pressPoint, event->position()).length() > QGuiApplication::styleHints()->startDragDistance())
stopPressAndHold();
}
@@ -770,7 +770,7 @@ bool QQuickSwipeDelegatePrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEv
if (item == q && !pressed)
return false;
- const QPointF mappedEventPos = item->mapToItem(q, event->pos());
+ const QPointF mappedEventPos = item->mapToItem(q, event->position().toPoint());
const qreal distance = (mappedEventPos - pressPoint).x();
if (!q->keepMouseGrab()) {
// Taken from QQuickDrawerPrivate::grabMouse; see comments there.
@@ -840,7 +840,7 @@ bool QQuickSwipeDelegatePrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEv
}
} else {
// The swipe wasn't initiated.
- if (event->pos().y() < 0 || event->pos().y() > height) {
+ if (event->position().toPoint().y() < 0 || event->position().toPoint().y() > height) {
// The mouse went outside the vertical bounds of the control, so
// we should no longer consider it pressed.
q->setPressed(false);
@@ -858,7 +858,7 @@ bool QQuickSwipeDelegatePrivate::handleMouseReleaseEvent(QQuickItem *item, QMous
{
Q_Q(QQuickSwipeDelegate);
QQuickSwipePrivate *swipePrivate = QQuickSwipePrivate::get(&swipe);
- swipePrivate->velocityCalculator.stopMeasuring(event->pos(), event->timestamp());
+ swipePrivate->velocityCalculator.stopMeasuring(event->position().toPoint(), event->timestamp());
const bool hadGrabbedMouse = q->keepMouseGrab();
q->setKeepMouseGrab(false);
@@ -1180,7 +1180,7 @@ void QQuickSwipeDelegate::mousePressEvent(QMouseEvent *event)
return;
swipePrivate->positionBeforePress = swipePrivate->position;
- swipePrivate->velocityCalculator.startMeasuring(event->pos(), event->timestamp());
+ swipePrivate->velocityCalculator.startMeasuring(event->position().toPoint(), event->timestamp());
}
void QQuickSwipeDelegate::mouseMoveEvent(QMouseEvent *event)
diff --git a/src/quicktemplates2/qquickswitch.cpp b/src/quicktemplates2/qquickswitch.cpp
index 08ea44da..2bba350d 100644
--- a/src/quicktemplates2/qquickswitch.cpp
+++ b/src/quicktemplates2/qquickswitch.cpp
@@ -180,7 +180,7 @@ void QQuickSwitch::mouseMoveEvent(QMouseEvent *event)
{
Q_D(QQuickSwitch);
if (!keepMouseGrab()) {
- const QPointF movePoint = event->localPos();
+ const QPointF movePoint = event->position();
if (d->canDrag(movePoint))
setKeepMouseGrab(QQuickWindowPrivate::dragOverThreshold(movePoint.x() - d->pressPoint.x(), Qt::XAxis, event));
}
@@ -195,8 +195,8 @@ void QQuickSwitch::touchEvent(QTouchEvent *event)
for (const QTouchEvent::TouchPoint &point : event->touchPoints()) {
if (point.id() != d->touchId || point.state() != Qt::TouchPointMoved)
continue;
- if (d->canDrag(point.pos()))
- setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.pos().x() - d->pressPoint.x(), Qt::XAxis, &point));
+ if (d->canDrag(point.position()))
+ setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.position().x() - d->pressPoint.x(), Qt::XAxis, &point));
}
}
QQuickAbstractButton::touchEvent(event);
diff --git a/src/quicktemplates2/qquickswitchdelegate.cpp b/src/quicktemplates2/qquickswitchdelegate.cpp
index d0e3afc8..3300e252 100644
--- a/src/quicktemplates2/qquickswitchdelegate.cpp
+++ b/src/quicktemplates2/qquickswitchdelegate.cpp
@@ -177,7 +177,7 @@ void QQuickSwitchDelegate::mouseMoveEvent(QMouseEvent *event)
{
Q_D(QQuickSwitchDelegate);
if (!keepMouseGrab()) {
- const QPointF movePoint = event->localPos();
+ const QPointF movePoint = event->position();
if (d->canDrag(movePoint))
setKeepMouseGrab(QQuickWindowPrivate::dragOverThreshold(movePoint.x() - d->pressPoint.x(), Qt::XAxis, event));
}
@@ -192,8 +192,8 @@ void QQuickSwitchDelegate::touchEvent(QTouchEvent *event)
for (const QTouchEvent::TouchPoint &point : event->touchPoints()) {
if (point.id() != d->touchId || point.state() != Qt::TouchPointMoved)
continue;
- if (d->canDrag(point.pos()))
- setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.pos().x() - d->pressPoint.x(), Qt::XAxis, &point));
+ if (d->canDrag(point.position()))
+ setKeepTouchGrab(QQuickWindowPrivate::dragOverThreshold(point.position().x() - d->pressPoint.x(), Qt::XAxis, &point));
}
}
QQuickItemDelegate::touchEvent(event);
diff --git a/src/quicktemplates2/qquicktabbar.cpp b/src/quicktemplates2/qquicktabbar.cpp
index c90ff674..b38699df 100644
--- a/src/quicktemplates2/qquicktabbar.cpp
+++ b/src/quicktemplates2/qquicktabbar.cpp
@@ -158,7 +158,7 @@ void QQuickTabBarPrivate::updateLayout()
qreal reservedWidth = 0;
int resizableCount = 0;
- QVector<QQuickItem *> allItems;
+ QList<QQuickItem *> allItems;
allItems.reserve(count);
for (int i = 0; i < count; ++i) {
diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp
index 0dcebb40..c8e61094 100644
--- a/src/quicktemplates2/qquicktextfield.cpp
+++ b/src/quicktemplates2/qquicktextfield.cpp
@@ -309,7 +309,7 @@ void QQuickTextFieldPrivate::echoModeChanged(QQuickTextField::EchoMode echoMode)
if (QQuickAccessibleAttached *accessibleAttached = QQuickControlPrivate::accessibleAttached(q_func()))
accessibleAttached->set_passwordEdit((echoMode == QQuickTextField::Password || echoMode == QQuickTextField::PasswordEchoOnEdit) ? true : false);
#else
- Q_UNUSED(echoMode)
+ Q_UNUSED(echoMode);
#endif
}
diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp
index 220facb3..3d9a318d 100644
--- a/tests/auto/accessibility/tst_accessibility.cpp
+++ b/tests/auto/accessibility/tst_accessibility.cpp
@@ -177,8 +177,8 @@ void tst_accessibility::a11y()
QCOMPARE(attached->role(), role);
QCOMPARE(attached->name(), text);
#else
- Q_UNUSED(role)
- Q_UNUSED(text)
+ Q_UNUSED(role);
+ Q_UNUSED(text);
#endif
}
@@ -264,8 +264,8 @@ void tst_accessibility::override()
QCOMPARE(attached->role(), role);
QCOMPARE(attached->name(), name + "Override");
#else
- Q_UNUSED(role)
- Q_UNUSED(text)
+ Q_UNUSED(role);
+ Q_UNUSED(text);
#endif
}
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 64a525bf..7369f263 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -48,10 +48,10 @@
**
****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Window 2.2
-import QtTest 1.0
-import QtQuick.Controls 2.12
+import QtQuick 2.15
+import QtQuick.Window 2.15
+import QtTest 1.15
+import QtQuick.Controls 2.15
TestCase {
id: testCase
@@ -1970,4 +1970,182 @@ TestCase {
compare(comboBox1.currentIndex, 9)
compare(currentIndexSpy.count, 1)
}
+
+ Component {
+ id: appFontTextFieldComponent
+ TextField {
+ objectName: "appFontTextField"
+ font: Qt.application.font
+ // We don't want the background's implicit width to interfere with our tests,
+ // which are about implicit width of the contentItem of ComboBox, which is by default TextField.
+ background: null
+ }
+ }
+
+ Component {
+ id: appFontContentItemComboBoxComponent
+ ComboBox {
+ // Override the contentItem so that the font doesn't vary between styles.
+ contentItem: TextField {
+ objectName: "appFontContentItemTextField"
+ // We do this just to be extra sure that the font never comes from the control,
+ // as we want it to match that of the TextField in the appFontTextFieldComponent.
+ font: Qt.application.font
+ background: null
+ }
+ }
+ }
+
+ Component {
+ id: twoItemListModelComponent
+
+ ListModel {
+ ListElement { display: "Short" }
+ ListElement { display: "Kinda long" }
+ }
+ }
+
+ function appendedToModel(model, item) {
+ if (Array.isArray(model)) {
+ let newModel = model
+ newModel.push(item)
+ return newModel
+ }
+
+ if (model.hasOwnProperty("append")) {
+ model.append({ display: item })
+ // To account for the fact that changes to a JS array are not seen by the QML engine,
+ // we need to reassign the entire model and hence return it. For simplicity in the
+ // calling code, we do it for the ListModel code path too. It should be a no-op.
+ return model
+ }
+
+ console.warn("appendedToModel: unrecognised model")
+ return undefined
+ }
+
+ function removedFromModel(model, index, count) {
+ if (Array.isArray(model)) {
+ let newModel = model
+ newModel.splice(index, count)
+ return newModel
+ }
+
+ if (model.hasOwnProperty("remove")) {
+ model.remove(index, count)
+ return model
+ }
+
+ console.warn("removedFromModel: unrecognised model")
+ return undefined
+ }
+
+ // We don't use a data-driven test for the policy because the checks vary a lot based on which enum we're testing.
+ function test_implicitContentWidthPolicy_ContentItemImplicitWidth() {
+ // Set ContentItemImplicitWidth and ensure that implicitContentWidth is as wide as the current item
+ // by comparing it against the implicitWidth of an identical TextField
+ let control = createTemporaryObject(appFontContentItemComboBoxComponent, testCase, {
+ model: ["Short", "Kinda long"],
+ implicitContentWidthPolicy: ComboBox.ContentItemImplicitWidth
+ })
+ verify(control)
+ compare(control.implicitContentWidthPolicy, ComboBox.ContentItemImplicitWidth)
+
+ let textField = createTemporaryObject(appFontTextFieldComponent, testCase)
+ verify(textField)
+ // Don't set any text on textField because we're not accounting for the widest
+ // text here, so we want to compare it against an empty TextField.
+ compare(control.implicitContentWidth, textField.implicitWidth)
+
+ textField.font.pixelSize *= 2
+ control.font.pixelSize *= 2
+ compare(control.implicitContentWidth, textField.implicitWidth)
+ }
+
+ function test_implicitContentWidthPolicy_WidestText_data() {
+ return [
+ { tag: "Array", model: ["Short", "Kinda long"] },
+ { tag: "ListModel", model: twoItemListModelComponent.createObject(testCase) },
+ ]
+ }
+
+ function test_implicitContentWidthPolicy_WidestText(data) {
+ let control = createTemporaryObject(appFontContentItemComboBoxComponent, testCase, {
+ model: data.model,
+ implicitContentWidthPolicy: ComboBox.WidestText
+ })
+ verify(control)
+ compare(control.implicitContentWidthPolicy, ComboBox.WidestText)
+
+ let textField = createTemporaryObject(appFontTextFieldComponent, testCase)
+ verify(textField)
+ textField.text = "Kinda long"
+ // Note that we don't need to change the current index here, as the implicitContentWidth
+ // is set to the implicitWidth of the TextField within the ComboBox as if it had the largest
+ // text from the model set on it.
+ // We use Math.ceil because TextInput uses qCeil internally, whereas the implicitWidth
+ // binding for TextField does not.
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(textField.implicitWidth))
+
+ // Add a longer item; it should affect the implicit content width.
+ let modifiedModel = appendedToModel(data.model, "Moderately long")
+ control.model = modifiedModel
+ textField.text = "Moderately long"
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(textField.implicitWidth))
+
+ // Remove the last two items; it should use the only remaining item's width.
+ modifiedModel = removedFromModel(data.model, 1, 2)
+ control.model = modifiedModel
+ compare(control.count, 1)
+ compare(control.currentText, "Short")
+ textField.text = "Short"
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(textField.implicitWidth))
+
+ // Changes in font should result in the implicitContentWidth being updated.
+ textField.font.pixelSize *= 2
+ // We have to change the contentItem's font size manually since we break the
+ // style's binding to the control's font when we set Qt.application.font to it.
+ control.contentItem.font.pixelSize *= 2
+ control.font.pixelSize *= 2
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(textField.implicitWidth))
+ }
+
+ function test_implicitContentWidthPolicy_WidestTextWhenCompleted_data() {
+ return test_implicitContentWidthPolicy_WidestText_data()
+ }
+
+ function test_implicitContentWidthPolicy_WidestTextWhenCompleted(data) {
+ let control = createTemporaryObject(appFontContentItemComboBoxComponent, testCase, {
+ model: data.model,
+ implicitContentWidthPolicy: ComboBox.WidestTextWhenCompleted
+ })
+ verify(control)
+ compare(control.implicitContentWidthPolicy, ComboBox.WidestTextWhenCompleted)
+
+ let textField = createTemporaryObject(appFontTextFieldComponent, testCase)
+ verify(textField)
+ textField.text = "Kinda long"
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(textField.implicitWidth))
+
+ // Add a longer item; it should not affect the implicit content width
+ // since we've already accounted for it once.
+ let modifiedModel = appendedToModel(data.model, "Moderately long")
+ control.model = modifiedModel
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(textField.implicitWidth))
+
+ // Remove the last two items; it should still not affect the implicit content width.
+ modifiedModel = removedFromModel(data.model, 1, 2)
+ control.model = modifiedModel
+ compare(control.count, 1)
+ compare(control.currentText, "Short")
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(textField.implicitWidth))
+
+ // Changes in font should not result in the implicitContentWidth being updated.
+ let oldTextFieldImplicitWidth = textField.implicitWidth
+ // Changes in font should result in the implicitContentWidth being updated.
+ textField.font.pixelSize *= 2
+ control.contentItem.font.pixelSize *= 2
+ control.font.pixelSize *= 2
+ compare(Math.ceil(control.implicitContentWidth), Math.ceil(oldTextFieldImplicitWidth))
+ }
}
diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml
index 71d6f2d7..0c6ab78a 100644
--- a/tests/auto/controls/data/tst_popup.qml
+++ b/tests/auto/controls/data/tst_popup.qml
@@ -1062,8 +1062,8 @@ TestCase {
function findOverlay(window, popup) {
var item = popup.contentItem.parent
- var idx = indexOf(window.overlay.children, item)
- return window.overlay.children[idx - 1]
+ var idx = indexOf(window.Overlay.overlay.children, item)
+ return window.Overlay.overlay.children[idx - 1]
}
function test_overlay() {
@@ -1073,42 +1073,41 @@ TestCase {
window.requestActivate()
tryCompare(window, "active", true)
- compare(window.overlay.children.length, 0)
- compare(window.overlay, window.Overlay.overlay)
+ compare(window.Overlay.overlay.children.length, 0)
var firstOverlay = findOverlay(window, window.firstDrawer)
verify(!firstOverlay)
window.firstDrawer.open()
- compare(window.overlay.children.length, 2) // 1 drawer + 1 overlay
+ compare(window.Overlay.overlay.children.length, 2) // 1 drawer + 1 overlay
firstOverlay = findOverlay(window, window.firstDrawer)
verify(firstOverlay)
compare(firstOverlay.z, window.firstDrawer.z)
- compare(indexOf(window.overlay.children, firstOverlay),
- indexOf(window.overlay.children, window.firstDrawer.contentItem.parent) - 1)
+ compare(indexOf(window.Overlay.overlay.children, firstOverlay),
+ indexOf(window.Overlay.overlay.children, window.firstDrawer.contentItem.parent) - 1)
tryCompare(firstOverlay, "opacity", 1.0)
var secondOverlay = findOverlay(window, window.secondDrawer)
verify(!secondOverlay)
window.secondDrawer.open()
- compare(window.overlay.children.length, 4) // 2 drawers + 2 overlays
+ compare(window.Overlay.overlay.children.length, 4) // 2 drawers + 2 overlays
secondOverlay = findOverlay(window, window.secondDrawer)
verify(secondOverlay)
compare(secondOverlay.z, window.secondDrawer.z)
- compare(indexOf(window.overlay.children, secondOverlay),
- indexOf(window.overlay.children, window.secondDrawer.contentItem.parent) - 1)
+ compare(indexOf(window.Overlay.overlay.children, secondOverlay),
+ indexOf(window.Overlay.overlay.children, window.secondDrawer.contentItem.parent) - 1)
tryCompare(secondOverlay, "opacity", 1.0)
window.firstDrawer.close()
tryCompare(window.firstDrawer, "visible", false)
firstOverlay = findOverlay(window, window.firstDrawer)
verify(!firstOverlay)
- compare(window.overlay.children.length, 2) // 1 drawer + 1 overlay
+ compare(window.Overlay.overlay.children.length, 2) // 1 drawer + 1 overlay
window.secondDrawer.close()
tryCompare(window.secondDrawer, "visible", false)
secondOverlay = findOverlay(window, window.secondDrawer)
verify(!secondOverlay)
- compare(window.overlay.children.length, 0)
+ compare(window.Overlay.overlay.children.length, 0)
var modalOverlay = findOverlay(window, window.modalPopup)
verify(!modalOverlay)
@@ -1118,7 +1117,7 @@ TestCase {
compare(modalOverlay.z, window.modalPopup.z)
compare(window.modalPopup.visible, true)
tryCompare(modalOverlay, "opacity", 1.0)
- compare(window.overlay.children.length, 2) // 1 popup + 1 overlay
+ compare(window.Overlay.overlay.children.length, 2) // 1 popup + 1 overlay
var modelessOverlay = findOverlay(window, window.modelessPopup)
verify(!modelessOverlay)
@@ -1128,13 +1127,13 @@ TestCase {
compare(modelessOverlay.z, window.modelessPopup.z)
compare(window.modelessPopup.visible, true)
tryCompare(modelessOverlay, "opacity", 1.0)
- compare(window.overlay.children.length, 4) // 2 popups + 2 overlays
+ compare(window.Overlay.overlay.children.length, 4) // 2 popups + 2 overlays
window.modelessPopup.close()
tryCompare(window.modelessPopup, "visible", false)
modelessOverlay = findOverlay(window, window.modelessPopup)
verify(!modelessOverlay)
- compare(window.overlay.children.length, 2) // 1 popup + 1 overlay
+ compare(window.Overlay.overlay.children.length, 2) // 1 popup + 1 overlay
compare(window.modalPopup.visible, true)
compare(modalOverlay.opacity, 1.0)
@@ -1143,29 +1142,29 @@ TestCase {
tryCompare(window.modalPopup, "visible", false)
modalOverlay = findOverlay(window, window.modalPopup)
verify(!modalOverlay)
- compare(window.overlay.children.length, 0)
+ compare(window.Overlay.overlay.children.length, 0)
window.plainPopup.open()
tryCompare(window.plainPopup, "visible", true)
- compare(window.overlay.children.length, 1) // only popup added, no overlays involved
+ compare(window.Overlay.overlay.children.length, 1) // only popup added, no overlays involved
window.plainPopup.modal = true
- compare(window.overlay.children.length, 2) // overlay added
+ compare(window.Overlay.overlay.children.length, 2) // overlay added
window.plainPopup.close()
tryCompare(window.plainPopup, "visible", false)
- compare(window.overlay.children.length, 0) // popup + overlay removed
+ compare(window.Overlay.overlay.children.length, 0) // popup + overlay removed
window.modalPopupWithoutDim.open()
tryCompare(window.modalPopupWithoutDim, "visible", true)
- compare(window.overlay.children.length, 1) // only popup added, no overlays involved
+ compare(window.Overlay.overlay.children.length, 1) // only popup added, no overlays involved
window.modalPopupWithoutDim.dim = true
- compare(window.overlay.children.length, 2) // overlay added
+ compare(window.Overlay.overlay.children.length, 2) // overlay added
window.modalPopupWithoutDim.close()
tryCompare(window.modalPopupWithoutDim, "visible", false)
- compare(window.overlay.children.length, 0) // popup + overlay removed
+ compare(window.Overlay.overlay.children.length, 0) // popup + overlay removed
}
function test_attached_applicationwindow() {
diff --git a/tests/auto/cursor/tst_cursor.cpp b/tests/auto/cursor/tst_cursor.cpp
index 2491a972..ed5db5b1 100644
--- a/tests/auto/cursor/tst_cursor.cpp
+++ b/tests/auto/cursor/tst_cursor.cpp
@@ -182,6 +182,7 @@ void tst_cursor::scrollBar()
// Ensure that the mouse cursor has the correct shape when over a scrollbar
// which is itself over a text area with IBeamCursor.
QQuickApplicationHelper helper(this, QStringLiteral("scrollbar.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
diff --git a/tests/auto/designer/tst_designer.cpp b/tests/auto/designer/tst_designer.cpp
index 2c67c2c6..0d8bc73b 100644
--- a/tests/auto/designer/tst_designer.cpp
+++ b/tests/auto/designer/tst_designer.cpp
@@ -101,7 +101,7 @@ void tst_Designer::test_controls()
"Item {\n");
QByteArray source = before;
- source.append(type);
+ source.append(type.toUtf8());
const QByteArray after(" {"
"}\n"
diff --git a/tests/auto/focus/tst_focus.cpp b/tests/auto/focus/tst_focus.cpp
index 8a1b36ad..b1b23244 100644
--- a/tests/auto/focus/tst_focus.cpp
+++ b/tests/auto/focus/tst_focus.cpp
@@ -43,8 +43,8 @@
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuickTemplates2/private/qquickcontrol_p.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpointingdevice.h>
#include <QtGui/qstylehints.h>
-#include <QtGui/qtouchdevice.h>
#include "../shared/util.h"
#include "../shared/visualtestutil.h"
@@ -159,18 +159,7 @@ void tst_focus::policy()
window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
- struct TouchDeviceDeleter
- {
- static inline void cleanup(QTouchDevice *device)
- {
- QWindowSystemInterface::unregisterTouchDevice(device);
- delete device;
- }
- };
-
- QScopedPointer<QTouchDevice, TouchDeviceDeleter> device(new QTouchDevice);
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device.data());
+ QScopedPointer<QPointingDevice> device(QTest::createTouchDevice());
control->setFocusPolicy(Qt::NoFocus);
QCOMPARE(control->focusPolicy(), Qt::NoFocus);
@@ -366,18 +355,7 @@ void tst_focus::scope()
window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window.data()));
- struct TouchDeviceDeleter
- {
- static inline void cleanup(QTouchDevice *device)
- {
- QWindowSystemInterface::unregisterTouchDevice(device);
- delete device;
- }
- };
-
- QScopedPointer<QTouchDevice, TouchDeviceDeleter> device(new QTouchDevice);
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device.data());
+ QScopedPointer<QPointingDevice> device(QTest::createTouchDevice());
child->forceActiveFocus();
QVERIFY(child->hasActiveFocus());
diff --git a/tests/auto/platform/data/tst_menuitem.qml b/tests/auto/platform/data/tst_menuitem.qml
index 29d369bc..316af97d 100644
--- a/tests/auto/platform/data/tst_menuitem.qml
+++ b/tests/auto/platform/data/tst_menuitem.qml
@@ -68,8 +68,9 @@ TestCase {
}
}
- SignalSpy {
- id: spy
+ Component {
+ id: signalSpyComponent
+ SignalSpy {}
}
function test_properties_data() {
@@ -81,30 +82,32 @@ TestCase {
{tag: "checked", signal: "checkedChanged", init: false, value: true},
{tag: "role", signal: "roleChanged", init: MenuItem.TextHeuristicRole, value: MenuItem.AboutRole},
{tag: "text", signal: "textChanged", init: "", value: "text"},
- {tag: "iconSource", signal: "iconSourceChanged", init: "", value: "qrc:/undo.png"},
- {tag: "iconName", signal: "iconNameChanged", init: "", value: "edit-undo"},
+ {tag: "icon.source", signal: "iconChanged", init: "", value: "qrc:/undo.png"},
+ {tag: "icon.name", signal: "iconChanged", init: "", value: "edit-undo"},
{tag: "shortcut", signal: "shortcutChanged", init: undefined, value: StandardKey.Undo}
]
}
function test_properties(data) {
- var item = menuItem.createObject(testCase)
+ let item = createTemporaryObject(menuItem, testCase)
verify(item)
- spy.target = item
- spy.signalName = data.signal
+ let groupedProperty = data.tag.indexOf(".") !== -1
+ let spy = createTemporaryObject(signalSpyComponent, testCase, {
+ target: item, signalName: data.signal
+ })
+ verify(spy)
verify(spy.valid)
- compare(item[data.tag], data.init)
- item[data.tag] = data.value
+ let propertyName = groupedProperty ? data.tag.split('.')[1] : data.tag
+ let object = !groupedProperty ? item : item.icon
+ compare(object[propertyName], data.init)
+ object[propertyName] = data.value
compare(spy.count, 1)
- compare(item[data.tag], data.value)
+ compare(object[propertyName], data.value)
- item[data.tag] = data.value
+ object[propertyName] = data.value
compare(spy.count, 1)
-
- spy.clear()
- item.destroy()
}
function test_role() {
diff --git a/tests/auto/platform/data/tst_systemtrayicon.qml b/tests/auto/platform/data/tst_systemtrayicon.qml
index ce7d8b8d..d7a63551 100644
--- a/tests/auto/platform/data/tst_systemtrayicon.qml
+++ b/tests/auto/platform/data/tst_systemtrayicon.qml
@@ -61,44 +61,48 @@ TestCase {
name: "SystemTrayIcon"
Component {
- id: systemTrayIcon
+ id: systemTrayIconComponent
// Check that icon.name can be used in this Qt.labs.platform version
SystemTrayIcon {
icon.name: ""
}
}
- SignalSpy {
- id: spy
+ Component {
+ id: signalSpyComponent
+ SignalSpy {}
}
function test_properties_data() {
return [
{tag: "visible", signal: "visibleChanged", init: false, value: true},
- {tag: "iconSource", signal: "iconSourceChanged", init: "", value: "qrc:/tray.png"},
- {tag: "iconName", signal: "iconNameChanged", init: "", value: "icon-name"},
+ {tag: "icon.source", signal: "iconChanged", init: "", value: "qrc:/tray.png"},
+ {tag: "icon.name", signal: "iconChanged", init: "", value: "icon-name"},
{tag: "tooltip", signal: "tooltipChanged", init: "", value: "tooltip"},
]
}
function test_properties(data) {
- var icon = systemTrayIcon.createObject(testCase)
+ let icon = createTemporaryObject(systemTrayIconComponent, testCase)
verify(icon)
- spy.target = icon
- spy.signalName = data.signal
+ let groupedProperty = data.tag.indexOf(".") !== -1
+ let spy = createTemporaryObject(signalSpyComponent, testCase, {
+ target: icon, signalName: data.signal
+ })
+ verify(spy)
verify(spy.valid)
- compare(icon[data.tag], data.init)
- icon[data.tag] = data.value
- compare(spy.count, 1)
- compare(icon[data.tag], data.value)
+ let propertyName = groupedProperty ? data.tag.split('.')[1] : data.tag
+ let object = !groupedProperty ? icon : icon.icon
+ compare(object[propertyName], data.init)
- icon[data.tag] = data.value
+ object[propertyName] = data.value
compare(spy.count, 1)
+ compare(object[propertyName], data.value)
- spy.clear()
- icon.destroy()
+ object[propertyName] = data.value
+ compare(spy.count, 1)
}
function test_messageIcon() {
@@ -119,17 +123,17 @@ TestCase {
}
function test_activated() {
- var icon = systemTrayIcon.createObject(testCase)
+ let icon = createTemporaryObject(systemTrayIconComponent, testCase)
verify(icon)
- spy.target = icon
- spy.signalName = "activated"
+ let spy = createTemporaryObject(signalSpyComponent, testCase, {
+ target: icon, signalName: "activated"
+ })
+ verify(spy)
+ verify(spy.valid)
icon.activated(SystemTrayIcon.Trigger)
compare(spy.count, 1)
compare(spy.signalArguments[0][0], SystemTrayIcon.Trigger)
-
- spy.clear()
- icon.destroy()
}
}
diff --git a/tests/auto/qquickapplicationwindow/data/attachedProperties.qml b/tests/auto/qquickapplicationwindow/data/attachedProperties.qml
index 53a139c1..fdb349ce 100644
--- a/tests/auto/qquickapplicationwindow/data/attachedProperties.qml
+++ b/tests/auto/qquickapplicationwindow/data/attachedProperties.qml
@@ -65,7 +65,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
Item {
@@ -76,7 +75,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
QtObject {
@@ -87,7 +85,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
property alias childWindow: childWindow
@@ -103,7 +100,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
Control {
id: childWindowControl
@@ -113,7 +109,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
Item {
@@ -124,7 +119,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
QtObject {
@@ -135,7 +129,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
}
@@ -152,7 +145,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
Control {
id: childAppWindowControl
@@ -162,7 +154,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
Item {
@@ -173,7 +164,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
QtObject {
@@ -184,7 +174,6 @@ ApplicationWindow {
property Item attached_activeFocusControl: ApplicationWindow.activeFocusControl
property Item attached_header: ApplicationWindow.header
property Item attached_footer: ApplicationWindow.footer
- property Item attached_overlay: ApplicationWindow.overlay
}
}
}
diff --git a/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp b/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
index b907f5c3..baaa3503 100644
--- a/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
+++ b/tests/auto/qquickapplicationwindow/tst_qquickapplicationwindow.cpp
@@ -287,7 +287,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), window->activeFocusControl());
QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), window->header());
QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), window->footer());
- QCOMPARE(childControl->property("attached_overlay").value<QQuickItem *>(), window->overlay());
QQuickItem *childItem = object->property("childItem").value<QQuickItem *>();
QVERIFY(childItem);
@@ -296,7 +295,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QCOMPARE(childItem->property("attached_activeFocusControl").value<QQuickItem *>(), window->activeFocusControl());
QCOMPARE(childItem->property("attached_header").value<QQuickItem *>(), window->header());
QCOMPARE(childItem->property("attached_footer").value<QQuickItem *>(), window->footer());
- QCOMPARE(childItem->property("attached_overlay").value<QQuickItem *>(), window->overlay());
QObject *childObject = object->property("childObject").value<QObject *>();
QVERIFY(childObject);
@@ -305,7 +303,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childObject->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childObject->property("attached_header").value<QQuickItem *>());
QVERIFY(!childObject->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childObject->property("attached_overlay").value<QQuickItem *>());
QQuickWindow *childWindow = object->property("childWindow").value<QQuickWindow *>();
QVERIFY(childWindow);
@@ -314,7 +311,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childWindow->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childWindow->property("attached_header").value<QQuickItem *>());
QVERIFY(!childWindow->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childWindow->property("attached_overlay").value<QQuickItem *>());
QQuickItem *childWindowControl = object->property("childWindowControl").value<QQuickItem *>();
QVERIFY(childWindowControl);
@@ -323,7 +319,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childWindowControl->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childWindowControl->property("attached_header").value<QQuickItem *>());
QVERIFY(!childWindowControl->property("attached_footer").value<QQuickItem *>());
- QCOMPARE(childWindowControl->property("attached_overlay").value<QQuickItem *>(), QQuickOverlay::overlay(childWindow));
QQuickItem *childWindowItem = object->property("childWindowItem").value<QQuickItem *>();
QVERIFY(childWindowItem);
@@ -332,7 +327,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childWindowItem->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childWindowItem->property("attached_header").value<QQuickItem *>());
QVERIFY(!childWindowItem->property("attached_footer").value<QQuickItem *>());
- QCOMPARE(childWindowItem->property("attached_overlay").value<QQuickItem *>(), QQuickOverlay::overlay(childWindow));
QObject *childWindowObject = object->property("childWindowObject").value<QObject *>();
QVERIFY(childWindowObject);
@@ -341,7 +335,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childWindowObject->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childWindowObject->property("attached_header").value<QQuickItem *>());
QVERIFY(!childWindowObject->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childWindowObject->property("attached_overlay").value<QQuickItem *>());
QQuickApplicationWindow *childAppWindow = object->property("childAppWindow").value<QQuickApplicationWindow *>();
QVERIFY(childAppWindow);
@@ -350,7 +343,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childAppWindow->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childAppWindow->property("attached_header").value<QQuickItem *>());
QVERIFY(!childAppWindow->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childAppWindow->property("attached_overlay").value<QQuickItem *>());
QQuickItem *childAppWindowControl = object->property("childAppWindowControl").value<QQuickItem *>();
QVERIFY(childAppWindowControl);
@@ -359,7 +351,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QCOMPARE(childAppWindowControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindow->activeFocusControl());
QCOMPARE(childAppWindowControl->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
QCOMPARE(childAppWindowControl->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
- QCOMPARE(childAppWindowControl->property("attached_overlay").value<QQuickItem *>(), childAppWindow->overlay());
QQuickItem *childAppWindowItem = object->property("childAppWindowItem").value<QQuickItem *>();
QVERIFY(childAppWindowItem);
@@ -368,7 +359,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QCOMPARE(childAppWindowItem->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindow->activeFocusControl());
QCOMPARE(childAppWindowItem->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
QCOMPARE(childAppWindowItem->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
- QCOMPARE(childAppWindowItem->property("attached_overlay").value<QQuickItem *>(), childAppWindow->overlay());
QObject *childAppWindowObject = object->property("childAppWindowObject").value<QObject *>();
QVERIFY(childAppWindowObject);
@@ -377,7 +367,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childAppWindowObject->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childAppWindowObject->property("attached_header").value<QQuickItem *>());
QVERIFY(!childAppWindowObject->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childAppWindowObject->property("attached_overlay").value<QQuickItem *>());
window->show();
window->requestActivate();
@@ -416,7 +405,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QCOMPARE(childControl->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
QCOMPARE(childControl->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
QCOMPARE(childControl->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
- QCOMPARE(childControl->property("attached_overlay").value<QQuickItem *>(), childAppWindow->overlay());
childItem->setParentItem(childAppWindow->contentItem());
QCOMPARE(childItem->window(), childAppWindow);
@@ -425,7 +413,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QCOMPARE(childItem->property("attached_activeFocusControl").value<QQuickItem *>(), childAppWindowControl);
QCOMPARE(childItem->property("attached_header").value<QQuickItem *>(), childAppWindow->header());
QCOMPARE(childItem->property("attached_footer").value<QQuickItem *>(), childAppWindow->footer());
- QCOMPARE(childItem->property("attached_overlay").value<QQuickItem *>(), childAppWindow->overlay());
childControl->setParentItem(nullptr);
QVERIFY(!childControl->window());
@@ -434,7 +421,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childControl->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_overlay").value<QQuickItem *>());
childItem->setParentItem(nullptr);
QVERIFY(!childItem->window());
@@ -443,7 +429,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childItem->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childItem->property("attached_header").value<QQuickItem *>());
QVERIFY(!childItem->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_overlay").value<QQuickItem *>());
childAppWindow->close();
qApp->processEvents();
@@ -464,7 +449,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
- QCOMPARE(childControl->property("attached_overlay").value<QQuickItem *>(), QQuickOverlay::overlay(childWindow));
childItem->setParentItem(childWindow->contentItem());
QCOMPARE(childItem->window(), childWindow);
@@ -473,7 +457,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childControl->property("attached_contentItem").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
- QCOMPARE(childControl->property("attached_overlay").value<QQuickItem *>(), QQuickOverlay::overlay(childWindow));
childControl->setParentItem(nullptr);
QVERIFY(!childControl->window());
@@ -482,7 +465,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childControl->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_header").value<QQuickItem *>());
QVERIFY(!childControl->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childControl->property("attached_overlay").value<QQuickItem *>());
childItem->setParentItem(nullptr);
QVERIFY(!childItem->window());
@@ -491,7 +473,6 @@ void tst_QQuickApplicationWindow::attachedProperties()
QVERIFY(!childItem->property("attached_activeFocusControl").value<QQuickItem *>());
QVERIFY(!childItem->property("attached_header").value<QQuickItem *>());
QVERIFY(!childItem->property("attached_footer").value<QQuickItem *>());
- QVERIFY(!childItem->property("attached_overlay").value<QQuickItem *>());
childWindow->close();
}
diff --git a/tests/auto/qquickcontrol/tst_qquickcontrol.cpp b/tests/auto/qquickcontrol/tst_qquickcontrol.cpp
index c8d34756..6acb192f 100644
--- a/tests/auto/qquickcontrol/tst_qquickcontrol.cpp
+++ b/tests/auto/qquickcontrol/tst_qquickcontrol.cpp
@@ -53,16 +53,7 @@ private slots:
void flickable();
private:
- struct TouchDeviceDeleter
- {
- static inline void cleanup(QTouchDevice *device)
- {
- QWindowSystemInterface::unregisterTouchDevice(device);
- delete device;
- }
- };
-
- QScopedPointer<QTouchDevice, TouchDeviceDeleter> touchDevice;
+ QScopedPointer<QPointingDevice> touchDevice;
};
@@ -71,9 +62,7 @@ void tst_QQuickControl::initTestCase()
QQmlDataTest::initTestCase();
qputenv("QML_NO_TOUCH_COMPRESSION", "1");
- touchDevice.reset(new QTouchDevice);
- touchDevice->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(touchDevice.data());
+ touchDevice.reset(QTest::createTouchDevice());
}
void tst_QQuickControl::flickable()
diff --git a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
index 7644cacf..c96b156c 100644
--- a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
+++ b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
@@ -40,8 +40,8 @@
#include "../shared/visualtestutil.h"
#include "../shared/qtest_quickcontrols.h"
+#include <QtGui/qpointingdevice.h>
#include <QtGui/qstylehints.h>
-#include <QtGui/qtouchdevice.h>
#include <QtGui/qguiapplication.h>
#include <QtGui/qpa/qwindowsysteminterface.h>
#include <QtQuick/private/qquickwindow_p.h>
@@ -112,16 +112,7 @@ private slots:
void topEdgeScreenEdge();
private:
- struct TouchDeviceDeleter
- {
- static inline void cleanup(QTouchDevice *device)
- {
- QWindowSystemInterface::unregisterTouchDevice(device);
- delete device;
- }
- };
-
- QScopedPointer<QTouchDevice, TouchDeviceDeleter> touchDevice;
+ QScopedPointer<QPointingDevice> touchDevice;
};
@@ -130,9 +121,7 @@ void tst_QQuickDrawer::initTestCase()
QQmlDataTest::initTestCase();
qputenv("QML_NO_TOUCH_COMPRESSION", "1");
- touchDevice.reset(new QTouchDevice);
- touchDevice->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(touchDevice.data());
+ touchDevice.reset(QTest::createTouchDevice());
}
void tst_QQuickDrawer::defaults()
@@ -180,6 +169,7 @@ void tst_QQuickDrawer::visible()
{
QFETCH(QString, source);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -220,6 +210,7 @@ void tst_QQuickDrawer::visible()
void tst_QQuickDrawer::state()
{
QQuickApplicationHelper helper(this, "applicationwindow.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -340,6 +331,7 @@ void tst_QQuickDrawer::position()
QFETCH(qreal, position);
QQuickApplicationHelper helper(this, QStringLiteral("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -387,6 +379,7 @@ void tst_QQuickDrawer::dragMargin()
QFETCH(qreal, dragFromRight);
QQuickApplicationHelper helper(this, QStringLiteral("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -433,6 +426,7 @@ static QRectF geometry(const QQuickItem *item)
void tst_QQuickDrawer::reposition()
{
QQuickApplicationHelper helper(this, QStringLiteral("reposition.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -491,6 +485,7 @@ void tst_QQuickDrawer::reposition()
void tst_QQuickDrawer::header()
{
QQuickApplicationHelper helper(this, QStringLiteral("header.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -545,6 +540,7 @@ void tst_QQuickDrawer::hover()
QFETCH(bool, modal);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
window->requestActivate();
@@ -628,6 +624,7 @@ void tst_QQuickDrawer::wheel()
QFETCH(bool, modal);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -690,6 +687,7 @@ void tst_QQuickDrawer::wheel()
void tst_QQuickDrawer::multiple()
{
QQuickApplicationHelper helper(this, QStringLiteral("multiple.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -834,6 +832,7 @@ void tst_QQuickDrawer::touch()
QFETCH(QPoint, to);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -868,6 +867,7 @@ void tst_QQuickDrawer::touch()
void tst_QQuickDrawer::multiTouch()
{
QQuickApplicationHelper helper(this, QStringLiteral("multiTouch.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -981,6 +981,7 @@ void tst_QQuickDrawer::multiTouch()
void tst_QQuickDrawer::grabber()
{
QQuickApplicationHelper helper(this, QStringLiteral("grabber.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -1025,6 +1026,7 @@ void tst_QQuickDrawer::interactive()
{
QFETCH(QString, source);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1087,6 +1089,7 @@ void tst_QQuickDrawer::flickable()
QFETCH(QPoint, to);
QQuickApplicationHelper helper(this, QStringLiteral("flickable.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -1143,6 +1146,7 @@ void tst_QQuickDrawer::dragOverModalShadow()
QFETCH(bool, mouse);
QQuickApplicationHelper helper(this, QStringLiteral("dragOverModalShadow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1199,6 +1203,7 @@ void tst_QQuickDrawer::nonModal()
QFETCH(bool, mouse);
QQuickApplicationHelper helper(this, QStringLiteral("window.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1282,6 +1287,7 @@ void tst_QQuickDrawer::slider()
QFETCH(int, delta);
QQuickApplicationHelper helper(this, QStringLiteral("slider.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1325,6 +1331,7 @@ void tst_QQuickDrawer::slider()
void tst_QQuickDrawer::topEdgeScreenEdge()
{
QQuickApplicationHelper helper(this, QStringLiteral("topEdgeScreenEdge.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
diff --git a/tests/auto/qquickheaderview/tst_qquickheaderview.cpp b/tests/auto/qquickheaderview/tst_qquickheaderview.cpp
index 611e39cb..d8d71183 100644
--- a/tests/auto/qquickheaderview/tst_qquickheaderview.cpp
+++ b/tests/auto/qquickheaderview/tst_qquickheaderview.cpp
@@ -203,7 +203,7 @@ public:
}
private:
- QVector<QVariant> hData, vData;
+ QList<QVariant> hData, vData;
};
class tst_QQuickHeaderView : public QQmlDataTest {
diff --git a/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp b/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp
index 0ecc95c5..7a1cb259 100644
--- a/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp
+++ b/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
-#include <QtCore/qvector.h>
+#include <QtCore/qlist.h>
#include <qtest.h>
@@ -64,13 +64,13 @@ tst_qquickiconlabel::tst_qquickiconlabel()
void tst_qquickiconlabel::display_data()
{
- QTest::addColumn<QVector<QQuickIconLabel::Display> >("displayTypes");
+ QTest::addColumn<QList<QQuickIconLabel::Display> >("displayTypes");
QTest::addColumn<bool>("mirrored");
QTest::addColumn<qreal>("labelWidth");
QTest::addColumn<qreal>("labelHeight");
QTest::addColumn<qreal>("spacing");
- typedef QVector<QQuickIconLabel::Display> DisplayVector;
+ typedef QList<QQuickIconLabel::Display> DisplayVector;
QQuickIconLabel::Display IconOnly = QQuickIconLabel::IconOnly;
QQuickIconLabel::Display TextOnly = QQuickIconLabel::TextOnly;
QQuickIconLabel::Display TextUnderIcon = QQuickIconLabel::TextUnderIcon;
@@ -108,7 +108,7 @@ void tst_qquickiconlabel::display_data()
void tst_qquickiconlabel::display()
{
- QFETCH(QVector<QQuickIconLabel::Display>, displayTypes);
+ QFETCH(QList<QQuickIconLabel::Display>, displayTypes);
QFETCH(bool, mirrored);
QFETCH(qreal, labelWidth);
QFETCH(qreal, labelHeight);
diff --git a/tests/auto/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp b/tests/auto/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp
index 72136445..7612b99b 100644
--- a/tests/auto/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp
+++ b/tests/auto/qquickmaterialstyleconf/tst_qquickmaterialstyleconf.cpp
@@ -57,6 +57,7 @@ private slots:
void tst_qquickmaterialstyleconf::conf()
{
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QFont customFont;
customFont.setFamily("Courier");
@@ -101,6 +102,7 @@ void tst_qquickmaterialstyleconf::variants()
qputenv("QT_QUICK_CONTROLS_CONF", confPath);
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
diff --git a/tests/auto/qquickmenu/data/applicationwindow.qml b/tests/auto/qquickmenu/data/applicationwindow.qml
index 986853e4..13f14d2d 100644
--- a/tests/auto/qquickmenu/data/applicationwindow.qml
+++ b/tests/auto/qquickmenu/data/applicationwindow.qml
@@ -59,6 +59,7 @@ ApplicationWindow {
property alias emptyMenu: emptyMenu
property alias menu: menu
property alias menuButton: menuButton
+ property Overlay overlay: menu.Overlay.overlay
Menu {
id: emptyMenu
diff --git a/tests/auto/qquickmenu/tst_qquickmenu.cpp b/tests/auto/qquickmenu/tst_qquickmenu.cpp
index 54a5d9f4..a06b715f 100644
--- a/tests/auto/qquickmenu/tst_qquickmenu.cpp
+++ b/tests/auto/qquickmenu/tst_qquickmenu.cpp
@@ -106,6 +106,7 @@ private slots:
void tst_QQuickMenu::defaults()
{
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickMenu *emptyMenu = helper.appWindow->property("emptyMenu").value<QQuickMenu*>();
QCOMPARE(emptyMenu->isVisible(), false);
@@ -117,6 +118,7 @@ void tst_QQuickMenu::defaults()
void tst_QQuickMenu::count()
{
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickMenu *menu = helper.window->property("emptyMenu").value<QQuickMenu*>();
QVERIFY(menu);
@@ -149,6 +151,7 @@ void tst_QQuickMenu::mouse()
QSKIP("Mouse hovering not functional on offscreen/minimal platforms");
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -157,9 +160,12 @@ void tst_QQuickMenu::mouse()
QVERIFY(QTest::qWaitForWindowActive(window));
QQuickMenu *menu = window->property("menu").value<QQuickMenu*>();
+ QVERIFY(menu);
menu->open();
QVERIFY(menu->isVisible());
- QVERIFY(window->overlay()->childItems().contains(menu->contentItem()->parentItem()));
+ QQuickOverlay *overlay = window->property("overlay").value<QQuickOverlay*>();
+ QVERIFY(overlay);
+ QVERIFY(overlay->childItems().contains(menu->contentItem()->parentItem()));
QTRY_VERIFY(menu->isOpened());
QQuickItem *firstItem = menu->itemAt(0);
@@ -182,14 +188,14 @@ void tst_QQuickMenu::mouse()
QCOMPARE(triggeredSpy.count(), 1);
QTRY_COMPARE(visibleSpy.count(), 1);
QVERIFY(!menu->isVisible());
- QVERIFY(!window->overlay()->childItems().contains(menu->contentItem()));
+ QVERIFY(!overlay->childItems().contains(menu->contentItem()));
QCOMPARE(menu->currentIndex(), -1);
QCOMPARE(menu->contentItem()->property("currentIndex"), QVariant(-1));
menu->open();
QCOMPARE(visibleSpy.count(), 2);
QVERIFY(menu->isVisible());
- QVERIFY(window->overlay()->childItems().contains(menu->contentItem()->parentItem()));
+ QVERIFY(overlay->childItems().contains(menu->contentItem()->parentItem()));
QTRY_VERIFY(menu->isOpened());
// Ensure that we have enough space to click outside of the menu.
@@ -199,12 +205,12 @@ void tst_QQuickMenu::mouse()
QPoint(menu->contentItem()->width() + 1, menu->contentItem()->height() + 1));
QTRY_COMPARE(visibleSpy.count(), 3);
QVERIFY(!menu->isVisible());
- QVERIFY(!window->overlay()->childItems().contains(menu->contentItem()->parentItem()));
+ QVERIFY(!overlay->childItems().contains(menu->contentItem()->parentItem()));
menu->open();
QCOMPARE(visibleSpy.count(), 4);
QVERIFY(menu->isVisible());
- QVERIFY(window->overlay()->childItems().contains(menu->contentItem()->parentItem()));
+ QVERIFY(overlay->childItems().contains(menu->contentItem()->parentItem()));
QTRY_VERIFY(menu->isOpened());
// Hover-highlight through the menu items one by one
@@ -237,13 +243,14 @@ void tst_QQuickMenu::mouse()
// QCOMPARE(triggeredSpy.count(), 1);
// QCOMPARE(visibleSpy.count(), 5);
// QVERIFY(!menu->isVisible());
-// QVERIFY(!window->overlay()->childItems().contains(menu->contentItem()));
+// QVERIFY(!overlay->childItems().contains(menu->contentItem()));
// QCOMPARE(menu->contentItem()->property("currentIndex"), QVariant(-1));
}
void tst_QQuickMenu::pressAndHold()
{
QQuickApplicationHelper helper(this, QLatin1String("pressAndHold.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -268,6 +275,7 @@ void tst_QQuickMenu::contextMenuKeyboard()
QSKIP("This platform only allows tab focus for text controls");
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -289,7 +297,9 @@ void tst_QQuickMenu::contextMenuKeyboard()
menu->open();
QCOMPARE(visibleSpy.count(), 1);
QVERIFY(menu->isVisible());
- QVERIFY(window->overlay()->childItems().contains(menu->contentItem()->parentItem()));
+ QQuickOverlay *overlay = window->property("overlay").value<QQuickOverlay*>();
+ QVERIFY(overlay);
+ QVERIFY(overlay->childItems().contains(menu->contentItem()->parentItem()));
QTRY_VERIFY(menu->isOpened());
QVERIFY(!firstItem->hasActiveFocus());
QVERIFY(!firstItem->property("highlighted").toBool());
@@ -322,7 +332,7 @@ void tst_QQuickMenu::contextMenuKeyboard()
QCOMPARE(secondTriggeredSpy.count(), 1);
QTRY_COMPARE(visibleSpy.count(), 2);
QVERIFY(!menu->isVisible());
- QVERIFY(!window->overlay()->childItems().contains(menu->contentItem()));
+ QVERIFY(!overlay->childItems().contains(menu->contentItem()));
QVERIFY(!firstItem->hasActiveFocus());
QVERIFY(!firstItem->hasVisualFocus());
QVERIFY(!firstItem->isHighlighted());
@@ -352,7 +362,7 @@ void tst_QQuickMenu::contextMenuKeyboard()
QCOMPARE(firstTriggeredSpy.count(), 1);
QTRY_COMPARE(visibleSpy.count(), 4);
QVERIFY(!menu->isVisible());
- QVERIFY(!window->overlay()->childItems().contains(menu->contentItem()));
+ QVERIFY(!overlay->childItems().contains(menu->contentItem()));
QVERIFY(!firstItem->hasActiveFocus());
QVERIFY(!firstItem->hasVisualFocus());
QVERIFY(!firstItem->isHighlighted());
@@ -365,7 +375,7 @@ void tst_QQuickMenu::contextMenuKeyboard()
menu->open();
QCOMPARE(visibleSpy.count(), 5);
QVERIFY(menu->isVisible());
- QVERIFY(window->overlay()->childItems().contains(menu->contentItem()->parentItem()));
+ QVERIFY(overlay->childItems().contains(menu->contentItem()->parentItem()));
QTRY_VERIFY(menu->isOpened());
QVERIFY(!firstItem->hasActiveFocus());
QVERIFY(!firstItem->hasVisualFocus());
@@ -451,6 +461,7 @@ void tst_QQuickMenu::disabledMenuItemKeyNavigation()
QSKIP("This platform only allows tab focus for text controls");
QQuickApplicationHelper helper(this, QLatin1String("disabledMenuItemKeyNavigation.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
@@ -515,6 +526,7 @@ void tst_QQuickMenu::mnemonics()
#endif
QQuickApplicationHelper helper(this, QLatin1String("mnemonics.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -562,6 +574,7 @@ void tst_QQuickMenu::menuButton()
QSKIP("This platform only allows tab focus for text controls");
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
@@ -588,6 +601,7 @@ void tst_QQuickMenu::menuButton()
void tst_QQuickMenu::addItem()
{
QQuickApplicationHelper helper(this, QLatin1String("addItem.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -609,6 +623,7 @@ void tst_QQuickMenu::addItem()
void tst_QQuickMenu::menuSeparator()
{
QQuickApplicationHelper helper(this, QLatin1String("menuSeparator.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
centerOnScreen(window);
moveMouseAway(window);
@@ -686,6 +701,7 @@ void tst_QQuickMenu::menuSeparator()
void tst_QQuickMenu::repeater()
{
QQuickApplicationHelper helper(this, QLatin1String("repeater.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -730,6 +746,7 @@ void tst_QQuickMenu::repeater()
void tst_QQuickMenu::order()
{
QQuickApplicationHelper helper(this, QLatin1String("order.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -751,6 +768,7 @@ void tst_QQuickMenu::order()
void tst_QQuickMenu::popup()
{
QQuickApplicationHelper helper(this, QLatin1String("popup.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -907,6 +925,7 @@ void tst_QQuickMenu::popup()
void tst_QQuickMenu::actions()
{
QQuickApplicationHelper helper(this, QLatin1String("actions.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -975,6 +994,7 @@ void tst_QQuickMenu::actions()
void tst_QQuickMenu::removeTakeItem()
{
QQuickApplicationHelper helper(this, QLatin1String("removeTakeItem.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1032,6 +1052,7 @@ void tst_QQuickMenu::subMenuMouse()
QFETCH(bool, cascade);
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1138,6 +1159,7 @@ void tst_QQuickMenu::subMenuDisabledMouse()
QFETCH(bool, cascade);
QQuickApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1200,6 +1222,7 @@ void tst_QQuickMenu::subMenuKeyboard()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1322,6 +1345,7 @@ void tst_QQuickMenu::subMenuDisabledKeyboard()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("subMenuDisabled.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1372,6 +1396,12 @@ void tst_QQuickMenu::subMenuDisabledKeyboard()
QVERIFY(!subMenu->isVisible());
}
+/*
+ QCOMPARE() compares doubles with 1-in-1e12 precision, which is too fine for these tests.
+ Casting to floats, compared with 1-in-1e5 precision, gives more robust results.
+*/
+#define FLOAT_EQ(u, v) QCOMPARE(float(u), float(v))
+
void tst_QQuickMenu::subMenuPosition_data()
{
QTest::addColumn<bool>("cascade");
@@ -1398,6 +1428,7 @@ void tst_QQuickMenu::subMenuPosition()
QFETCH(qreal, overlap);
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
// Ensure that the default size of the window fits three menus side by side.
@@ -1471,19 +1502,20 @@ void tst_QQuickMenu::subMenuPosition()
if (cascade) {
QCOMPARE(subMenu1->parentItem(), subMenu1Item);
// vertically aligned to the parent menu item
- QCOMPARE(subMenu1->popupItem()->y(), mainMenu->popupItem()->y() + subMenu1Item->y());
+ // We cast to float here because we want to use its larger tolerance for equality (because it has less precision than double).
+ FLOAT_EQ(subMenu1->popupItem()->y(), mainMenu->popupItem()->y() + subMenu1Item->y());
if (mirrored) {
// on the left of the parent menu
- QCOMPARE(subMenu1->popupItem()->x(), mainMenu->popupItem()->x() - subMenu1->width() + overlap);
+ FLOAT_EQ(subMenu1->popupItem()->x(), mainMenu->popupItem()->x() - subMenu1->width() + overlap);
} else {
// on the right of the parent menu
- QCOMPARE(subMenu1->popupItem()->x(), mainMenu->popupItem()->x() + mainMenu->width() - overlap);
+ FLOAT_EQ(subMenu1->popupItem()->x(), mainMenu->popupItem()->x() + mainMenu->width() - overlap);
}
} else {
QCOMPARE(subMenu1->parentItem(), mainMenu->parentItem());
// centered over the parent menu
- QCOMPARE(subMenu1->popupItem()->x(), mainMenu->popupItem()->x() + (mainMenu->width() - subMenu1->width()) / 2);
- QCOMPARE(subMenu1->popupItem()->y(), mainMenu->popupItem()->y() + (mainMenu->height() - subMenu1->height()) / 2);
+ FLOAT_EQ(subMenu1->popupItem()->x(), mainMenu->popupItem()->x() + (mainMenu->width() - subMenu1->width()) / 2);
+ FLOAT_EQ(subMenu1->popupItem()->y(), mainMenu->popupItem()->y() + (mainMenu->height() - subMenu1->height()) / 2);
}
// open the sub-sub-menu (can flip)
@@ -1500,25 +1532,28 @@ void tst_QQuickMenu::subMenuPosition()
if (cascade) {
QCOMPARE(subSubMenu1->parentItem(), subSubMenu1Item);
// vertically aligned to the parent menu item
- QCOMPARE(subSubMenu1->popupItem()->y(), subMenu1->popupItem()->y() + subSubMenu1Item->y());
+ FLOAT_EQ(subSubMenu1->popupItem()->y(), subMenu1->popupItem()->y() + subSubMenu1Item->y());
if (mirrored != flip) {
// on the left of the parent menu
- QCOMPARE(subSubMenu1->popupItem()->x(), subMenu1->popupItem()->x() - subSubMenu1->width() + overlap);
+ FLOAT_EQ(subSubMenu1->popupItem()->x(), subMenu1->popupItem()->x() - subSubMenu1->width() + overlap);
} else {
// on the right of the parent menu
- QCOMPARE(subSubMenu1->popupItem()->x(), subMenu1->popupItem()->x() + subMenu1->width() - overlap);
+ FLOAT_EQ(subSubMenu1->popupItem()->x(), subMenu1->popupItem()->x() + subMenu1->width() - overlap);
}
} else {
QCOMPARE(subSubMenu1->parentItem(), subMenu1->parentItem());
// centered over the parent menu
- QCOMPARE(subSubMenu1->popupItem()->x(), subMenu1->popupItem()->x() + (subMenu1->width() - subSubMenu1->width()) / 2);
- QCOMPARE(subSubMenu1->popupItem()->y(), subMenu1->popupItem()->y() + (subMenu1->height() - subSubMenu1->height()) / 2);
+ FLOAT_EQ(subSubMenu1->popupItem()->x(), subMenu1->popupItem()->x() + (subMenu1->width() - subSubMenu1->width()) / 2);
+ FLOAT_EQ(subSubMenu1->popupItem()->y(), subMenu1->popupItem()->y() + (subMenu1->height() - subSubMenu1->height()) / 2);
}
}
+#undef FLOAT_EQ
+
void tst_QQuickMenu::addRemoveSubMenus()
{
QQuickApplicationHelper helper(this, QLatin1String("subMenus.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1590,6 +1625,7 @@ void tst_QQuickMenu::scrollable()
QFETCH(QString, qmlFilePath);
QQuickApplicationHelper helper(this, qmlFilePath);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1629,6 +1665,7 @@ void tst_QQuickMenu::disableWhenTriggered()
QFETCH(int, subMenuItemIndex);
QQuickApplicationHelper helper(this, QLatin1String("disableWhenTriggered.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1684,6 +1721,7 @@ void tst_QQuickMenu::menuItemWidth()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1712,6 +1750,7 @@ void tst_QQuickMenu::menuItemWidthAfterMenuWidthChanged()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1756,6 +1795,7 @@ void tst_QQuickMenu::menuItemWidthAfterImplicitWidthChanged()
QFETCH(bool, mirrored);
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1786,6 +1826,7 @@ void tst_QQuickMenu::menuItemWidthAfterImplicitWidthChanged()
void tst_QQuickMenu::menuItemWidthAfterRetranslate()
{
QQuickApplicationHelper helper(this, QLatin1String("menuItemWidths.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
diff --git a/tests/auto/qquickpopup/data/centerInOverlayWithinStackViewItem.qml b/tests/auto/qquickpopup/data/centerInOverlayWithinStackViewItem.qml
new file mode 100644
index 00000000..076e2230
--- /dev/null
+++ b/tests/auto/qquickpopup/data/centerInOverlayWithinStackViewItem.qml
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 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$
+** 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
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+
+ApplicationWindow {
+ width: 400
+ height: 400
+
+ property Popup popup: stackView.currentItem.popup
+
+ StackView {
+ id: stackView
+ objectName: "stackView"
+ anchors.fill: parent
+
+ initialItem: Rectangle {
+ objectName: "rectangle"
+
+ property alias popup: popup
+
+ Popup {
+ id: popup
+ objectName: "popup"
+ width: 100
+ height: 100
+ visible: true
+ anchors.centerIn: Overlay.overlay
+ }
+ }
+ }
+}
diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp
index 162a48ba..d8dac979 100644
--- a/tests/auto/qquickpopup/tst_qquickpopup.cpp
+++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp
@@ -99,6 +99,7 @@ private slots:
void setOverlayParentToNull();
void tabFence();
void invisibleToolTipOpen();
+ void centerInOverlayWithinStackViewItem();
};
void tst_QQuickPopup::initTestCase()
@@ -118,6 +119,7 @@ void tst_QQuickPopup::visible()
{
QFETCH(QString, source);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -151,6 +153,7 @@ void tst_QQuickPopup::visible()
void tst_QQuickPopup::state()
{
QQuickApplicationHelper helper(this, "applicationwindow.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -212,6 +215,7 @@ void tst_QQuickPopup::overlay()
QFETCH(bool, dim);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -300,18 +304,7 @@ void tst_QQuickPopup::overlay()
QVERIFY(popup->isVisible());
QVERIFY(overlay->isVisible());
- struct TouchDeviceDeleter
- {
- static inline void cleanup(QTouchDevice *device)
- {
- QWindowSystemInterface::unregisterTouchDevice(device);
- delete device;
- }
- };
-
- QScopedPointer<QTouchDevice, TouchDeviceDeleter> device(new QTouchDevice);
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device.data());
+ QScopedPointer<QPointingDevice> device(QTest::createTouchDevice());
QTest::touchEvent(window, device.data()).press(0, QPoint(1, 1));
QCOMPARE(overlayPressedSignal.count(), ++overlayPressCount);
@@ -374,6 +367,7 @@ void tst_QQuickPopup::zOrder()
{
QFETCH(QString, source);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -483,6 +477,7 @@ void tst_QQuickPopup::closePolicy()
QFETCH(QQuickPopup::ClosePolicy, closePolicy);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -567,6 +562,7 @@ void tst_QQuickPopup::activeFocusOnClose1()
// Test that a popup that never sets focus: true (e.g. ToolTip) doesn't affect
// the active focus item when it closes.
QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClose1.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
window->requestActivate();
@@ -610,6 +606,7 @@ void tst_QQuickPopup::activeFocusOnClose2()
// calling forceActiveFocus() on another item) before it closes doesn't
// affect the active focus item when it closes.
QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClose2.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
window->requestActivate();
@@ -646,6 +643,7 @@ void tst_QQuickPopup::activeFocusOnClose3()
// Test that a closing popup that had focus doesn't steal focus from
// another popup that the focus was transferred to.
QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClose3.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
window->requestActivate();
@@ -677,6 +675,7 @@ void tst_QQuickPopup::activeFocusOnClosingSeveralPopups()
{
// Test that active focus isn't lost when multiple popup closing simultaneously
QQuickApplicationHelper helper(this, QStringLiteral("activeFocusOnClosingSeveralPopups.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
window->requestActivate();
@@ -738,6 +737,7 @@ void tst_QQuickPopup::hover()
QFETCH(bool, modal);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
window->requestActivate();
@@ -812,6 +812,7 @@ void tst_QQuickPopup::wheel()
QFETCH(bool, modal);
QQuickApplicationHelper helper(this, source);
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -882,6 +883,7 @@ void tst_QQuickPopup::parentDestroyed()
void tst_QQuickPopup::nested()
{
QQuickApplicationHelper helper(this, QStringLiteral("nested.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -909,6 +911,7 @@ void tst_QQuickPopup::nested()
void tst_QQuickPopup::grabber()
{
QQuickApplicationHelper helper(this, QStringLiteral("grabber.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -961,6 +964,7 @@ void tst_QQuickPopup::cursorShape()
// Ensure that the mouse cursor has the correct shape when over a popup
// which is itself over an item with a different shape.
QQuickApplicationHelper helper(this, QStringLiteral("cursor.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
centerOnScreen(window);
moveMouseAway(window);
@@ -1018,6 +1022,7 @@ void tst_QQuickPopup::closeOnEscapeWithNestedPopups()
// Tests the scenario in the Gallery example, where there are nested popups that should
// close in the correct order when the Escape key is pressed.
QQuickApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithNestedPopups.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickApplicationWindow *window = helper.appWindow;
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
@@ -1081,6 +1086,7 @@ void tst_QQuickPopup::closeOnEscapeWithNestedPopups()
void tst_QQuickPopup::closeOnEscapeWithVisiblePopup()
{
QQuickApplicationHelper helper(this, QStringLiteral("closeOnEscapeWithVisiblePopup.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
QVERIFY(QTest::qWaitForWindowActive(window));
@@ -1131,6 +1137,7 @@ void tst_QQuickPopup::orientation()
QFETCH(QPointF, position);
QQuickApplicationHelper helper(this, "orientation.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->reportContentOrientationChange(orientation);
@@ -1170,6 +1177,7 @@ void tst_QQuickPopup::qquickview()
void tst_QQuickPopup::disabledPalette()
{
QQuickApplicationHelper helper(this, "disabledPalette.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1206,6 +1214,7 @@ void tst_QQuickPopup::disabledPalette()
void tst_QQuickPopup::disabledParentPalette()
{
QQuickApplicationHelper helper(this, "disabledPalette.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1251,6 +1260,7 @@ void tst_QQuickPopup::disabledParentPalette()
void tst_QQuickPopup::countChanged()
{
QQuickApplicationHelper helper(this, "countChanged.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1273,6 +1283,7 @@ void tst_QQuickPopup::toolTipCrashOnClose()
QSKIP("Test requires QtGraphicalEffects");
QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1293,6 +1304,7 @@ void tst_QQuickPopup::setOverlayParentToNull()
QSKIP("Test requires QtGraphicalEffects");
QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1313,6 +1325,7 @@ void tst_QQuickPopup::tabFence()
QSKIP("This platform only allows tab focus for text controls");
QQuickApplicationHelper helper(this, "tabFence.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
window->show();
@@ -1366,6 +1379,7 @@ void tst_QQuickPopup::tabFence()
void tst_QQuickPopup::invisibleToolTipOpen()
{
QQuickApplicationHelper helper(this, "invisibleToolTipOpen.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
QQuickWindow *window = helper.window;
centerOnScreen(window);
@@ -1390,6 +1404,22 @@ void tst_QQuickPopup::invisibleToolTipOpen()
QTRY_VERIFY(mouseArea->property("isToolTipVisible").toBool());
}
+void tst_QQuickPopup::centerInOverlayWithinStackViewItem()
+{
+ QQuickApplicationHelper helper(this, "centerInOverlayWithinStackViewItem.qml");
+ QVERIFY2(helper.ready, helper.failureMessage());
+
+ QQuickWindow *window = helper.window;
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+
+ QQuickPopup *popup = window->property("popup").value<QQuickPopup*>();
+ QVERIFY(popup);
+ QTRY_COMPARE(popup->isVisible(), true);
+
+ // Shouldn't crash on exit.
+}
+
QTEST_QUICKCONTROLS_MAIN(tst_QQuickPopup)
#include "tst_qquickpopup.moc"
diff --git a/tests/auto/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp b/tests/auto/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp
index 51cc5883..08eae67c 100644
--- a/tests/auto/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp
+++ b/tests/auto/qquickuniversalstyleconf/tst_qquickuniversalstyleconf.cpp
@@ -54,6 +54,7 @@ private slots:
void tst_qquickuniversalstyleconf::conf()
{
QQuickApplicationHelper helper(this, QLatin1String("applicationwindow.qml"));
+ QVERIFY2(helper.ready, helper.failureMessage());
QFont customFont;
customFont.setFamily("Courier");
diff --git a/tests/auto/sanity/tst_sanity.cpp b/tests/auto/sanity/tst_sanity.cpp
index b5d0054b..35c48970 100644
--- a/tests/auto/sanity/tst_sanity.cpp
+++ b/tests/auto/sanity/tst_sanity.cpp
@@ -211,9 +211,9 @@ void tst_Sanity::functions_data()
class SignalHandlerValidator : public BaseValidator
{
protected:
- static bool isSignalHandler(const QStringRef &name)
+ static bool isSignalHandler(QStringView name)
{
- return name.length() > 2 && name.startsWith("on") && name.at(2).isUpper();
+ return name.length() > 2 && name.startsWith(QLatin1String("on")) && name.at(2).isUpper();
}
virtual bool visit(QQmlJS::AST::UiScriptBinding *node)
diff --git a/tests/auto/shared/visualtestutil.h b/tests/auto/shared/visualtestutil.h
index d5e651c5..e3f4075d 100644
--- a/tests/auto/shared/visualtestutil.h
+++ b/tests/auto/shared/visualtestutil.h
@@ -122,19 +122,44 @@ namespace QQuickVisualTestUtil
component.loadUrl(testCase->testFileUrl(testFilePath));
QObject *rootObject = component.create();
cleanup.reset(rootObject);
- QVERIFY2(rootObject, qPrintable(QString::fromLatin1("Failed to create window: %1").arg(component.errorString())));
+ if (!rootObject) {
+ errorMessage = QString::fromUtf8("Failed to create window: %1").arg(component.errorString()).toUtf8();
+ return;
+ }
window = qobject_cast<QQuickWindow*>(rootObject);
appWindow = qobject_cast<QQuickApplicationWindow*>(rootObject);
- QVERIFY(window);
- QVERIFY(!window->isVisible());
+ if (!window) {
+ errorMessage = QString::fromUtf8("Root object %1 must be a QQuickWindow subclass").arg(QDebug::toString(window)).toUtf8();
+ return;
+ }
+
+ if (window->isVisible()) {
+ errorMessage = QString::fromUtf8("Expected window not to be visible, but it is").toUtf8();
+ return;
+ }
+
+ ready = true;
+ }
+
+ // Return a C-style string instead of QString because that's what QTest uses for error messages,
+ // so it saves code at the calling site.
+ inline const char *failureMessage() const
+ {
+ return errorMessage.constData();
}
QQmlEngine engine;
QQmlComponent component;
QScopedPointer<QObject> cleanup;
- QQuickApplicationWindow *appWindow;
- QQuickWindow *window;
+ QQuickApplicationWindow *appWindow = nullptr;
+ QQuickWindow *window = nullptr;
+
+ bool ready = false;
+ // Store as a byte array so that we can return its raw data safely;
+ // using qPrintable() in failureMessage() will construct a throwaway QByteArray
+ // that is destroyed before the function returns.
+ QByteArray errorMessage;
};
void addTestRowForEachControl(QQmlEngine *engine, const QString &sourcePath, const QString &targetPath, const QStringList &skiplist = QStringList());
diff --git a/tests/manual/gifs/eventcapturer.cpp b/tests/manual/gifs/eventcapturer.cpp
index b3bbd7c8..ad88b1db 100644
--- a/tests/manual/gifs/eventcapturer.cpp
+++ b/tests/manual/gifs/eventcapturer.cpp
@@ -124,7 +124,7 @@ void EventCapturer::setCapturedEventTypes(QSet<QEvent::Type> types)
mCapturedEventTypes = types;
}
-QVector<CapturedEvent> EventCapturer::capturedEvents() const
+QList<CapturedEvent> EventCapturer::capturedEvents() const
{
if (mMoveEventTrimFlags == TrimNone || mEvents.isEmpty())
return mEvents;
@@ -167,7 +167,7 @@ QVector<CapturedEvent> EventCapturer::capturedEvents() const
// the indices are still valid - we could be removing from the middle of
// the commands next. Also, the function is const, so we can't remove from
// mEvents anyway. :)
- QVector<CapturedEvent> events = mEvents.mid(firstEventIndex, (lastEventIndex - firstEventIndex) + 1);
+ QList<CapturedEvent> events = mEvents.mid(firstEventIndex, (lastEventIndex - firstEventIndex) + 1);
if (mMoveEventTrimFlags.testFlag(TrimAfterReleases)) {
bool lastNonMoveEventWasRelease = false;
diff --git a/tests/manual/gifs/eventcapturer.h b/tests/manual/gifs/eventcapturer.h
index e2b8b3a4..ea01299f 100644
--- a/tests/manual/gifs/eventcapturer.h
+++ b/tests/manual/gifs/eventcapturer.h
@@ -40,9 +40,9 @@
#include <QObject>
#include <QElapsedTimer>
#include <QEvent>
+#include <QList>
#include <QPoint>
#include <QSet>
-#include <QVector>
#include "capturedevent.h"
@@ -72,7 +72,7 @@ public:
QSet<QEvent::Type> capturedEventTypes();
void setCapturedEventTypes(QSet<QEvent::Type> types);
- QVector<CapturedEvent> capturedEvents() const;
+ QList<CapturedEvent> capturedEvents() const;
protected:
bool eventFilter(QObject *object, QEvent *event) override;
@@ -87,7 +87,7 @@ private:
Qt::Key mStopCaptureKey;
MoveEventTrimFlags mMoveEventTrimFlags;
QElapsedTimer mDelayTimer;
- QVector<CapturedEvent> mEvents;
+ QList<CapturedEvent> mEvents;
int mDuration;
int mLastCaptureTime;
};
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp
index d7d8f98d..80c3fd9f 100644
--- a/tests/manual/gifs/tst_gifs.cpp
+++ b/tests/manual/gifs/tst_gifs.cpp
@@ -609,19 +609,19 @@ void tst_Gifs::swipeDelegateBehind()
void tst_Gifs::delegates_data()
{
QTest::addColumn<QString>("name");
- QTest::addColumn<QVector<int> >("pressIndices");
+ QTest::addColumn<QList<int> >("pressIndices");
QTest::addColumn<int>("duration");
- QTest::newRow("ItemDelegate") << "itemdelegate" << (QVector<int>() << 0 << 1 << 2) << 5;
- QTest::newRow("CheckDelegate") << "checkdelegate" << (QVector<int>() << 0 << 0) << 5;
- QTest::newRow("RadioDelegate") << "radiodelegate" << (QVector<int>() << 1 << 0) << 5;
- QTest::newRow("SwitchDelegate") << "switchdelegate" << (QVector<int>() << 0 << 0) << 5;
+ QTest::newRow("ItemDelegate") << "itemdelegate" << (QList<int> { 0, 1, 2 }) << 5;
+ QTest::newRow("CheckDelegate") << "checkdelegate" << (QList<int> { 0, 0 }) << 5;
+ QTest::newRow("RadioDelegate") << "radiodelegate" << (QList<int> { 1, 0 }) << 5;
+ QTest::newRow("SwitchDelegate") << "switchdelegate" << (QList<int> { 0, 0 }) << 5;
}
void tst_Gifs::delegates()
{
QFETCH(QString, name);
- QFETCH(QVector<int>, pressIndices);
+ QFETCH(QList<int>, pressIndices);
QFETCH(int, duration);
GifRecorder gifRecorder;
@@ -710,16 +710,16 @@ void tst_Gifs::dial()
void tst_Gifs::checkables_data()
{
QTest::addColumn<QString>("name");
- QTest::addColumn<QVector<int> >("pressIndices");
+ QTest::addColumn<QList<int> >("pressIndices");
- QTest::newRow("checkbox") << "checkbox" << (QVector<int>() << 1 << 2 << 2 << 1);
- QTest::newRow("radiobutton") << "radiobutton" << (QVector<int>() << 1 << 2 << 1 << 0);
+ QTest::newRow("checkbox") << "checkbox" << (QList<int> { 1, 2, 2, 1 });
+ QTest::newRow("radiobutton") << "radiobutton" << (QList<int> { 1, 2, 1, 0 });
}
void tst_Gifs::checkables()
{
QFETCH(QString, name);
- QFETCH(QVector<int>, pressIndices);
+ QFETCH(QList<int>, pressIndices);
GifRecorder gifRecorder;
gifRecorder.setDataDirPath(dataDirPath);
diff --git a/tests/manual/headerview/main.cpp b/tests/manual/headerview/main.cpp
index 4c1e611c..b1573f08 100644
--- a/tests/manual/headerview/main.cpp
+++ b/tests/manual/headerview/main.cpp
@@ -199,7 +199,7 @@ public:
}
private:
- QVector<QVariant> hData, vData;
+ QList<QVariant> hData, vData;
};
int main(int argc, char *argv[])
diff --git a/tests/manual/systemtrayicon/systemtrayicon.qml b/tests/manual/systemtrayicon/systemtrayicon.qml
index a7e656d4..03855b44 100644
--- a/tests/manual/systemtrayicon/systemtrayicon.qml
+++ b/tests/manual/systemtrayicon/systemtrayicon.qml
@@ -75,7 +75,7 @@ ApplicationWindow {
SystemTrayIcon {
visible: true
- iconSource: "qrc:/files/images/qt_logo_green_256.png"
+ icon.source: "qrc:/files/images/qt_logo_green_256.png"
menu: Menu {
MenuItem {
diff --git a/tests/manual/viewinqwidget/main.cpp b/tests/manual/viewinqwidget/main.cpp
index 80cbb415..b6b7a5ff 100644
--- a/tests/manual/viewinqwidget/main.cpp
+++ b/tests/manual/viewinqwidget/main.cpp
@@ -38,9 +38,9 @@
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QDebug>
-#include <QDesktopWidget>
#include <QDir>
#include <QGroupBox>
+#include <QScreen>
#include <QQmlApplicationEngine>
#include <QQmlError>
#include <QQuickView>
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
vLayout->addWidget(container);
hLayout->addWidget(groupBox);
- const QRect availableGeometry = QApplication::desktop()->availableGeometry(&widget);
+ const QRect availableGeometry = widget.screen()->availableGeometry();
widget.move(availableGeometry.center() - QPoint(widget.sizeHint().width() / 2, widget.sizeHint().height() / 2));
widget.show();