summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-15 13:51:20 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-15 13:55:22 +0200
commit6f617349cf865ca3a7befc0dd472b7c2510fc431 (patch)
tree37e70da54a7f3101b82551ccd98508f8d9d64330
parent718e08392f34dc478ea010c08a4b9c77bb665dfc (diff)
parent8e2d1b1efe736760d27af17160f662454546b054 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmakewip/cmake
Removed dependencies.yaml. Change-Id: I1e2b3f486e9ace4bc8dc0419a64848990b3a6b39
-rw-r--r--dist/changes-5.12.528
-rw-r--r--dist/changes-5.13.131
-rw-r--r--examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc26
-rw-r--r--examples/quickcontrols2/contactlist/ContactView.ui.qml6
-rw-r--r--examples/quickcontrols2/contactlist/doc/src/qtquickcontrols2-contactlist.qdoc2
-rw-r--r--examples/quickcontrols2/flatstyle/doc/src/qtquickcontrols2-flatstyle.qdoc2
-rw-r--r--examples/quickcontrols2/gallery/doc/src/qtquickcontrols2-gallery.qdoc2
-rw-r--r--examples/quickcontrols2/gallery/gallery.qml41
-rw-r--r--examples/quickcontrols2/gallery/pages/TabBarPage.qml2
-rw-r--r--examples/quickcontrols2/quickcontrols2.pro1
-rw-r--r--examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc4
-rw-r--r--examples/quickcontrols2/texteditor/documenthandler.cpp15
-rw-r--r--examples/quickcontrols2/texteditor/documenthandler.h7
-rw-r--r--examples/quickcontrols2/texteditor/qml/texteditor.qml19
-rw-r--r--examples/quickcontrols2/wearable/doc/src/qtquickcontrols2-wearable.qdoc4
-rw-r--r--src/imports/calendar/doc/src/qtlabscalendar-index.qdoc2
-rw-r--r--src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc4
-rw-r--r--src/imports/controls/doc/qtquickcontrols.qdocconf1
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml45
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml2
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml2
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc14
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-containers.qdoc2
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc19
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-default.qdoc8
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc54
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc18
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-examples.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc8
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-focus.qdoc9
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc5
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-guidelines.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-highdpi.qdoc7
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc15
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc18
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-index.qdoc60
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-input.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-material.qdoc14
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-navigation.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-popups.qdoc2
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc12
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc4
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc32
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc12
-rw-r--r--src/imports/controls/material/CursorDelegate.qml2
-rw-r--r--src/imports/platform/doc/src/qtlabsplatform-index.qdoc2
-rw-r--r--src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc4
-rw-r--r--src/imports/platform/qtlabsplatformplugin.cpp4
-rw-r--r--src/imports/templates/doc/src/qtquicktemplates2-index.qdoc4
-rw-r--r--src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc2
-rw-r--r--src/imports/templates/qtquicktemplates2plugin.cpp40
-rw-r--r--src/quickcontrols2/qquickstyle.cpp18
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp6
-rw-r--r--src/quicktemplates2/qquickapplicationwindow.cpp2
-rw-r--r--src/quicktemplates2/qquickbutton.cpp2
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp156
-rw-r--r--src/quicktemplates2/qquickcombobox_p.h4
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp4
-rw-r--r--src/quicktemplates2/qquickdialogbuttonbox.cpp44
-rw-r--r--src/quicktemplates2/qquickdialogbuttonbox_p_p.h2
-rw-r--r--src/quicktemplates2/qquickicon.cpp25
-rw-r--r--src/quicktemplates2/qquickicon_p.h2
-rw-r--r--src/quicktemplates2/qquickitemdelegate.cpp2
-rw-r--r--src/quicktemplates2/qquickmenu.cpp2
-rw-r--r--src/quicktemplates2/qquickmenubar.cpp2
-rw-r--r--src/quicktemplates2/qquickmenuitem.cpp2
-rw-r--r--src/quicktemplates2/qquickoverlay.cpp20
-rw-r--r--src/quicktemplates2/qquickoverlay_p.h2
-rw-r--r--src/quicktemplates2/qquickpage.cpp2
-rw-r--r--src/quicktemplates2/qquickpane.cpp2
-rw-r--r--src/quicktemplates2/qquickpopup.cpp1
-rw-r--r--src/quicktemplates2/qquickpopup_p_p.h2
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp2
-rw-r--r--src/quicktemplates2/qquickscrollview.cpp2
-rw-r--r--src/quicktemplates2/qquickspinbox.cpp2
-rw-r--r--src/quicktemplates2/qquickstackelement.cpp6
-rw-r--r--src/quicktemplates2/qquickstackview.cpp2
-rw-r--r--src/quicktemplates2/qquickswipeview.cpp2
-rw-r--r--src/quicktemplates2/qquicktabbar.cpp2
-rw-r--r--src/quicktemplates2/qquicktextarea.cpp38
-rw-r--r--src/quicktemplates2/qquicktoolbutton.cpp2
-rw-r--r--src/quicktemplates2/qquicktooltip.cpp9
-rw-r--r--src/quicktemplates2/qquicktumbler.cpp17
-rw-r--r--tests/auto/calendar/data/tst_monthgrid.qml9
-rw-r--r--tests/auto/calendar/data/tst_weeknumbercolumn.qml8
-rw-r--r--tests/auto/controls/data/tst_abstractbutton.qml8
-rw-r--r--tests/auto/controls/data/tst_dial.qml18
-rw-r--r--tests/auto/controls/data/tst_textarea.qml68
-rw-r--r--tests/auto/controls/data/tst_tooltip.qml9
-rw-r--r--tests/auto/controls/data/tst_tumbler.qml27
-rw-r--r--tests/auto/focus/BLACKLIST3
-rw-r--r--tests/auto/focus/tst_focus.cpp8
-rw-r--r--tests/auto/qquickdrawer/tst_qquickdrawer.cpp10
-rw-r--r--tests/auto/qquickmaterialstyle/data/tst_material.qml35
-rw-r--r--tests/auto/qquickpopup/data/toolTipCrashOnClose.qml94
-rw-r--r--tests/auto/qquickpopup/tst_qquickpopup.cpp48
-rw-r--r--tests/auto/translation/data/dialogButtonBox.qml61
-rw-r--r--tests/auto/translation/qtbase_fr.ts22
-rw-r--r--tests/auto/translation/translation.pro19
-rw-r--r--tests/auto/translation/tst_translation.cpp100
105 files changed, 1163 insertions, 423 deletions
diff --git a/dist/changes-5.12.5 b/dist/changes-5.12.5
new file mode 100644
index 00000000..3d5d25e7
--- /dev/null
+++ b/dist/changes-5.12.5
@@ -0,0 +1,28 @@
+Qt 5.12.5 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.12.0 through 5.12.4.
+
+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.12 series is binary compatible with the 5.11.x series.
+Applications compiled for 5.11 will continue to run with 5.12.
+
+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 *
+****************************************************************************
+
+ - TextArea:
+ * [QTBUG-76369] Fixed rendering issue using the Material style.
+
+ - Container
+ * [QTBUG-76164] Fixed crash when removing items.
diff --git a/dist/changes-5.13.1 b/dist/changes-5.13.1
new file mode 100644
index 00000000..3acd7b6e
--- /dev/null
+++ b/dist/changes-5.13.1
@@ -0,0 +1,31 @@
+Qt 5.13.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.13.0.
+
+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.13 series is binary compatible with the 5.12.x series.
+Applications compiled for 5.12 will continue to run with 5.13.
+
+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-76356] Accessibility: a Switch now has checkbox as its accessibleRole.
+ - [QTBUG-75572] Fixed an issue with transforming Shortcut.sequence to string.
+ - [QTBUG-75844] The text cursor no longer disappears while dragging it
+ around on iOS with the magnifier showing.
+ - [QTBUG-75972] The countChanged signal now will be emitted when a new
+ model is set on a ComboBox.
+ - [QTBUG-67343] It's now OK to use a ShaderEffect in a ComboBox delegate
+ (fixed in Qt Quick, tested in Controls 2)
diff --git a/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc b/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc
index f7cbd32f..0da8f7c5 100644
--- a/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc
+++ b/examples/quickcontrols2/chattutorial/doc/src/qtquickcontrols2-chattutorial.qdoc
@@ -28,13 +28,13 @@
/*!
\example chattutorial
\keyword Qt Quick Controls - Chat Tutorial
- \title Qt Quick Controls - Chat Tutorial
- \keyword Qt Quick Controls 2 - Chat Tutorial
-\brief Tutorial about writing a basic chat client using Qt Quick Controls 2.
+\title Qt Quick Controls - Chat Tutorial
+\keyword Qt Quick Controls 2 - Chat Tutorial
+\brief Tutorial about writing a basic chat client using Qt Quick Controls.
\ingroup qtquickcontrols2-examples
This tutorial shows how to write a basic chat application using Qt Quick
-Controls 2. It will also explain how to integrate an SQL database into a Qt
+Controls. It will also explain how to integrate an SQL database into a Qt
application.
\section1 Chapter 1: Setting Up
@@ -88,7 +88,7 @@ arguments provided by the user.
Next, the QML engine is created. \l QQmlApplicationEngine is a convenient
wrapper over QQmlEngine, providing the \l {QQmlApplicationEngine::load}{load()}
function to easily load QML for an application. It also adds some convenience
-for using \l {Using File Selectors with Qt Quick Controls 2}{file selectors}.
+for using \l {Using File Selectors with Qt Quick Controls}{file selectors}.
Once we've set up things in C++, we can move on to the user interface in QML.
@@ -105,7 +105,7 @@ access to graphical primitives such as \l Item, \l Rectangle, \l Text, and so
on.
For the full list of types, see the \l {Qt Quick QML Types} documentation.
-Next, import the Qt Quick Controls 2 module. Amongst other things, this
+Next, import the Qt Quick Controls module. Amongst other things, this
provides access to \l ApplicationWindow, which will replace the existing
root type, \c Window:
@@ -156,7 +156,7 @@ property.
Then, we assign a \l Label to its \l {Page::}{header} property. Label extends
the primitive \l Text item from the Qt Quick module by adding
-\l{Styling Qt Quick Controls 2}{styling} and \l {Control::}{font} inheritance.
+\l{Styling Qt Quick Controls}{styling} and \l {Control::}{font} inheritance.
This means that a Label can look different depending on which style is in use,
and can also propagate its pixel size to its children.
@@ -228,7 +228,7 @@ In this chapter, we'll explain how to create a list of interactive items using
ListView comes from the Qt Quick module, and displays a list of items
populated from a \l {Models and Views in Qt Quick}{model}. ItemDelegate comes from
-the Qt Quick Controls 2 module, and provides a standard view item for use in views
+the Qt Quick Controls module, and provides a standard view item for use in views
and controls such as ListView and \l ComboBox. For example, each ItemDelegate
can display text, be checked on and off, and react to mouse clicks.
@@ -746,7 +746,7 @@ text field to make way for future input.
\section1 Chapter 5: Styling
-Styles in Qt Quick Controls 2 are designed to work on any platform. In this
+Styles in Qt Quick Controls are designed to work on any platform. In this
chapter, we'll do some minor visual tweaks to make sure our application
looks good when run with the \l {Default Style}{Default},
\l {Material Style}{Material}, and \l {Universal Style}{Universal} styles.
@@ -784,8 +784,8 @@ Material style plugin \e must be deployed with the application, even if the
target device doesn't use it, otherwise the QML engine will fail to find the
import.
-Instead, it is better to rely on Qt Quick Controls 2's built-in support for
-\l {Using File Selectors with Qt Quick Controls 2}{style-based file selectors}.
+Instead, it is better to rely on Qt Quick Controls's built-in support for
+\l {Using File Selectors with Qt Quick Controls}{style-based file selectors}.
To do this, we must move the ToolBar out into its own file. We'll call it
\c ChatToolBar.qml. This will be the \e "default" version of the file, which
means that it will be used when the \l {Default Style}{Default style} is in
@@ -796,7 +796,7 @@ use. Here's the new file:
\printuntil }
As we only use the ToolBar type within this file, we only need the
-Qt Quick Controls 2 import. The code itself has not changed from how it was
+Qt Quick Controls import. The code itself has not changed from how it was
in \c ContactPage.qml, which is how it should be; for the default version
of the file, nothing needs to be different.
@@ -876,7 +876,7 @@ After building and running the application, you should see these results:
\section1 Summary
In this tutorial, we've taken you through the following steps of writing a
-basic application using Qt Quick Controls 2:
+basic application using Qt Quick Controls:
\list
\li Creating a new project using Qt Creator.
diff --git a/examples/quickcontrols2/contactlist/ContactView.ui.qml b/examples/quickcontrols2/contactlist/ContactView.ui.qml
index 747f3042..984fc787 100644
--- a/examples/quickcontrols2/contactlist/ContactView.ui.qml
+++ b/examples/quickcontrols2/contactlist/ContactView.ui.qml
@@ -72,11 +72,7 @@ ListView {
delegate: ContactDelegate {
id: delegate
width: listView.width
-
- Connections {
- target: delegate
- onPressAndHold: listView.pressAndHold(index)
- }
+ onPressAndHold: listView.pressAndHold(index)
}
model: ContactModel {
diff --git a/examples/quickcontrols2/contactlist/doc/src/qtquickcontrols2-contactlist.qdoc b/examples/quickcontrols2/contactlist/doc/src/qtquickcontrols2-contactlist.qdoc
index 2c692430..1c97617c 100644
--- a/examples/quickcontrols2/contactlist/doc/src/qtquickcontrols2-contactlist.qdoc
+++ b/examples/quickcontrols2/contactlist/doc/src/qtquickcontrols2-contactlist.qdoc
@@ -30,7 +30,7 @@
\title Qt Quick Controls - Contact List
\keyword Qt Quick Controls 2 - Contact List
\ingroup qtquickcontrols2-examples
- \brief A QML app using Qt Quick Controls 2 and a C++ class that implements
+ \brief A QML app using Qt Quick Controls and a C++ class that implements
a simple contact list.
The \e {Contact List Example} shows how to integrate a C++ backend in a way that
diff --git a/examples/quickcontrols2/flatstyle/doc/src/qtquickcontrols2-flatstyle.qdoc b/examples/quickcontrols2/flatstyle/doc/src/qtquickcontrols2-flatstyle.qdoc
index a71c2093..5da21ff4 100644
--- a/examples/quickcontrols2/flatstyle/doc/src/qtquickcontrols2-flatstyle.qdoc
+++ b/examples/quickcontrols2/flatstyle/doc/src/qtquickcontrols2-flatstyle.qdoc
@@ -31,7 +31,7 @@
\title Qt Quick Controls - Flat Style
\keyword Qt Quick Controls 2 - Flat Style
\ingroup qtquickcontrols2-examples
- \brief A QML app using Qt Quick Controls 2 and a QML plugin
+ \brief A QML app using Qt Quick Controls and a QML plugin
with customized controls.
\e Flat Style shows how to integrate customized controls into Qt Quick Designer.
diff --git a/examples/quickcontrols2/gallery/doc/src/qtquickcontrols2-gallery.qdoc b/examples/quickcontrols2/gallery/doc/src/qtquickcontrols2-gallery.qdoc
index 463acdee..17496043 100644
--- a/examples/quickcontrols2/gallery/doc/src/qtquickcontrols2-gallery.qdoc
+++ b/examples/quickcontrols2/gallery/doc/src/qtquickcontrols2-gallery.qdoc
@@ -55,7 +55,7 @@
\endraw
The gallery example is a simple application with a drawer menu that contains
- all the \l {Qt Quick Controls 2}. Each menu item opens a page that shows the
+ all the \l {Qt Quick Controls}. Each menu item opens a page that shows the
graphical appearance of a control, allows you to interact with the control,
and explains in which circumstances it is handy to use this control.
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml
index e9f0b432..44987ada 100644
--- a/examples/quickcontrols2/gallery/gallery.qml
+++ b/examples/quickcontrols2/gallery/gallery.qml
@@ -70,15 +70,31 @@ ApplicationWindow {
Shortcut {
sequences: ["Esc", "Back"]
enabled: stackView.depth > 1
- onActivated: {
- stackView.pop()
- listView.currentIndex = -1
+ onActivated: navigateBackAction.trigger()
+ }
+
+ Action {
+ id: navigateBackAction
+ icon.name: stackView.depth > 1 ? "back" : "drawer"
+ onTriggered: {
+ if (stackView.depth > 1) {
+ stackView.pop()
+ listView.currentIndex = -1
+ } else {
+ drawer.open()
+ }
}
}
Shortcut {
sequence: "Menu"
- onActivated: optionsMenu.open()
+ onActivated: optionsMenuAction.trigger()
+ }
+
+ Action {
+ id: optionsMenuAction
+ icon.name: "menu"
+ onTriggered: optionsMenu.open()
}
header: ToolBar {
@@ -89,15 +105,7 @@ ApplicationWindow {
anchors.fill: parent
ToolButton {
- icon.name: stackView.depth > 1 ? "back" : "drawer"
- onClicked: {
- if (stackView.depth > 1) {
- stackView.pop()
- listView.currentIndex = -1
- } else {
- drawer.open()
- }
- }
+ action: navigateBackAction
}
Label {
@@ -111,19 +119,18 @@ ApplicationWindow {
}
ToolButton {
- icon.name: "menu"
- onClicked: optionsMenu.open()
+ action: optionsMenuAction
Menu {
id: optionsMenu
x: parent.width - width
transformOrigin: Menu.TopRight
- MenuItem {
+ Action {
text: "Settings"
onTriggered: settingsDialog.open()
}
- MenuItem {
+ Action {
text: "About"
onTriggered: aboutDialog.open()
}
diff --git a/examples/quickcontrols2/gallery/pages/TabBarPage.qml b/examples/quickcontrols2/gallery/pages/TabBarPage.qml
index 7f5cbce5..7c3cae44 100644
--- a/examples/quickcontrols2/gallery/pages/TabBarPage.qml
+++ b/examples/quickcontrols2/gallery/pages/TabBarPage.qml
@@ -74,7 +74,7 @@ Page {
width: parent.width
wrapMode: Label.Wrap
horizontalAlignment: Qt.AlignHCenter
- text: "TabBar is a bar with icons or text which allows the user"
+ text: "TabBar is a bar with icons or text which allows the user "
+ "to switch between different subtasks, views, or modes."
}
diff --git a/examples/quickcontrols2/quickcontrols2.pro b/examples/quickcontrols2/quickcontrols2.pro
index 6d0a3875..a9784d86 100644
--- a/examples/quickcontrols2/quickcontrols2.pro
+++ b/examples/quickcontrols2/quickcontrols2.pro
@@ -9,6 +9,5 @@ SUBDIRS += \
wearable \
imagine/automotive \
imagine/musicplayer
- wearable
qtHaveModule(widgets): SUBDIRS += flatstyle
diff --git a/examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc b/examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc
index 3e9a9268..28cf3f3b 100644
--- a/examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc
+++ b/examples/quickcontrols2/texteditor/doc/src/qtquickcontrols2-texteditor.qdoc
@@ -30,7 +30,7 @@
\title Qt Quick Controls - Text Editor
\keyword Qt Quick Controls 2 - Text Editor
\ingroup qtquickcontrols2-examples
- \brief A QML app using Qt Quick Controls 2 and a C++ class to
+ \brief A QML app using Qt Quick Controls and a C++ class to
provide a fully-functional rich-text editor application.
The \e {Text Editor Example} presents a sample HTML file using the TextArea
@@ -77,7 +77,7 @@
The touch user interface is a simplified version of the text editor. It is
suitable for touch devices with limited screen size. The example uses
- \l{Using File Selectors with Qt Quick Controls 2}{file selectors} to load
+ \l{Using File Selectors with Qt Quick Controls}{file selectors} to load
the appropriate user interface automatically.
Unlike the desktop version, which uses top-level dialogs, the touch version
diff --git a/examples/quickcontrols2/texteditor/documenthandler.cpp b/examples/quickcontrols2/texteditor/documenthandler.cpp
index 25a83592..5def1b61 100644
--- a/examples/quickcontrols2/texteditor/documenthandler.cpp
+++ b/examples/quickcontrols2/texteditor/documenthandler.cpp
@@ -80,7 +80,11 @@ void DocumentHandler::setDocument(QQuickTextDocument *document)
if (document == m_document)
return;
+ if (m_document)
+ m_document->textDocument()->disconnect(this);
m_document = document;
+ if (m_document)
+ connect(m_document->textDocument(), &QTextDocument::modificationChanged, this, &DocumentHandler::modifiedChanged);
emit documentChanged();
}
@@ -370,3 +374,14 @@ void DocumentHandler::mergeFormatOnWordOrSelection(const QTextCharFormat &format
cursor.select(QTextCursor::WordUnderCursor);
cursor.mergeCharFormat(format);
}
+
+bool DocumentHandler::modified() const
+{
+ return m_document && m_document->textDocument()->isModified();
+}
+
+void DocumentHandler::setModified(bool m)
+{
+ if (m_document)
+ m_document->textDocument()->setModified(m);
+}
diff --git a/examples/quickcontrols2/texteditor/documenthandler.h b/examples/quickcontrols2/texteditor/documenthandler.h
index a6125bc3..97e55658 100644
--- a/examples/quickcontrols2/texteditor/documenthandler.h
+++ b/examples/quickcontrols2/texteditor/documenthandler.h
@@ -84,6 +84,8 @@ class DocumentHandler : public QObject
Q_PROPERTY(QString fileType READ fileType NOTIFY fileUrlChanged)
Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY fileUrlChanged)
+ Q_PROPERTY(bool modified READ modified WRITE setModified NOTIFY modifiedChanged)
+
public:
explicit DocumentHandler(QObject *parent = nullptr);
@@ -124,6 +126,9 @@ public:
QString fileType() const;
QUrl fileUrl() const;
+ bool modified() const;
+ void setModified(bool m);
+
public Q_SLOTS:
void load(const QUrl &fileUrl);
void saveAs(const QUrl &fileUrl);
@@ -150,6 +155,8 @@ Q_SIGNALS:
void loaded(const QString &text);
void error(const QString &message);
+ void modifiedChanged();
+
private:
void reset();
QTextCursor textCursor() const;
diff --git a/examples/quickcontrols2/texteditor/qml/texteditor.qml b/examples/quickcontrols2/texteditor/qml/texteditor.qml
index a1cb3435..6c95335b 100644
--- a/examples/quickcontrols2/texteditor/qml/texteditor.qml
+++ b/examples/quickcontrols2/texteditor/qml/texteditor.qml
@@ -80,7 +80,7 @@ ApplicationWindow {
}
Shortcut {
sequence: StandardKey.Quit
- onActivated: Qt.quit()
+ onActivated: close()
}
Shortcut {
sequence: StandardKey.Copy
@@ -121,7 +121,7 @@ ApplicationWindow {
}
MenuItem {
text: qsTr("&Quit")
- onTriggered: Qt.quit()
+ onTriggered: close()
}
}
@@ -205,6 +205,14 @@ ApplicationWindow {
id: errorDialog
}
+ MessageDialog {
+ id : quitDialog
+ title: qsTr("Quit?")
+ text: qsTr("The file has been modified. Quit anyway?")
+ buttons: (MessageDialog.Yes | MessageDialog.No)
+ onYesClicked: Qt.quit()
+ }
+
header: ToolBar {
leftPadding: 8
@@ -449,4 +457,11 @@ ApplicationWindow {
onTriggered: colorDialog.open()
}
}
+
+ onClosing: {
+ if (document.modified) {
+ quitDialog.open()
+ close.accepted = false
+ }
+ }
}
diff --git a/examples/quickcontrols2/wearable/doc/src/qtquickcontrols2-wearable.qdoc b/examples/quickcontrols2/wearable/doc/src/qtquickcontrols2-wearable.qdoc
index 95e8329d..7e4edea4 100644
--- a/examples/quickcontrols2/wearable/doc/src/qtquickcontrols2-wearable.qdoc
+++ b/examples/quickcontrols2/wearable/doc/src/qtquickcontrols2-wearable.qdoc
@@ -62,7 +62,7 @@
\section1 Styling
- The demo uses a custom \l {Styling Qt Quick Controls 2}{Qt Quick Controls 2 style}
+ The demo uses a custom \l {Styling Qt Quick Controls}{Qt Quick Controls 2 style}
embedded into the demo's resources. The custom style is implemented for a
few controls only, as it is specific to this particular demo. It uses a
singleton type for various styling attributes, such as fonts and colors.
@@ -114,7 +114,7 @@
\snippet wearable/wearable.cpp icons
The icons are used on the Launcher Page, which is presented below. See
- \l {Icons in Qt Quick Controls 2} for more details about icons and themes.
+ \l {Icons in Qt Quick Controls} for more details about icons and themes.
\section1 Launcher Page
diff --git a/src/imports/calendar/doc/src/qtlabscalendar-index.qdoc b/src/imports/calendar/doc/src/qtlabscalendar-index.qdoc
index 517dbdb1..065379ec 100644
--- a/src/imports/calendar/doc/src/qtlabscalendar-index.qdoc
+++ b/src/imports/calendar/doc/src/qtlabscalendar-index.qdoc
@@ -46,6 +46,6 @@
\list
\li \l{Qt Quick}
\li \l{Qt Quick Layouts}
- \li \l{Qt Quick Controls 2}
+ \li \l{Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc b/src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc
index 29b1a2c0..81abf52a 100644
--- a/src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc
+++ b/src/imports/calendar/doc/src/qtlabscalendar-qmltypes.qdoc
@@ -33,7 +33,7 @@
The \l{Qt Labs Calendar} module provides QML types for creating
calendars. These QML types work in conjunction with \l{Qt Quick} and
- \l{Qt Quick Controls 2}.
+ \l{Qt Quick Controls}.
The QML types can be imported into your application using the
following import statement in your .qml file:
@@ -51,7 +51,7 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 QML Types}
+ \li \l {Qt Quick Controls QML Types}
\endlist
\noautolist
diff --git a/src/imports/controls/doc/qtquickcontrols.qdocconf b/src/imports/controls/doc/qtquickcontrols.qdocconf
index 3efe5799..f6798f1f 100644
--- a/src/imports/controls/doc/qtquickcontrols.qdocconf
+++ b/src/imports/controls/doc/qtquickcontrols.qdocconf
@@ -9,7 +9,6 @@ description = Qt Quick Controls Reference Documentation
version = $QT_VERSION
qhp.projects = QtQuickControls
-moduleheader = QtQuickControls2
qhp.QtQuickControls.file = qtquickcontrols.qhp
qhp.QtQuickControls.namespace = org.qt-project.qtquickcontrols.$QT_VERSION_TAG
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml
new file mode 100644
index 00000000..9f2ad928
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-accepted.qml
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.12
+import QtQuick.Controls 2.12
+
+//! [combobox]
+ComboBox {
+ editable: true
+ model: ListModel {
+ id: model
+ ListElement { text: "Banana" }
+ ListElement { text: "Apple" }
+ ListElement { text: "Coconut" }
+ }
+ onAccepted: {
+ if (find(editText) === -1)
+ model.append({text: editText})
+ }
+}
+//! [combobox]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml
index 1bb68bdf..b902dab1 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-combobox-custom.qml
@@ -55,7 +55,7 @@ ComboBox {
Connections {
target: control
- onPressedChanged: canvas.requestPaint()
+ function onPressedChanged() { canvas.requestPaint(); }
}
onPaint: {
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml
index 86c6a0b7..4bcbaa67 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-delaybutton-custom.qml
@@ -62,7 +62,7 @@ DelayButton {
Connections {
target: control
- onProgressChanged: canvas.requestPaint()
+ function onProgressChanged() { canvas.requestPaint(); }
}
onPaint: {
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc
index a1f2dd57..6a4c5926 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-buttons.qdoc
@@ -31,7 +31,7 @@
\ingroup qtquickcontrols2-guidelines
\brief Guidelines for button controls
- Qt Quick Controls 2 offers a selection of button-like controls.
+ Qt Quick Controls offers a selection of button-like controls.
\annotatedlist qtquickcontrols2-buttons
@@ -186,6 +186,6 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 Guidelines}
+ \li \l {Qt Quick Controls Guidelines}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
index a846f607..8caa392f 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc
@@ -31,8 +31,8 @@
\title Qt Quick Controls Configuration File
\keyword Qt Quick Controls 2 Configuration File
- Qt Quick Controls 2 support a special configuration file, \c :/qtquickcontrols2.conf,
- that is built into an application's resources.
+ Qt Quick Controls support a special configuration file, \c qtquickcontrols2.conf,
+ which is built into an application's resources.
The configuration file can specify the preferred style and certain style-specific
attributes. The following example specifies that the preferred style is the \l {Material style}.
@@ -56,7 +56,7 @@
\endcode
It is possible to specify a custom location for the configuration file with
- the \l {Supported Environment Variables in Qt Quick Controls 2}
+ the \l {Supported Environment Variables in Qt Quick Controls}
{QT_QUICK_CONTROLS_CONF} environment variable.
\section1 Controls Section
@@ -174,7 +174,7 @@
\section1 Using the Configuration File in a Project
- In order to make it possible for Qt Quick Controls 2 to find the configuration file,
+ In order to make it possible for Qt Quick Controls to find the configuration file,
it must be built into application's resources using the \l {The Qt Resource System}.
Here's an example \c .qrc file:
@@ -186,7 +186,7 @@
</RCC>
\endcode
- \note Qt Quick Controls 2 uses a file selector to load the configuration file. It
+ \note Qt Quick Controls uses a file selector to load the configuration file. It
is possible to provide a different configuration file for different platforms and
locales. See \l QFileSelector documentation for more details.
@@ -200,7 +200,7 @@
\section1 Related Information
\list
- \li \l{Styling Qt Quick Controls 2}
- \li \l{Supported Environment Variables in Qt Quick Controls 2}
+ \li \l{Styling Qt Quick Controls}
+ \li \l{Supported Environment Variables in Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-containers.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-containers.qdoc
index c4d62224..81e24c26 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-containers.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-containers.qdoc
@@ -31,7 +31,7 @@
\ingroup qtquickcontrols2-guidelines
\brief Guidelines for container controls
- Qt Quick Controls 2 offers a selection of container-like controls.
+ Qt Quick Controls offers a selection of container-like controls.
\annotatedlist qtquickcontrols2-containers
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
index 958cc358..cd06a456 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -27,10 +27,11 @@
/*!
\page qtquickcontrols2-customize.html
- \title Customizing Qt Quick Controls 2
+ \keyword Customizing Qt Quick Controls 2
+ \title Customizing Qt Quick Controls
\brief A set of UI controls to create user interfaces in Qt Quick
- Qt Quick Controls 2 consist of a hierarchy (tree) of items. In order to
+ Qt Quick Controls consist of a hierarchy (tree) of items. In order to
provide a custom look and feel, the default QML implementation of each
item can be replaced with a custom one.
@@ -119,7 +120,7 @@
\endqml
As you now have the \c MyControls namespace, you can name the controls after
- their actual counterparts in the Qt Quick Controls 2 module. You can repeat
+ their actual counterparts in the Qt Quick Controls module. You can repeat
this process for any control that you wish to add.
An added benefit of these three methods is that it's not necessary to
@@ -132,9 +133,9 @@
\section2 Definition of a Style
- In Qt Quick Controls 2, a style is essentially an interchangeable set of
+ In Qt Quick Controls, a style is essentially an interchangeable set of
QML files within a single directory. There are three requirements for a style
- to be \l {Using Styles in Qt Quick Controls 2}{usable}:
+ to be \l {Using Styles in Qt Quick Controls}{usable}:
\list
\li At least one QML file whose name matches a control (for example,
@@ -143,7 +144,7 @@
{QtQuick.Templates} import as the root item. For example,
Button.qml must contain a Button template as its root item.
- If we instead used the corresponding type from the \l {Qt Quick Controls 2}
+ If we instead used the corresponding type from the \l {Qt Quick Controls}
{QtQuick.Controls} import as we did in the previous section, it would not work:
the control we were defining would try to derive from itself.
\li The files must be in a directory in the filesystem or in the
@@ -176,7 +177,7 @@
Using the approach above, it is possible to preview a custom style
in \l {Using Qt Quick Designer}{Qt Quick Designer}. In order to do so,
ensure that the project has a
- \l {Qt Quick Controls 2 Configuration File}{qtquickcontrols2.conf} file,
+ \l {Qt Quick Controls Configuration File}{qtquickcontrols2.conf} file,
and that the following entry exists:
\badcode
@@ -185,7 +186,7 @@
\endcode
For more information, take a look at the
- \l {Qt Quick Controls 2 - Flat Style}{Flat Style example}.
+ \l {Qt Quick Controls - Flat Style}{Flat Style example}.
\section2 Style-specific C++ Extensions
@@ -390,7 +391,7 @@
With that in place, we can run our example. To tell the application to
use our new style, we pass \c {-style :/mystyle} as an application
- argument, but there are \l {Using Styles in Qt Quick Controls 2}{many
+ argument, but there are \l {Using Styles in Qt Quick Controls}{many
ways} to specify the style to use.
The end result:
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-default.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-default.qdoc
index ad85b9ec..779f3241 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-default.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-default.qdoc
@@ -32,14 +32,14 @@
The Default style is a basic all-round style.
The Default style is a simple and light-weight style that offers the maximum
- performance for Qt Quick Controls 2. It is built with a minimal amount of Qt
+ performance for Qt Quick Controls. It is built with a minimal amount of Qt
Quick primitives, and keeps animations and transitions to the minimum.
\image qtquickcontrols2-default.png
- The style is selected by default when running Qt Quick Controls 2 applications.
+ The style is selected by default when running Qt Quick Controls applications.
It is built into the module's resources, so by default it is shipped with
- any application that depends on the Qt Quick Controls 2 module
+ any application that depends on the Qt Quick Controls module
\note The Default style is used as a fallback for other styles. If a style
does not implement a certain control, the Default style implementation of
@@ -50,6 +50,6 @@
\section1 Related Information
\list
- \li \l{Styling Qt Quick Controls 2}
+ \li \l{Styling Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc
index ebb4b6b2..bea87abf 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-delegates.qdoc
@@ -31,7 +31,7 @@
\ingroup qtquickcontrols2-guidelines
\brief Guidelines for delegate controls
- Qt Quick Controls 2 offers a selection of controls that are used as
+ Qt Quick Controls offers a selection of controls that are used as
delegates in views.
\annotatedlist qtquickcontrols2-delegates
@@ -74,6 +74,6 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 Guidelines}
+ \li \l {Qt Quick Controls Guidelines}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc
index fff895b4..7b27c9d5 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-deployment.qdoc
@@ -27,9 +27,9 @@
/*!
\page qtquickcontrols2-deployment.html
- \title Deploying Qt Quick Controls 2 Applications
+ \title Deploying Qt Quick Controls Applications
- Deployment of Qt Quick Controls 2 applications is very similar to
+ Deployment of Qt Quick Controls applications is very similar to
deployment of other types of Qt applications. However, there are a few
factors to consider.
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
index 40080840..bfb27dcb 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc
@@ -36,7 +36,7 @@
or platform-independent style.
On embedded systems, where the hardware has limited resources, this approach
- can be inefficient. Qt Quick Controls 2 was designed to solve this problem,
+ can be inefficient. Qt Quick Controls was designed to solve this problem,
using
\l {https://blog.qt.io/blog/2015/03/31/qt-quick-controls-for-embedded/}{benchmarks}
to guide the development.
@@ -58,7 +58,7 @@
Read more about implementing a style plugin
\l {Creating a Custom Style}{here}.
- In Qt Quick Controls 2, styles no longer provide components that are
+ In Qt Quick Controls, styles no longer provide components that are
dynamically instantiated by controls, but controls themselves consist of
item delegates that can be replaced. In effect, this means that delegates
are Qt Quick items that are instantiated on the spot, as properties of the
@@ -89,7 +89,7 @@
}
\endqml
- The API of Qt Quick Controls 2 aims to be clean and simple. Common
+ The API of Qt Quick Controls aims to be clean and simple. Common
operations are easy, and more advanced ones are liberally documented with
snippets that can be copied into your code.
@@ -99,7 +99,7 @@
\header
\li
\li Qt Quick Controls 1
- \li Qt Quick Controls 2
+ \li Qt Quick Controls
\row
\li Stylable delegates
\li Yes
@@ -138,7 +138,7 @@
\section2 Porting Qt Quick Controls 1 Code
- The API of Qt Quick Controls 2 is very similar to Qt Quick Controls 1, but it
+ The API of Qt Quick Controls is very similar to Qt Quick Controls 1, but it
does come with some changes necessary to facilitate the improvements. The
majority of changes are to do with styling; all of a control's delegates
are now accessible in the control itself, instead of in a separate style
@@ -156,7 +156,7 @@
}
\endqml
- To style a button in Qt Quick Controls 2:
+ To style a button in Qt Quick Controls:
\qml
Button {
@@ -189,7 +189,7 @@
The first column lists all types available in \l {Qt Quick Controls 1},
\l {Qt Quick Dialogs}, and \l {Qt Quick Extras}.
- The second column documents the respective type in Qt Quick Controls 2.
+ The second column documents the respective type in Qt Quick Controls.
When a direct alternative is not available, the third column contains
an alternative that provides related functionality. The last column
contains some remarks about the differences between the types in the
@@ -198,7 +198,7 @@
\table
\header
\li Qt Quick Controls 1
- \li Qt Quick Controls 2
+ \li Qt Quick Controls
\li Alternatives
\li Remarks
\row
@@ -245,9 +245,9 @@
\li \l [QML QtQuickControls1] {ExclusiveGroup}
\li \mdash
\li \l [QML QtQuickControls2] {ActionGroup},\br
- \l [QML QtQuickControls2] {ButtonGroup} \br\sup {(Qt Quick Controls 2)}
+ \l [QML QtQuickControls2] {ButtonGroup} \br\sup {(Qt Quick Controls)}
\li \list
- \li \b {Qt Quick Controls 2}: \c ActionGroup and \c ButtonGroup offer similar functionality.
+ \li \b {Qt Quick Controls}: \c ActionGroup and \c ButtonGroup offer similar functionality.
\endlist
\row
\li \l [QML QtQuickControls1] {GroupBox}
@@ -270,7 +270,7 @@
supports traditional desktop style cascading submenus, but does not
work on Embedded Linux because \l EGLFS does not support multiple
top-level windows.
- \li \b {Qt Quick Controls 2}: \c Menu is a non-native \c Item-based popup
+ \li \b {Qt Quick Controls}: \c Menu is a non-native \c Item-based popup
that is stacked above the application content. Due to this, menu popups
are restricted within window boundaries. \c Menu is fully customizable
using QML and Qt Quick, and allows adding any \c Items. Traditional
@@ -288,7 +288,7 @@
\li \b {Qt Quick Controls 1}: \c MenuBar is native on platforms where an
implementation is available in the Qt Platform Abstraction Layer. Other
platforms use a QML-based menubar item stacked at the top of the window.
- \li \b {Qt Quick Controls 2}: \c MenuBar is a non-native QML-based menubar
+ \li \b {Qt Quick Controls}: \c MenuBar is a non-native QML-based menubar
that can be fully customized using QML and Qt Quick.
\li \b {Qt Labs Platform}: \c MenuBar is an \e experimental native menubar.
It is only available on platforms where a native implementation is available
@@ -305,7 +305,7 @@
\li \b {Qt Quick Controls 1}: \c MenuItem and \c MenuSeparator are native
on platforms where an implementation is available in the Qt Platform
Abstraction Layer. Other platforms use QML-based menu items and separators.
- \li \b {Qt Quick Controls 2}: \c MenuItem and \c MenuSeparator are a non-native
+ \li \b {Qt Quick Controls}: \c MenuItem and \c MenuSeparator are a non-native
QML-based menu items and separators that can be fully customized using QML
and Qt Quick.
\li \b {Qt Labs Platform}: \c MenuItem and \c MenuSeparator are \e experimental
@@ -343,7 +343,7 @@
\li \list
\li \b {Qt Quick Controls 1}: Uses \l Layout attached properties
to specify size hints.
- \li \b {Qt Quick Controls 2}: Uses dedicated
+ \li \b {Qt Quick Controls}: Uses dedicated
\l [QML QtQuickControls2] {SplitView} attached properties
to specify size hints.
Allows \l {SplitView::saveState()}{saving} and
@@ -358,15 +358,15 @@
\li \l [QML QtQuickControls2] {StackView}
\li
\li \list
- \li \b {Qt Quick Controls 2}: \c StackView provides customizable transitions
+ \li \b {Qt Quick Controls}: \c StackView provides customizable transitions
and attached properties via a single \c StackView type.
\endlist
\row
\li \l [QML QtQuickControls1] {StatusBar}
\li \mdash
- \li \l [QML QtQuickControls2] {ToolBar} \br\sup {(Qt Quick Controls 2)}
+ \li \l [QML QtQuickControls2] {ToolBar} \br\sup {(Qt Quick Controls)}
\li \list
- \li \b {Qt Quick Controls 2}: \c ApplicationWindow allows assigning any
+ \li \b {Qt Quick Controls}: \c ApplicationWindow allows assigning any
item or control, such as \c ToolBar, as a header or footer.
\endlist
\row
@@ -379,9 +379,9 @@
\l [QML QtQuickControls1] {Tab}
\li \mdash
\li \l [QML QtQuickControls2] {TabBar},\br
- \l [QML QtQuickControls2] {TabButton} \br\sup {(Qt Quick Controls 2)}
+ \l [QML QtQuickControls2] {TabButton} \br\sup {(Qt Quick Controls)}
\li \list
- \li \b {Qt Quick Controls 2}: \c TabBar and \c TabButton offer similar
+ \li \b {Qt Quick Controls}: \c TabBar and \c TabButton offer similar
functionality, and can be used to build tabbed views.
\endlist
\row
@@ -397,7 +397,7 @@
\li \list
\li \b {Qt Quick Controls 1}: \c TextArea inherits \c ScrollView and is therefore
always a scrollable editor.
- \li \b {Qt Quick Controls 2}: \c TextArea is a simpler multi-line editor that can
+ \li \b {Qt Quick Controls}: \c TextArea is a simpler multi-line editor that can
be optionally attached to a \c Flickable to provide scrolling functionality.
This allows using \c TextArea in a scrollable page without having two nested
scrollable areas, which can be problematic and cause usability issues.
@@ -425,7 +425,7 @@
\header
\li Qt Quick Dialogs
- \li Qt Quick Controls 2
+ \li Qt Quick Controls
\li Alternatives
\li Remarks
\row
@@ -435,7 +435,7 @@
\li \list
\li \b {Qt Quick Dialogs}: \c Dialog is either a top-level window or an \c Item-based popup
depending on whether the underlying platform supports multiple top-level windows.
- \li \b {Qt Quick Controls 2}: \c Dialog is not a top-level window, but an \c Item-based
+ \li \b {Qt Quick Controls}: \c Dialog is not a top-level window, but an \c Item-based
popup that is stacked above the application content. Due to this, dialogs are restricted
within window boundaries.
\endlist
@@ -462,7 +462,7 @@
\header
\li Qt Quick Extras
- \li Qt Quick Controls 2
+ \li Qt Quick Controls
\li Alternatives
\li Remarks
\row
@@ -512,14 +512,14 @@
\li
\li \list
\li \b {Qt Quick Extras}: \c Tumbler can consist of multiple columns.
- \li \b {Qt Quick Controls 2}: \c Tumbler presents a single spinnable wheel.
+ \li \b {Qt Quick Controls}: \c Tumbler presents a single spinnable wheel.
Multiple columns can be created by placing multiple \c Tumblers next
to each other.
\endlist
\header
\li No Predecessor
- \li Qt Quick Controls 2
+ \li Qt Quick Controls
\li Alternatives
\li Remarks
\row
@@ -672,7 +672,7 @@
\li \list
\li \b {Qt Quick Controls 1}: \c Button and \c Action have built-in
Qt Widgets-based tooltips.
- \li \b {Qt Quick Controls 2}: \c ToolTip can be attached to any \c Item.
+ \li \b {Qt Quick Controls}: \c ToolTip can be attached to any \c Item.
\endlist
\endtable
@@ -680,7 +680,7 @@
\list
\li \l{Qt Quick}
- \li \l{Qt Quick Controls 2 QML Types}
+ \li \l{Qt Quick Controls QML Types}
\li \l{Qt Quick Controls 1 QML Types}
\li \l{Qt Quick Extras QML Types}
\li \l{Qt Labs Calendar QML Types}
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc
index 39ee005b..37be7b4c 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-environment.qdoc
@@ -27,9 +27,9 @@
/*!
\page qtquickcontrols2-environment.html
- \title Supported Environment Variables in Qt Quick Controls 2
+ \title Supported Environment Variables in Qt Quick Controls
- This page contains a list of all environment variables that Qt Quick Controls 2
+ This page contains a list of all environment variables that Qt Quick Controls
supports. The environment variables are primarily meant for testing purposes, but
they can also be used to set system-wide defaults.
@@ -39,7 +39,7 @@
\li Description
\row
\li \c QT_QUICK_CONTROLS_STYLE
- \li Specifies the default \l {Styling Qt Quick Controls 2}{Qt Quick Controls 2 style}.
+ \li Specifies the default \l {Styling Qt Quick Controls}{Qt Quick Controls style}.
The value can be either one of the built-in styles, for example \c "Material",
or the path to a custom style such as \c ":/mystyle".
\row
@@ -48,18 +48,18 @@
The value can be one of the built-in styles, for example \c "Material",
\row
\li \c QT_QUICK_CONTROLS_STYLE_PATH
- \li Specifies a list of additional paths that are used to lookup \l {Styling Qt Quick Controls 2}
- {Qt Quick Controls 2 styles}. Multiple path entries must be \l {QDir::listSeparator}{separated}
+ \li Specifies a list of additional paths that are used to lookup \l {Styling Qt Quick Controls}
+ {Qt Quick Controls styles}. Multiple path entries must be \l {QDir::listSeparator}{separated}
by \c ':' under Unix and \c ';' under Windows. By default, styles are looked up from
\c $QML2_IMPORT_PATH/QtQuick/Controls.2.
\row
\li \c QT_QUICK_CONTROLS_CONF
- \li Specifies the location of the \l {Qt Quick Controls 2 configuration file}.
+ \li Specifies the location of the \l {Qt Quick Controls configuration file}.
By default, the configuration file is loaded from the application's
resources in \c ":/qtquickcontrols2.conf".
\row
\li \c QT_QUICK_CONTROLS_HOVER_ENABLED
- \li Specifies whether Qt Quick Controls 2 use \l {Control::hoverEnabled}{hover effects}.
+ \li Specifies whether Qt Quick Controls use \l {Control::hoverEnabled}{hover effects}.
The value can be set to \c 0 or \c 1 to disable or enable hover effects, respectively.
\endtable
@@ -78,7 +78,7 @@
\section1 Related Information
\list
- \li \l{Styling Qt Quick Controls 2}
- \li \l{Qt Quick Controls 2 Configuration File}
+ \li \l{Styling Qt Quick Controls}
+ \li \l{Qt Quick Controls Configuration File}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-examples.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-examples.qdoc
index b828f32c..2924114f 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-examples.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-examples.qdoc
@@ -31,7 +31,7 @@
\keyword Qt Quick Controls Examples
\title Qt Quick Controls Examples
\keyword Qt Quick Controls 2 Examples
- \brief A collection of examples for \l {Qt Quick Controls 2}
+ \brief A collection of examples for \l {Qt Quick Controls}
- These examples demonstrate creating user interfaces using \l {Qt Quick Controls 2}.
+ These examples demonstrate creating user interfaces using \l {Qt Quick Controls}.
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc
index cfcfa149..d73d1abe 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-fileselectors.qdoc
@@ -27,11 +27,11 @@
/*!
\page qtquickcontrols2-fileselectors.html
- \title Using File Selectors with Qt Quick Controls 2
+ \title Using File Selectors with Qt Quick Controls
\l {QFileSelector}{File selectors} provide a convenient way of selecting
file variants. Qt offers the platform name and the locale as built-in
- selectors. Qt Quick Controls 2 extends the built-in selectors with the name
+ selectors. Qt Quick Controls extends the built-in selectors with the name
(lowercase) of the style that an application is running with.
By using file selectors, style-specific tweaks can be applied without
@@ -41,7 +41,7 @@
to some code duplication, but on the other hand, cuts the aforementioned
hard dependency to the style, and leads to simpler and more efficient
QML code. The same technique is used to implement the \l {Styling Qt
- Quick Controls 2}{Qt Quick Controls 2 styles}.
+ Quick Controls}{Qt Quick Controls styles}.
The following example demonstrates a custom rounded button that has a
styled drop shadow in the \l {Material Style}{Material style}, and looks
@@ -136,6 +136,6 @@
\list
\li \l {QFileSelector}
\li \l {QQmlFileSelector}
- \li \l {Styling Qt Quick Controls 2}
+ \li \l {Styling Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-focus.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-focus.qdoc
index 7883db71..77bc9883 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-focus.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-focus.qdoc
@@ -27,10 +27,11 @@
/*!
\page qtquickcontrols2-focus.html
- \title Focus Management in Qt Quick Controls 2
- \brief Overview of focus handling with Qt Quick Controls 2
+ \keyword Focus Management in Qt Quick Controls 2
+ \title Focus Management in Qt Quick Controls
+ \brief Overview of focus handling with Qt Quick Controls
- Qt Quick Controls 2 follows the standard
+ Qt Quick Controls follows the standard
\l {Keyboard Focus in Qt Quick}{Qt Quick focus system}, while also
providing some added convenience. For example, the
\l {Control::}{focusPolicy} property can be used to control the ways in
@@ -38,7 +39,7 @@
\section1 Focus Scope Controls
- Qt Quick Controls 2 offers a selection of controls that act as
+ Qt Quick Controls offers a selection of controls that act as
\l {Acquiring Focus and Focus Scopes}{focus scopes}:
\annotatedlist qtquickcontrols2-focusscopes
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc
index 043aaed2..135cae71 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-fusion.qdoc
@@ -38,7 +38,7 @@
\image qtquickcontrols2-fusion.png
To run an application with the Fusion style, see
- \l {Using Styles in Qt Quick Controls 2}.
+ \l {Using Styles in Qt Quick Controls}.
\note The Fusion style is not a native desktop style. The style runs on any
platform, and looks similar everywhere. Minor differences may occur due to
@@ -88,6 +88,6 @@
\section1 Related Information
\list
- \li \l{Styling Qt Quick Controls 2}
+ \li \l{Styling Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc
index fecad927..22187bf4 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-gettingstarted.qdoc
@@ -27,7 +27,8 @@
/*!
\page qtquickcontrols2-gettingstarted.html
- \title Getting Started with Qt Quick Controls 2
+ \keyword Getting Started with Qt Quick Controls 2
+ \title Getting Started with Qt Quick Controls
A basic example of a QML file that makes use of controls is shown here:
@@ -54,7 +55,7 @@
C++ application, doing this means you can only set window properties from
C++.
- With Qt Quick Controls 2, declare an ApplicationWindow as the root item of
+ With Qt Quick Controls, declare an ApplicationWindow as the root item of
your application and launch it by using QQmlApplicationEngine instead.
This ensures that you can control top level window properties from QML.
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-guidelines.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-guidelines.qdoc
index 034ed0f9..83d6db93 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-guidelines.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-guidelines.qdoc
@@ -31,7 +31,7 @@
\title Qt Quick Controls Guidelines
\keyword Qt Quick Controls 2 Guidelines
- Qt Quick Controls 2 offers a selection of controls that can be used to
+ Qt Quick Controls offers a selection of controls that can be used to
build complete interfaces in Qt Quick.
Below you will find practical guidelines on how and when to use
@@ -41,6 +41,6 @@
\section1 Related Information
\list
- \li \l{Qt Quick Controls 2 QML Types}{All Qt Quick Controls 2 QML Types}
+ \li \l{Qt Quick Controls QML Types}{All Qt Quick Controls QML Types}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-highdpi.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-highdpi.qdoc
index 474894f5..f0440e4f 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-highdpi.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-highdpi.qdoc
@@ -27,9 +27,10 @@
/*!
\page qtquickcontrols2-highdpi.html
- \title High-DPI Support in Qt Quick Controls 2
+ \keyword High-DPI Support in Qt Quick Controlsi 2
+ \title High-DPI Support in Qt Quick Controls
- Qt Quick Controls 2 support Qt's cross-platform high-DPI scaling introduced in Qt 5.6.
+ Qt Quick Controls support Qt's cross-platform high-DPI scaling introduced in Qt 5.6.
The feature is opt-in, and can be enabled by setting the \c Qt::AA_EnableHighDpiScaling
application attribute in C++ before QGuiApplication is constructed:
@@ -52,7 +53,7 @@
\warning \l {Qt Quick Controls}{Qt Quick Controls 1.x} are not compatible with Qt's
automatic high-DPI scaling. There is currently no available solution for high-DPI
- support in applications wishing to mix Qt Quick Controls and Qt Quick Controls 2.
+ support in applications wishing to mix Qt Quick Controls and Qt Quick Controls.
\section1 Related Information
\list
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc
index 5e62a2ce..f8cb1f52 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-icons.qdoc
@@ -27,11 +27,12 @@
/*!
\page qtquickcontrols2-icons.html
- \title Icons in Qt Quick Controls 2
+ \keyword Icons in Qt Quick Controls 2
+ \title Icons in Qt Quick Controls
- Qt Quick Controls 2.3 (Qt 5.10) introduced built-in support for icons. Buttons,
- item delegates, and menu items are now capable of presenting an icon in addition
- to a text label.
+ Qt Quick Controls comes with support for icons since Qt 5.10. This means,
+ Buttons, item delegates, and menu items are now capable of presenting an
+ icon in addition to a text label.
\section1 Using Icons
@@ -58,7 +59,7 @@
}
\endcode
- Each \l {Styling Qt Quick Controls 2}{Qt Quick Controls 2 style} requests a
+ Each \l {Styling Qt Quick Controls}{Qt Quick Controls 2 style} requests a
default icon size and color according to their guidelines, but it is possible
to override these by setting the \c icon.width, \c icon.height, and \c icon.color
properties.
@@ -159,11 +160,11 @@
}
\endcode
- The \l {Qt Quick Controls 2 - Gallery}{Gallery example} and \l {Qt Quick Controls 2 - Wearable Demo}
+ The \l {Qt Quick Controls - Gallery}{Gallery example} and \l {Qt Quick Controls 2 - Wearable Demo}
{Wearable Demo} provide complete runnable applications with a bundled icon theme.
\section1 Related Information
\list
- \li \l {High-DPI Support in Qt Quick Controls 2}
+ \li \l {High-DPI Support in Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
index 2a9f1c5d..6e15762d 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
@@ -50,7 +50,7 @@
\caption The Imagine style with the default images
To run an application with the Imagine style, see
- \l {Using Styles in Qt Quick Controls 2}.
+ \l {Using Styles in Qt Quick Controls}.
\section2 File Names
@@ -2387,7 +2387,7 @@
See Sketch's \l {https://sketchapp.com/docs/exporting/}{Exporting} documentation.
- Qt Quick Controls 2 also provides a
+ Qt Quick Controls also provides a
\l {http://code.qt.io/cgit/qt/qtquickcontrols2.git/tree/src/imports/controls/imagine/design}
{plugin} for Sketch that automatically fixes the thickness of the 9-patch lines
after the assets are exported. To install this file, double-click on it.
@@ -2463,7 +2463,7 @@
\include qquickimaginestyle.qdocinc conf
- See \l {Qt Quick Controls 2 Configuration File} for more details about the
+ See \l {Qt Quick Controls Configuration File} for more details about the
configuration file.
\section4 Environment Variables
@@ -2471,7 +2471,7 @@
\include qquickimaginestyle.qdocinc env
- See \l {Supported Environment Variables in Qt Quick Controls 2} for the full
+ See \l {Supported Environment Variables in Qt Quick Controls} for the full
list of supported environment variables.
\section3 Palette
@@ -2499,11 +2499,11 @@
If the Imagine style is imported in a QML file that is always loaded, the
Imagine style must be deployed with the application in order to be able
to run the application regardless of which style the application is run with.
- By using \l {Using File Selectors with Qt Quick Controls 2}{file selectors},
+ By using \l {Using File Selectors with Qt Quick Controls}{file selectors},
style-specific tweaks can be applied without creating a hard dependency to
a style.
- \b {See also} \l {Styling Qt Quick Controls 2}
+ \b {See also} \l {Styling Qt Quick Controls}
\section1 Attached Property Documentation
@@ -2522,8 +2522,8 @@
\section1 Related Information
\list
- \li \l{Styling Qt Quick Controls 2}
- \li \l{Qt Quick Controls 2 - Imagine Style Example: Automotive}{Automotive Example}
- \li \l{Qt Quick Controls 2 - Imagine Style Example: Music Player}{Music Player Example}
+ \li \l{Styling Qt Quick Controls}
+ \li \l{Qt Quick Controls - Imagine Style Example: Automotive}{Automotive Example}
+ \li \l{Qt Quick Controls - Imagine Style Example: Music Player}{Music Player Example}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
index 452afb18..395f3b36 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-index.qdoc
@@ -32,25 +32,25 @@
\brief Provides a set of UI controls for Qt Quick.
- Qt Quick Controls 2 provides a set of controls that can be used
+ Qt Quick Controls provides a set of controls that can be used
to build complete interfaces in Qt Quick. The module was introduced
in Qt 5.7.
\image qtquickcontrols2-styles.png
- Qt Quick Controls 2 comes with a selection customizable styles.
- See \l {Styling Qt Quick Controls 2} for more details.
+ Qt Quick Controls comes with a selection customizable styles.
+ See \l {Styling Qt Quick Controls} for more details.
\section1 Prerequisites
- The \l{Qt Quick Controls 2 QML Types}{QML types} can be imported into your
+ 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:
\code \QtMinorVersion
import QtQuick.Controls 2.\1
\endcode
- The \l{Qt Quick Controls 2 C++ Classes}{C++ classes} can be included into
+ The \l{Qt Quick Controls C++ Classes}{C++ classes} can be included into
your application using the following include statement:
\code
@@ -64,12 +64,12 @@
QT += quickcontrols2
\endcode
- For more details, see \l {Getting Started with Qt Quick Controls 2}.
+ 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
- is also built, as Qt Quick Controls 2 requires it.
+ is also built, as Qt Quick Controls requires it.
The \l {Qt Image Formats} module is recommended, but not
required. It provides support for the \c {.webp} format used by the
@@ -77,8 +77,8 @@
\section1 Versions
- Qt Quick Controls 2.0 was introduced in Qt 5.7. Subsequent minor Qt releases
- increment the import version of the Qt Quick Controls 2 modules by one,
+ Qt Quick Controls.0 was introduced in Qt 5.7. Subsequent minor Qt releases
+ increment the import version of the Qt Quick Controls modules by one,
until Qt 5.12, where the import versions match Qt's minor version. The
experimental Qt Labs modules use import version 1.0.
@@ -86,7 +86,7 @@
\header
\li \c Qt
\li \l {Qt Quick QML Types}{\c QtQuick}
- \li \l {Qt Quick Controls 2 QML Types}{\c QtQuick.Controls},\br
+ \li \l {Qt Quick Controls QML Types}{\c QtQuick.Controls},\br
\l {Material Style}{\c QtQuick.Controls.Material},\br
\l {Universal Style}{\c QtQuick.Controls.Universal},\br
\l {Qt Quick Templates 2 QML Types}{\c QtQuick.Templates}
@@ -131,13 +131,13 @@
\section1 License and Attributions
- Qt Quick Controls 2 is available under commercial licenses from \l{The Qt Company}.
+ Qt Quick Controls is available under commercial licenses from \l{The Qt Company}.
In addition, it is available under the
\l{GNU Lesser General Public License, version 3}, or
the \l{GNU General Public License, version 2}.
See \l{Qt Licensing} for further details.
- Furthermore Qt Quick Controls 2 potentially contains third party
+ Furthermore Qt Quick Controls potentially contains third party
modules under following permissive licenses:
\generatelist{groupsbymodule attributions-qtquickcontrols}
@@ -145,35 +145,35 @@
\section1 Topics
\list
- \li \l{Qt Quick Controls 2 Guidelines}{Guidelines}
- \li \l{Styling Qt Quick Controls 2}{Styling}
- \li \l{Icons in Qt Quick Controls 2}{Icons}
- \li \l{Customizing Qt Quick Controls 2}{Customization}
- \li \l{High-DPI Support in Qt Quick Controls 2}{High-DPI Support}
- \li \l{Using File Selectors with Qt Quick Controls 2}{Using File Selectors}
- \li \l{Deploying Qt Quick Controls 2 Applications}{Deployment}
- \li \l{Qt Quick Controls 2 Configuration File}{Configuration File}
- \li \l{Supported Environment Variables in Qt Quick Controls 2}{Environment Variables}
+ \li \l{Qt Quick Controls Guidelines}{Guidelines}
+ \li \l{Styling Qt Quick Controls}{Styling}
+ \li \l{Icons in Qt Quick Controls}{Icons}
+ \li \l{Customizing Qt Quick Controls}{Customization}
+ \li \l{High-DPI Support in Qt Quick Controls}{High-DPI Support}
+ \li \l{Using File Selectors with Qt Quick Controls}{Using File Selectors}
+ \li \l{Deploying Qt Quick Controls Applications}{Deployment}
+ \li \l{Qt Quick Controls Configuration File}{Configuration File}
+ \li \l{Supported Environment Variables in Qt Quick Controls}{Environment Variables}
\li \l{Differences with Qt Quick Controls 1}
\endlist
\section1 Reference
\list
- \li \l{Qt Quick Controls 2 QML Types}{QML Types}
- \li \l{Qt Quick Controls 2 C++ Classes}{C++ Classes}
+ \li \l{Qt Quick Controls QML Types}{QML Types}
+ \li \l{Qt Quick Controls C++ Classes}{C++ Classes}
\endlist
\section1 Examples
\list
- \li \l{Qt Quick Controls 2 - Gallery}{Gallery}
- \li \l{Qt Quick Controls 2 - Chat Tutorial}{Chat Tutorial}
- \li \l{Qt Quick Controls 2 - Text Editor}{Text Editor}
- \li \l{Qt Quick Controls 2 - Wearable Demo}{Wearable Demo}
- \li \l{Qt Quick Controls 2 - Imagine Style Example: Automotive}{Automotive Example}
- \li \l{Qt Quick Controls 2 - Imagine Style Example: Music Player}{Music Player Example}
- \li \l{Qt Quick Controls 2 Examples}{All Examples}
+ \li \l{Qt Quick Controls - Gallery}{Gallery}
+ \li \l{Qt Quick Controls - Chat Tutorial}{Chat Tutorial}
+ \li \l{Qt Quick Controls - Text Editor}{Text Editor}
+ \li \l{Qt Quick Controls - Wearable Demo}{Wearable Demo}
+ \li \l{Qt Quick Controls - Imagine Style Example: Automotive}{Automotive Example}
+ \li \l{Qt Quick Controls - Imagine Style Example: Music Player}{Music Player Example}
+ \li \l{Qt Quick Controls Examples}{All Examples}
\endlist
\section1 Related Modules
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc
index 54ac0a5a..9f9e357b 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-indicators.qdoc
@@ -31,7 +31,7 @@
\ingroup qtquickcontrols2-guidelines
\brief Guidelines for indicator controls
- Qt Quick Controls 2 offers a selection of indicator-like controls.
+ Qt Quick Controls offers a selection of indicator-like controls.
\annotatedlist qtquickcontrols2-indicators
@@ -78,6 +78,6 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 Guidelines}
+ \li \l {Qt Quick Controls Guidelines}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc
index 60cd586d..6bc037e0 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-input.qdoc
@@ -31,7 +31,7 @@
\ingroup qtquickcontrols2-guidelines
\brief Guidelines for input controls
- Qt Quick Controls 2 offers a variety of input controls for both numeric
+ Qt Quick Controls offers a variety of input controls for both numeric
and textual input.
\annotatedlist qtquickcontrols2-input
@@ -118,6 +118,6 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 Guidelines}
+ \li \l {Qt Quick Controls Guidelines}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc
index d9e34a5f..a146843a 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-material.qdoc
@@ -67,10 +67,10 @@
\endtable
To run an application with the Material style, see
- \l {Using Styles in Qt Quick Controls 2}.
+ \l {Using Styles in Qt Quick Controls}.
\note The Material style is not a native Android style. The Material
- style is a 100% cross-platform Qt Quick Controls 2 style implementation that
+ style is a 100% cross-platform Qt Quick Controls style implementation that
follows the Google Material Design Guidelines. The style runs on any
platform, and looks more or less identical everywhere. Minor differences
may occur due to differences in available system fonts and font rendering
@@ -124,14 +124,14 @@
\include qquickmaterialstyle.qdocinc conf
- See \l {Qt Quick Controls 2 Configuration File} for more details about the
+ See \l {Qt Quick Controls Configuration File} for more details about the
configuration file.
\section3 Environment Variables
\include qquickmaterialstyle.qdocinc env
- See \l {Supported Environment Variables in Qt Quick Controls 2} for the full
+ See \l {Supported Environment Variables in Qt Quick Controls} for the full
list of supported environment variables.
\section2 Dependency
@@ -145,7 +145,7 @@
If the Material style is imported in a QML file that is always loaded, the
Material style must be deployed with the application in order to be able
to run the application regardless of which style the application is run with.
- By using \l {Using File Selectors with Qt Quick Controls 2}{file selectors},
+ By using \l {Using File Selectors with Qt Quick Controls}{file selectors},
style-specific tweaks can be applied without creating a hard dependency to
a style.
@@ -232,7 +232,7 @@
To use the dense variant, either set the
\c QT_QUICK_CONTROLS_MATERIAL_VARIANT environment variable to \c Dense,
or specify \c Variant=Dense in the
- \l {Qt Quick Controls 2 Configuration File}{qtquickcontrols2.conf} file.
+ \l {Qt Quick Controls Configuration File}{qtquickcontrols2.conf} file.
The default value in both cases is \c Normal.
The following images illustrate the differences between some of the
@@ -399,6 +399,6 @@
\section1 Related Information
\list
- \li \l{Styling Qt Quick Controls 2}
+ \li \l{Styling Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-navigation.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-navigation.qdoc
index 7cc84ed6..95928d13 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-navigation.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-navigation.qdoc
@@ -31,7 +31,7 @@
\ingroup qtquickcontrols2-guidelines
\brief Guidelines for navigation controls
- Qt Quick Controls 2 offers a selection of navigation models.
+ Qt Quick Controls offers a selection of navigation models.
\annotatedlist qtquickcontrols2-navigation
@@ -55,7 +55,7 @@
scrolling. The page indicator on the bottom shows which is the presently
active page.
- \section1 TabBar
+ \section1 TabBar Control
\image qtquickcontrols2-tabbar-wireframe.png
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-popups.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-popups.qdoc
index bdcee545..c26b4c4b 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-popups.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-popups.qdoc
@@ -94,6 +94,6 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 Guidelines}
+ \li \l {Qt Quick Controls Guidelines}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc
index a28b2974..c8c44264 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-qmltypes.qdoc
@@ -31,13 +31,13 @@
\title Qt Quick Controls QML Types
\keyword Qt Quick Controls 2 QML Types
\ingroup qmlmodules
- \brief Provides QML types for user interfaces (Qt Quick Controls 2).
+ \brief Provides QML types for user interfaces (Qt Quick Controls).
- \l{Qt Quick Controls 2} provides QML types for creating user interfaces.
+ \l{Qt Quick Controls} provides QML types for creating user interfaces.
These QML types work in conjunction with \l{Qt Quick} and
\l{Qt Quick Layouts}.
- Qt Quick Controls 2 QML types can be imported into your application
+ Qt Quick Controls QML types can be imported into your application
using the following import statement in your .qml file:
\badcode \QtMinorVersion
@@ -48,11 +48,11 @@
\generatelist {qmltypesbymodule QtQuick.Controls}
\noautolist
- For more information on the Qt Quick Controls 2 module, see the
- \l {Qt Quick Controls 2} module documentation.
+ For more information on the Qt Quick Controls module, see the
+ \l {Qt Quick Controls} module documentation.
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 Guidelines}
+ \li \l {Qt Quick Controls Guidelines}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc
index 03c6829c..481a744e 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-separators.qdoc
@@ -31,7 +31,7 @@
\ingroup qtquickcontrols2-guidelines
\brief Guidelines for separator controls
- Qt Quick Controls 2 offers a selection of separators.
+ Qt Quick Controls offers a selection of separators.
\annotatedlist qtquickcontrols2-separators
@@ -58,6 +58,6 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 Guidelines}
+ \li \l {Qt Quick Controls Guidelines}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
index a1a74ec9..27731e42 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
@@ -27,23 +27,23 @@
/*!
\page qtquickcontrols2-styles.html
- \title Styling Qt Quick Controls 2
+ \title Styling Qt Quick Controls
\section1 Available Styles
- Qt Quick Controls 2 comes with a selection of styles.
+ Qt Quick Controls comes with a selection of styles.
\section2 Default Style
\image qtquickcontrols2-default-thumbnail.png
The \l {Default Style} is a simple and light-weight all-round style that offers
- the maximum performance for Qt Quick Controls 2.
+ the maximum performance for Qt Quick Controls.
\section2 Fusion Style
\image qtquickcontrols2-fusion-thumbnail.png
The \l {Fusion Style} is a platform-agnostic style that offers a desktop-oriented
- look'n'feel for Qt Quick Controls 2.
+ look'n'feel for Qt Quick Controls.
\section2 Imagine Style
@@ -67,7 +67,7 @@
\l {https://dev.windows.com/design}{Microsoft Universal Design Guidelines},
but requires more system resources than the Default style.
- \section1 Using Styles in Qt Quick Controls 2
+ \section1 Using Styles in Qt Quick Controls
In order to run an application with a specific style, either configure the
style using \l QQuickStyle in C++, pass a command line argument, or set an
@@ -81,7 +81,7 @@
\section2 Using QQuickStyle in C++
\l QQuickStyle provides C++ API for configuring a specific style. The following
- example runs a Qt Quick Controls 2 application with the Material style:
+ example runs a Qt Quick Controls application with the Material style:
\code
QQuickStyle::setStyle("Material");
@@ -93,7 +93,7 @@
Passing a \c -style command line argument is the convenient way to test different
styles. It takes precedence over the other methods listed below. The following
- example runs a Qt Quick Controls 2 application with the Material style:
+ example runs a Qt Quick Controls application with the Material style:
\code
./app -style material
@@ -103,19 +103,19 @@
Setting the \c QT_QUICK_CONTROLS_STYLE environment variable can be used to set
a system-wide style preference. It takes precedence over the configuration file
- mentioned below. The following example runs a Qt Quick Controls 2 application with
+ mentioned below. The following example runs a Qt Quick Controls application with
the Universal style:
\code
QT_QUICK_CONTROLS_STYLE=universal ./app
\endcode
- See \l {Supported Environment Variables in Qt Quick Controls 2} for the full list
+ See \l {Supported Environment Variables in Qt Quick Controls} for the full list
of supported environment variables.
\section2 Configuration file
- Qt Quick Controls 2 support a special configuration file, \c :/qtquickcontrols2.conf,
+ Qt Quick Controls support a special configuration file, \c :/qtquickcontrols2.conf,
that is built into an application's resources.
The configuration file can specify the preferred style (may be overridden by either
@@ -127,7 +127,7 @@
Style=Material
\endcode
- See \l {Qt Quick Controls 2 Configuration File} for more details about the
+ See \l {Qt Quick Controls Configuration File} for more details about the
configuration file.
\section1 Related Information
@@ -137,10 +137,10 @@
\li \l {Imagine Style}
\li \l {Material Style}
\li \l {Universal Style}
- \li \l {Customizing Qt Quick Controls 2}
- \li \l {Using File Selectors with Qt Quick Controls 2}
- \li \l {Deploying Qt Quick Controls 2 Applications}
- \li \l {Qt Quick Controls 2 Configuration File}
- \li \l {Supported Environment Variables in Qt Quick Controls 2}
+ \li \l {Customizing Qt Quick Controls}
+ \li \l {Using File Selectors with Qt Quick Controls}
+ \li \l {Deploying Qt Quick Controls Applications}
+ \li \l {Qt Quick Controls Configuration File}
+ \li \l {Supported Environment Variables in Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc
index f1bfb1c8..1e67dd75 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-universal.qdoc
@@ -66,10 +66,10 @@
\endtable
To run an application with the Universal style, see
- \l {Using Styles in Qt Quick Controls 2}.
+ \l {Using Styles in Qt Quick Controls}.
\note The Universal style is not a native Windows 10 style. The Universal
- style is a 100% cross-platform Qt Quick Controls 2 style implementation that
+ style is a 100% cross-platform Qt Quick Controls style implementation that
follows the Microsoft Universal Design Guidelines. The style runs on any
platform, and looks more or less identical everywhere. Minor differences
may occur due to differences in available system fonts and font rendering
@@ -123,14 +123,14 @@
\include qquickuniversalstyle.qdocinc conf
- See \l {Qt Quick Controls 2 Configuration File} for more details about the
+ See \l {Qt Quick Controls Configuration File} for more details about the
configuration file.
\section3 Environment Variables
\include qquickuniversalstyle.qdocinc env
- See \l {Supported Environment Variables in Qt Quick Controls 2} for the full
+ See \l {Supported Environment Variables in Qt Quick Controls} for the full
list of supported environment variables.
\section2 Dependency
@@ -144,7 +144,7 @@
If the Universal style is imported in a QML file that is always loaded, the
Universal style must be deployed with the application in order to be able
to run the application regardless of which style the application is run with.
- By using \l {Using File Selectors with Qt Quick Controls 2}{file selectors},
+ By using \l {Using File Selectors with Qt Quick Controls}{file selectors},
style-specific tweaks can be applied without creating a hard dependency to
a style.
@@ -283,6 +283,6 @@
\section1 Related Information
\list
- \li \l{Styling Qt Quick Controls 2}
+ \li \l{Styling Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/controls/material/CursorDelegate.qml b/src/imports/controls/material/CursorDelegate.qml
index 1626a6fb..fe2d25c6 100644
--- a/src/imports/controls/material/CursorDelegate.qml
+++ b/src/imports/controls/material/CursorDelegate.qml
@@ -46,7 +46,7 @@ Rectangle {
Connections {
target: cursor.parent
- onCursorPositionChanged: {
+ function onCursorPositionChanged() {
// keep a moving cursor visible
cursor.opacity = 1
timer.restart()
diff --git a/src/imports/platform/doc/src/qtlabsplatform-index.qdoc b/src/imports/platform/doc/src/qtlabsplatform-index.qdoc
index b5fd3046..7b3f78fb 100644
--- a/src/imports/platform/doc/src/qtlabsplatform-index.qdoc
+++ b/src/imports/platform/doc/src/qtlabsplatform-index.qdoc
@@ -45,6 +45,6 @@
\list
\li \l{Qt Quick}
- \li \l{Qt Quick Controls 2}
+ \li \l{Qt Quick Controls}
\endlist
*/
diff --git a/src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc b/src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc
index 57f011ef..dec67b72 100644
--- a/src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc
+++ b/src/imports/platform/doc/src/qtlabsplatform-qmltypes.qdoc
@@ -33,7 +33,7 @@
The experimental \l{Qt Labs Platform} module provides QML types for native
platform extensions. These QML types work in conjunction with \l{Qt Quick}
- and \l{Qt Quick Controls 2}.
+ and \l{Qt Quick Controls}.
The QML types can be imported into your application using the
following import statement in your .qml file:
@@ -51,7 +51,7 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 QML Types}
+ \li \l {Qt Quick Controls QML Types}
\endlist
\noautolist
diff --git a/src/imports/platform/qtlabsplatformplugin.cpp b/src/imports/platform/qtlabsplatformplugin.cpp
index b92c1ea0..98d5dcc4 100644
--- a/src/imports/platform/qtlabsplatformplugin.cpp
+++ b/src/imports/platform/qtlabsplatformplugin.cpp
@@ -83,7 +83,7 @@ void QtLabsPlatformPlugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<QQuickPlatformDialog>(uri, 1, 0, "Dialog", QQuickPlatformDialog::tr("Dialog is an abstract base class"));
qmlRegisterType<QQuickPlatformColorDialog>(uri, 1, 0, "ColorDialog");
qmlRegisterType<QQuickPlatformFileDialog>(uri, 1, 0, "FileDialog");
- qmlRegisterType<QQuickPlatformFileNameFilter>();
+ qmlRegisterAnonymousType<QQuickPlatformFileNameFilter>(uri, 1);
qmlRegisterType<QQuickPlatformFolderDialog>(uri, 1, 0, "FolderDialog");
qmlRegisterType<QQuickPlatformFontDialog>(uri, 1, 0, "FontDialog");
qmlRegisterType<QQuickPlatformMessageDialog>(uri, 1, 0, "MessageDialog");
@@ -107,7 +107,7 @@ void QtLabsPlatformPlugin::registerTypes(const char *uri)
qRegisterMetaType<QPlatformSystemTrayIcon::MessageIcon>();
#endif
- qmlRegisterType<QQuickPlatformIcon>();
+ qmlRegisterAnonymousType<QQuickPlatformIcon>(uri, 1);
qRegisterMetaType<QQuickPlatformIcon>();
}
diff --git a/src/imports/templates/doc/src/qtquicktemplates2-index.qdoc b/src/imports/templates/doc/src/qtquicktemplates2-index.qdoc
index d017a338..492785a4 100644
--- a/src/imports/templates/doc/src/qtquicktemplates2-index.qdoc
+++ b/src/imports/templates/doc/src/qtquicktemplates2-index.qdoc
@@ -30,7 +30,7 @@
\title Qt Quick Templates 2
\brief A set of templates to create user interface controls in Qt Quick
- Qt Quick Templates are the foundations of \l {Qt Quick Controls 2}. Templates
+ Qt Quick Templates are the foundations of \l {Qt Quick Controls}. Templates
are non-visual implementations of controls' logic and behavior. They offer
an interface to visualize the controls in QML using \l {Qt Quick}.
@@ -48,7 +48,7 @@
\list
\li \l{Qt Quick}
- \li \l{Qt Quick Controls 2}
+ \li \l{Qt Quick Controls}
\li \l{Qt Quick Templates 2 QML Types}
\endlist
*/
diff --git a/src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc b/src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc
index 33ee08d3..1288e937 100644
--- a/src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc
+++ b/src/imports/templates/doc/src/qtquicktemplates2-qmltypes.qdoc
@@ -56,7 +56,7 @@
\section1 Related Information
\list
- \li \l {Qt Quick Controls 2 QML Types}
+ \li \l {Qt Quick Controls QML Types}
\endlist
\noautolist
diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp
index b163470b..470e86e0 100644
--- a/src/imports/templates/qtquicktemplates2plugin.cpp
+++ b/src/imports/templates/qtquicktemplates2plugin.cpp
@@ -169,11 +169,11 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
// QtQuick.Templates 2.0 (originally introduced in Qt 5.7)
qmlRegisterType<QQuickAbstractButton>(uri, 2, 0, "AbstractButton");
qmlRegisterType<QQuickApplicationWindow>(uri, 2, 0, "ApplicationWindow");
- qmlRegisterType<QQuickApplicationWindowAttached>();
+ qmlRegisterAnonymousType<QQuickApplicationWindowAttached>(uri, 2);
qmlRegisterType<QQuickBusyIndicator>(uri, 2, 0, "BusyIndicator");
qmlRegisterType<QQuickButton>(uri, 2, 0, "Button");
qmlRegisterType<QQuickButtonGroup>(uri, 2, 0, "ButtonGroup");
- qmlRegisterType<QQuickButtonGroupAttached>();
+ qmlRegisterAnonymousType<QQuickButtonGroupAttached>(uri, 2);
qmlRegisterType<QQuickCheckBox>(uri, 2, 0, "CheckBox");
qmlRegisterType<QQuickCheckDelegate>(uri, 2, 0, "CheckDelegate");
qmlRegisterType<QQuickComboBox>(uri, 2, 0, "ComboBox");
@@ -187,7 +187,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterType<QQuickLabel>(uri, 2, 0, "Label");
qmlRegisterType<QQuickMenu>(uri, 2, 0, "Menu");
qmlRegisterType<QQuickMenuItem>(uri, 2, 0, "MenuItem");
- qmlRegisterType<QQuickOverlay>();
+ qmlRegisterAnonymousType<QQuickOverlay>(uri, 2);
qmlRegisterType<QQuickPage>(uri, 2, 0, "Page");
qmlRegisterType<QQuickPageIndicator>(uri, 2, 0, "PageIndicator");
qmlRegisterType<QQuickPane>(uri, 2, 0, "Pane");
@@ -196,33 +196,33 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterType<QQuickRadioButton>(uri, 2, 0, "RadioButton");
qmlRegisterType<QQuickRadioDelegate>(uri, 2, 0, "RadioDelegate");
qmlRegisterType<QQuickRangeSlider>(uri, 2, 0, "RangeSlider");
- qmlRegisterType<QQuickRangeSliderNode>();
+ qmlRegisterAnonymousType<QQuickRangeSliderNode>(uri, 2);
qmlRegisterType<QQuickScrollBar>(uri, 2, 0, "ScrollBar");
- qmlRegisterType<QQuickScrollBarAttached>();
+ qmlRegisterAnonymousType<QQuickScrollBarAttached>(uri, 2);
qmlRegisterType<QQuickScrollIndicator>(uri, 2, 0, "ScrollIndicator");
- qmlRegisterType<QQuickScrollIndicatorAttached>();
+ qmlRegisterAnonymousType<QQuickScrollIndicatorAttached>(uri, 2);
qmlRegisterType<QQuickSlider>(uri, 2, 0, "Slider");
qmlRegisterType<QQuickSpinBox>(uri, 2, 0, "SpinBox");
- qmlRegisterType<QQuickSpinButton>();
+ qmlRegisterAnonymousType<QQuickSpinButton>(uri, 2);
qmlRegisterType<QQuickStackView>(uri, 2, 0, "StackView");
- qmlRegisterType<QQuickStackViewAttached>();
- qmlRegisterType<QQuickSwipe>();
+ qmlRegisterAnonymousType<QQuickStackViewAttached>(uri, 2);
+ qmlRegisterAnonymousType<QQuickSwipe>(uri, 2);
qmlRegisterType<QQuickSwipeDelegate>(uri, 2, 0, "SwipeDelegate");
qmlRegisterType<QQuickSwipeView>(uri, 2, 0, "SwipeView");
- qmlRegisterType<QQuickSwipeViewAttached>();
+ qmlRegisterAnonymousType<QQuickSwipeViewAttached>(uri, 2);
qmlRegisterType<QQuickSwitch>(uri, 2, 0, "Switch");
qmlRegisterType<QQuickSwitchDelegate>(uri, 2, 0, "SwitchDelegate");
qmlRegisterType<QQuickTabBar>(uri, 2, 0, "TabBar");
qmlRegisterType<QQuickTabButton>(uri, 2, 0, "TabButton");
qmlRegisterType<QQuickTextArea>(uri, 2, 0, "TextArea");
- qmlRegisterType<QQuickTextAreaAttached>();
+ qmlRegisterAnonymousType<QQuickTextAreaAttached>(uri, 2);
qmlRegisterType<QQuickTextField>(uri, 2, 0, "TextField");
qmlRegisterType<QQuickToolBar>(uri, 2, 0, "ToolBar");
qmlRegisterType<QQuickToolButton>(uri, 2, 0, "ToolButton");
qmlRegisterType<QQuickToolTip>(uri, 2, 0, "ToolTip");
- qmlRegisterType<QQuickToolTipAttached>();
+ qmlRegisterAnonymousType<QQuickToolTipAttached>(uri, 2);
#if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview)
- qmlRegisterType<QQuickTumblerAttached>();
+ qmlRegisterAnonymousType<QQuickTumblerAttached>(uri, 2);
qmlRegisterType<QQuickTumbler>(uri, 2, 0, "Tumbler");
#endif
@@ -241,7 +241,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterType<QQuickContainer, 1>(uri, 2, 1, "Container");
qmlRegisterType<QQuickDialog>(uri, 2, 1, "Dialog");
qmlRegisterType<QQuickDialogButtonBox>(uri, 2, 1, "DialogButtonBox");
- qmlRegisterType<QQuickDialogButtonBoxAttached>();
+ qmlRegisterAnonymousType<QQuickDialogButtonBoxAttached>(uri, 2);
qmlRegisterType<QQuickMenuSeparator>(uri, 2, 1, "MenuSeparator");
qmlRegisterType<QQuickPage, 1>(uri, 2, 1, "Page");
qmlRegisterType<QQuickPopup, 1>(uri, 2, 1, "Popup");
@@ -281,7 +281,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
// make revisioned properties available to their subclasses (synced with Qt 5.9)
qmlRegisterRevision<QQuickText, 9>(uri, 2, 2);
qmlRegisterRevision<QQuickTextInput, 9>(uri, 2, 2);
- qmlRegisterRevision<QQuickWindowQmlImpl, 2>(uri, 2, 2);
+ qmlRegisterRevision<QQuickWindowQmlImpl, 3>(uri, 2, 2);
// QtQuick.Templates 2.3 (new types and revisions in Qt 5.10)
qmlRegisterType<QQuickAbstractButton, 3>(uri, 2, 3, "AbstractButton");
@@ -293,7 +293,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterType<QQuickContainer, 3>(uri, 2, 3, "Container");
qmlRegisterType<QQuickDialog, 3>(uri, 2, 3, "Dialog");
qmlRegisterType<QQuickDialogButtonBox, 3>(uri, 2, 3, "DialogButtonBox");
- qmlRegisterType<QQuickIcon>();
+ qmlRegisterAnonymousType<QQuickIcon>(uri, 2);
qRegisterMetaType<QQuickIcon>();
qmlRegisterType<QQuickLabel, 3>(uri, 2, 3, "Label");
qmlRegisterType<QQuickMenu, 3>(uri, 2, 3, "Menu");
@@ -301,7 +301,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterType<QQuickMenuBarItem>(uri, 2, 3, "MenuBarItem");
qmlRegisterType<QQuickMenuItem, 3>(uri, 2, 3, "MenuItem");
qmlRegisterUncreatableType<QQuickOverlay>(uri, 2, 3, "Overlay", QStringLiteral("Overlay is only available as an attached property."));
- qmlRegisterType<QQuickOverlayAttached>();
+ qmlRegisterAnonymousType<QQuickOverlayAttached>(uri, 2);
qmlRegisterType<QQuickPopup, 3>(uri, 2, 3, "Popup");
qmlRegisterType<QQuickRangeSlider, 3>(uri, 2, 3, "RangeSlider");
qmlRegisterType<QQuickScrollBar, 3>(uri, 2, 3, "ScrollBar");
@@ -337,7 +337,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
qmlRegisterType<QQuickLabel, 5>(uri, 2, 5, "Label");
qmlRegisterType<QQuickPage, 5>(uri, 2, 5, "Page");
qmlRegisterType<QQuickPopup, 5>(uri, 2, 5, "Popup");
- qmlRegisterType<QQuickPopupAnchors>();
+ qmlRegisterAnonymousType<QQuickPopupAnchors>(uri, 2);
qmlRegisterType<QQuickRangeSlider, 5>(uri, 2, 5, "RangeSlider");
qmlRegisterType<QQuickSlider, 5>(uri, 2, 5, "Slider");
qmlRegisterType<QQuickSpinBox, 5>(uri, 2, 5, "SpinBox");
@@ -347,10 +347,10 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
// QtQuick.Templates 2.13 (new types and revisions in Qt 5.13)
qmlRegisterType<QQuickSplitView>(uri, 2, 13, "SplitView");
- qmlRegisterType<QQuickSplitViewAttached>();
+ qmlRegisterAnonymousType<QQuickSplitViewAttached>(uri, 2);
qmlRegisterUncreatableType<QQuickSplitHandleAttached>(uri, 2, 13, "SplitHandle",
QStringLiteral("SplitHandle is only available as an attached property."));
- qmlRegisterType<QQuickSplitHandleAttached>();
+ qmlRegisterAnonymousType<QQuickSplitHandleAttached>(uri, 2);
// QtQuick.Templates 2.14 (new types and revisions in Qt 5.14)
qmlRegisterType<QQuickComboBox, 14>(uri, 2, 14, "ComboBox");
diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp
index b4901db3..e2b6678b 100644
--- a/src/quickcontrols2/qquickstyle.cpp
+++ b/src/quickcontrols2/qquickstyle.cpp
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
\since 5.7
QQuickStyle provides API for querying and configuring the application
- \l {Styling Qt Quick Controls 2}{styles} of Qt Quick Controls 2.
+ \l {Styling Qt Quick Controls}{styles} of Qt Quick Controls.
\code
#include <QGuiApplication>
@@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE
\endcode
\note The style must be configured \b before loading QML that imports
- Qt Quick Controls 2. It is not possible to change the style after the QML
+ Qt Quick Controls. It is not possible to change the style after the QML
types have been registered.
The style can also be specified as a path to a custom style, such as
@@ -102,7 +102,7 @@ QT_BEGIN_NAMESPACE
QQuickStyle::setFallbackStyle("Material");
\endcode
- \sa {Styling Qt Quick Controls 2}
+ \sa {Styling Qt Quick Controls}
*/
static QStringList envPathList(const QByteArray &var)
@@ -536,10 +536,10 @@ QString QQuickStyle::path()
/*!
Sets the application style to \a style.
- \note The style must be configured \b before loading QML that imports Qt Quick Controls 2.
+ \note The style must be configured \b before loading QML that imports Qt Quick Controls.
It is not possible to change the style after the QML types have been registered.
- \sa setFallbackStyle(), {Using Styles in Qt Quick Controls 2}
+ \sa setFallbackStyle(), {Using Styles in Qt Quick Controls}
*/
void QQuickStyle::setStyle(const QString &style)
{
@@ -555,15 +555,15 @@ void QQuickStyle::setStyle(const QString &style)
\since 5.8
Sets the application fallback style to \a style.
- \note The fallback style must be the name of one of the built-in Qt Quick Controls 2 styles, e.g. "Material".
+ \note The fallback style must be the name of one of the built-in Qt Quick Controls styles, e.g. "Material".
- \note The style must be configured \b before loading QML that imports Qt Quick Controls 2.
+ \note The style must be configured \b before loading QML that imports Qt Quick Controls.
It is not possible to change the style after the QML types have been registered.
The fallback style can be also specified by setting the \c QT_QUICK_CONTROLS_FALLBACK_STYLE
- \l {Supported Environment Variables in Qt Quick Controls 2}{environment variable}.
+ \l {Supported Environment Variables in Qt Quick Controls}{environment variable}.
- \sa setStyle(), {Using Styles in Qt Quick Controls 2}
+ \sa setStyle(), {Using Styles in Qt Quick Controls}
*/
void QQuickStyle::setFallbackStyle(const QString &style)
{
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index 0aa8ec28..2099f2db 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -105,6 +105,7 @@ QT_BEGIN_NAMESPACE
\qmlsignal QtQuick.Controls::AbstractButton::pressAndHold()
This signal is emitted when the button is interactively pressed and held down by the user via touch or mouse.
+ It is not emitted when \l autoRepeat is enabled.
*/
/*!
@@ -658,6 +659,9 @@ void QQuickAbstractButton::setAutoExclusive(bool exclusive)
This property holds whether the button repeats \l pressed(), \l released()
and \l clicked() signals while the button is pressed and held down.
+ If this property is set to \c true, the \l pressAndHold() signal will not
+ be emitted.
+
The default value is \c false.
The initial delay and the repetition interval are defined in milliseconds
@@ -736,7 +740,7 @@ void QQuickAbstractButton::setIndicator(QQuickItem *indicator)
\include qquickicon.qdocinc grouped-properties
- \sa text, display, {Icons in Qt Quick Controls 2}
+ \sa text, display, {Icons in Qt Quick Controls}
*/
QQuickIcon QQuickAbstractButton::icon() const
diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp
index acd98470..0d05bee7 100644
--- a/src/quicktemplates2/qquickapplicationwindow.cpp
+++ b/src/quicktemplates2/qquickapplicationwindow.cpp
@@ -113,7 +113,7 @@ QT_BEGIN_NAMESPACE
attached properties works in any window regardless of its \c id.
\sa {Customizing ApplicationWindow}, Overlay, Page, {Container Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
static const QQuickItemPrivate::ChangeTypes ItemChanges = QQuickItemPrivate::Visibility
diff --git a/src/quicktemplates2/qquickbutton.cpp b/src/quicktemplates2/qquickbutton.cpp
index fbce5225..b4188a95 100644
--- a/src/quicktemplates2/qquickbutton.cpp
+++ b/src/quicktemplates2/qquickbutton.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
\e Yes, \e No, and \e Help.
Button inherits its API from AbstractButton. For instance, you can set
- \l {AbstractButton::text}{text}, display an \l {Icons in Qt Quick Controls 2}{icon},
+ \l {AbstractButton::text}{text}, display an \l {Icons in Qt Quick Controls}{icon},
and react to \l {AbstractButton::clicked}{clicks} using the AbstractButton API.
A button emits the signal \l {AbstractButton::}{clicked()} when it is activated by the user.
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index 71b4eaf1..21eecfe1 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -43,6 +43,7 @@
#include <QtCore/qregularexpression.h>
#include <QtCore/qabstractitemmodel.h>
+#include <QtCore/qglobal.h>
#include <QtGui/qinputmethod.h>
#include <QtGui/qguiapplication.h>
#include <QtGui/qpa/qplatformtheme.h>
@@ -90,21 +91,7 @@ QT_BEGIN_NAMESPACE
The following example demonstrates appending content to an editable
combo box by reacting to the \l accepted signal.
- \code
- ComboBox {
- editable: true
- model: ListModel {
- id: model
- ListElement { text: "Banana" }
- ListElement { text: "Apple" }
- ListElement { text: "Coconut" }
- }
- onAccepted: {
- if (find(editText) === -1)
- model.append({text: editText})
- }
- }
- \endcode
+ \snippet qtquickcontrols2-combobox-accepted.qml combobox
\section1 ComboBox Model Roles
@@ -130,7 +117,7 @@ QT_BEGIN_NAMESPACE
\l textRole is not defined, ComboBox is unable to visualize it and throws a
\c {ReferenceError: modelData is not defined}.
- \sa {Customizing ComboBox}, {Input Controls}, {Focus Management in Qt Quick Controls 2}
+ \sa {Customizing ComboBox}, {Input Controls}, {Focus Management in Qt Quick Controls}
*/
/*!
@@ -163,9 +150,22 @@ QT_BEGIN_NAMESPACE
\qmlsignal void QtQuick.Controls::ComboBox::accepted()
This signal is emitted when the \uicontrol Return or \uicontrol Enter key is pressed
- on an \l editable combo box. If the confirmed string is not currently in the model,
- the \l currentIndex will be set to \c -1 and the \l currentText will be updated
- accordingly.
+ on an \l editable combo box.
+
+ You can handle this signal in order to add the newly entered
+ item to the model, for example:
+
+ \snippet qtquickcontrols2-combobox-accepted.qml combobox
+
+ Before the signal is emitted, a check is done to see if the string
+ exists in the model. If it does, \l currentIndex will be set to its index,
+ and \l currentText to the string itself.
+
+ After the signal has been emitted, and if the first check failed (that is,
+ the item did not exist), another check will be done to see if the item was
+ added by the signal handler. If it was, the \l currentIndex and
+ \l currentText are updated accordingly. Otherwise, they will be set to
+ \c -1 and \c "", respectively.
\note If there is a \l validator set on the combo box, the signal will only be
emitted if the input is in an acceptable state.
@@ -232,6 +232,13 @@ public:
void updateEditText();
void updateCurrentText();
void updateCurrentValue();
+ void updateCurrentText(bool hasDelegateModelObject);
+ void updateCurrentValue(bool hasDelegateModelObject);
+ void updateCurrentTextAndValue();
+
+ bool isValidIndex(int index) const;
+ QString fastTextAt(int index) const;
+ QVariant fastValueAt(int index) const;
void acceptInput();
QString tryComplete(const QString &inputText);
@@ -434,10 +441,34 @@ void QQuickComboBoxPrivate::updateEditText()
q->setEditText(text);
}
+// We have these two rather than just using default arguments
+// because QObjectPrivate::connect() doesn't accept lambdas.
void QQuickComboBoxPrivate::updateCurrentText()
{
+ updateCurrentText(false);
+}
+
+void QQuickComboBoxPrivate::updateCurrentValue()
+{
+ updateCurrentValue(false);
+}
+
+void QQuickComboBoxPrivate::updateCurrentText(bool hasDelegateModelObject)
+{
Q_Q(QQuickComboBox);
- QString text = q->textAt(currentIndex);
+ QString text;
+ // If a delegate model object was passed in, it means the calling code
+ // has decided to reuse it for several function calls to speed things up.
+ // So, use the faster (private) version in that case.
+ // For other cases, we use the version that creates the delegate model object
+ // itself in order to have neater, more convenient calling code.
+ if (isValidIndex(currentIndex)) {
+ if (hasDelegateModelObject)
+ text = fastTextAt(currentIndex);
+ else
+ text = q->textAt(currentIndex);
+ }
+
if (currentText != text) {
currentText = text;
if (!hasDisplayText)
@@ -452,10 +483,19 @@ void QQuickComboBoxPrivate::updateCurrentText()
q->setEditText(currentText);
}
-void QQuickComboBoxPrivate::updateCurrentValue()
+void QQuickComboBoxPrivate::updateCurrentValue(bool hasDelegateModelObject)
{
Q_Q(QQuickComboBox);
- const QVariant value = q->valueAt(currentIndex);
+ QVariant value;
+ // If a delegate model object was passed in, it means the calling code
+ // has decided to reuse it for several function calls to speed things up.
+ // So, use the faster (private) version in that case.
+ if (isValidIndex(currentIndex)) {
+ if (hasDelegateModelObject)
+ value = fastValueAt(currentIndex);
+ else
+ value = q->valueAt(currentIndex);
+ }
if (currentValue == value)
return;
@@ -463,6 +503,38 @@ void QQuickComboBoxPrivate::updateCurrentValue()
emit q->currentValueChanged();
}
+void QQuickComboBoxPrivate::updateCurrentTextAndValue()
+{
+ QObject *object = nullptr;
+ // For performance reasons, we reuse the same delegate model object: QTBUG-76029.
+ if (isValidIndex(currentIndex))
+ object = delegateModel->object(currentIndex);
+ const bool hasDelegateModelObject = object != nullptr;
+ updateCurrentText(hasDelegateModelObject);
+ updateCurrentValue(hasDelegateModelObject);
+ if (object)
+ delegateModel->release(object);
+}
+
+bool QQuickComboBoxPrivate::isValidIndex(int index) const
+{
+ return delegateModel && index >= 0 && index < delegateModel->count();
+}
+
+// For performance reasons (QTBUG-76029), both this and valueAt assume that
+// the index is valid and delegateModel->object(index) has been called.
+QString QQuickComboBoxPrivate::fastTextAt(int index) const
+{
+ const QString effectiveTextRole = textRole.isEmpty() ? QStringLiteral("modelData") : textRole;
+ return delegateModel->stringValue(index, effectiveTextRole);
+}
+
+QVariant QQuickComboBoxPrivate::fastValueAt(int index) const
+{
+ const QString effectiveValueRole = valueRole.isEmpty() ? QStringLiteral("modelData") : valueRole;
+ return delegateModel->variantValue(index, effectiveValueRole);
+}
+
void QQuickComboBoxPrivate::acceptInput()
{
Q_Q(QQuickComboBox);
@@ -509,10 +581,8 @@ void QQuickComboBoxPrivate::setCurrentIndex(int index, Activation activate)
currentIndex = index;
emit q->currentIndexChanged();
- if (componentComplete) {
- updateCurrentText();
- updateCurrentValue();
- }
+ if (componentComplete)
+ updateCurrentTextAndValue();
if (activate)
emit q->activated(index);
@@ -833,10 +903,14 @@ void QQuickComboBox::setModel(const QVariant& m)
if (d->model == model)
return;
- if (QAbstractItemModel* aim = qvariant_cast<QAbstractItemModel *>(d->model))
- QObjectPrivate::disconnect(aim, &QAbstractItemModel::dataChanged, d, &QQuickComboBoxPrivate::updateCurrentText);
- if (QAbstractItemModel* aim = qvariant_cast<QAbstractItemModel *>(model))
- QObjectPrivate::connect(aim, &QAbstractItemModel::dataChanged, d, &QQuickComboBoxPrivate::updateCurrentText);
+ if (QAbstractItemModel* aim = qvariant_cast<QAbstractItemModel *>(d->model)) {
+ QObjectPrivate::disconnect(aim, &QAbstractItemModel::dataChanged,
+ d, QOverload<>::of(&QQuickComboBoxPrivate::updateCurrentText));
+ }
+ if (QAbstractItemModel* aim = qvariant_cast<QAbstractItemModel *>(model)) {
+ QObjectPrivate::connect(aim, &QAbstractItemModel::dataChanged,
+ d, QOverload<>::of(&QQuickComboBoxPrivate::updateCurrentText));
+ }
d->model = model;
d->createDelegateModel();
@@ -1506,15 +1580,13 @@ QVariant QQuickComboBox::currentValue() const
QVariant QQuickComboBox::valueAt(int index) const
{
Q_D(const QQuickComboBox);
- if (!d->delegateModel || index < 0 || index >= d->delegateModel->count())
+ if (!d->isValidIndex(index))
return QVariant();
- // We use QVariant because the model API uses QVariant.
- QVariant value;
QObject *object = d->delegateModel->object(index);
+ QVariant value;
if (object) {
- const QString role = d->valueRole.isEmpty() ? QStringLiteral("modelData") : d->valueRole;
- value = d->delegateModel->variantValue(index, role);
+ value = d->fastValueAt(index);
d->delegateModel->release(object);
}
return value;
@@ -1551,13 +1623,13 @@ int QQuickComboBox::indexOfValue(const QVariant &value) const
QString QQuickComboBox::textAt(int index) const
{
Q_D(const QQuickComboBox);
- if (!d->delegateModel || index < 0 || index >= d->delegateModel->count())
+ if (!d->isValidIndex(index))
return QString();
- QString text;
QObject *object = d->delegateModel->object(index);
+ QString text;
if (object) {
- text = d->delegateModel->stringValue(index, d->textRole.isEmpty() ? QStringLiteral("modelData") : d->textRole);
+ text = d->fastTextAt(index);
d->delegateModel->release(object);
}
return text;
@@ -1824,12 +1896,10 @@ void QQuickComboBox::componentComplete()
static_cast<QQmlDelegateModel *>(d->delegateModel)->componentComplete();
if (count() > 0) {
- if (!d->hasCurrentIndex && d->currentIndex == -1) {
+ if (!d->hasCurrentIndex && d->currentIndex == -1)
setCurrentIndex(0);
- } else {
- d->updateCurrentText();
- d->updateCurrentValue();
- }
+ else
+ d->updateCurrentTextAndValue();
}
}
diff --git a/src/quicktemplates2/qquickcombobox_p.h b/src/quicktemplates2/qquickcombobox_p.h
index a55541d4..c9063d6a 100644
--- a/src/quicktemplates2/qquickcombobox_p.h
+++ b/src/quicktemplates2/qquickcombobox_p.h
@@ -163,8 +163,8 @@ public:
// 2.14 (Qt 5.14)
QVariant currentValue() const;
- Q_INVOKABLE QVariant valueAt(int index) const;
- Q_INVOKABLE int indexOfValue(const QVariant &value) const;
+ Q_REVISION(14) Q_INVOKABLE QVariant valueAt(int index) const;
+ Q_REVISION(14) Q_INVOKABLE int indexOfValue(const QVariant &value) const;
public Q_SLOTS:
void incrementCurrentIndex();
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index dd954b2b..e156fb57 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -1470,9 +1470,9 @@ void QQuickControl::setHovered(bool hovered)
Setting this property propagates the value to all child controls that do not have
\c hoverEnabled explicitly set.
- You can also enable or disable hover effects for all Qt Quick Controls 2 applications
+ You can also enable or disable hover effects for all Qt Quick Controls applications
by setting the \c QT_QUICK_CONTROLS_HOVER_ENABLED \l {Supported Environment Variables
- in Qt Quick Controls 2}{environment variable}.
+ in Qt Quick Controls}{environment variable}.
\sa hovered
*/
diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp
index 91fb41f2..10d80778 100644
--- a/src/quicktemplates2/qquickdialogbuttonbox.cpp
+++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp
@@ -430,7 +430,8 @@ void QQuickDialogButtonBoxPrivate::removeStandardButtons()
while (i >= 0) {
QQuickAbstractButton *button = qobject_cast<QQuickAbstractButton *>(q->itemAt(i));
if (button) {
- QQuickDialogButtonBoxAttached *attached = qobject_cast<QQuickDialogButtonBoxAttached *>(qmlAttachedPropertiesObject<QQuickDialogButtonBox>(button, false));
+ QQuickDialogButtonBoxAttached *attached = qobject_cast<QQuickDialogButtonBoxAttached *>(
+ qmlAttachedPropertiesObject<QQuickDialogButtonBox>(button, false));
if (attached) {
QQuickDialogButtonBoxAttachedPrivate *p = QQuickDialogButtonBoxAttachedPrivate::get(attached);
if (p->standardButton != QPlatformDialogHelper::NoButton) {
@@ -443,6 +444,24 @@ void QQuickDialogButtonBoxPrivate::removeStandardButtons()
}
}
+void QQuickDialogButtonBoxPrivate::updateLanguage()
+{
+ Q_Q(QQuickDialogButtonBox);
+ int i = q->count() - 1;
+ while (i >= 0) {
+ QQuickAbstractButton *button = qobject_cast<QQuickAbstractButton *>(itemAt(i));
+ if (button) {
+ QQuickDialogButtonBoxAttached *attached = qobject_cast<QQuickDialogButtonBoxAttached *>(
+ qmlAttachedPropertiesObject<QQuickDialogButtonBox>(button, true));
+ const auto boxAttachedPrivate = QQuickDialogButtonBoxAttachedPrivate::get(attached);
+ const QPlatformDialogHelper::StandardButton standardButton = boxAttachedPrivate->standardButton;
+ const QString buttonText = QGuiApplicationPrivate::platformTheme()->standardButtonText(standardButton);
+ button->setText(QPlatformTheme::removeMnemonics(buttonText));
+ }
+ --i;
+ }
+}
+
QQuickDialogButtonBox::QQuickDialogButtonBox(QQuickItem *parent)
: QQuickContainer(*(new QQuickDialogButtonBoxPrivate), parent)
{
@@ -684,11 +703,34 @@ void QQuickDialogButtonBox::updatePolish()
d->updateLayout();
}
+class LanguageEventFilter : public QObject
+{
+public:
+ LanguageEventFilter(QQuickDialogButtonBoxPrivate *box)
+ : QObject(box->q_ptr)
+ , boxPrivate(box)
+ {
+ }
+
+protected:
+ bool eventFilter(QObject *, QEvent *event)
+ {
+ if (event->type() == QEvent::LanguageChange)
+ boxPrivate->updateLanguage();
+ return false;
+ }
+
+private:
+ QQuickDialogButtonBoxPrivate *boxPrivate;
+};
+
void QQuickDialogButtonBox::componentComplete()
{
Q_D(QQuickDialogButtonBox);
QQuickContainer::componentComplete();
d->updateLayout();
+ // TODO: use the solution in QTBUG-78141 instead, when it's implemented.
+ qApp->installEventFilter(new LanguageEventFilter(d));
}
void QQuickDialogButtonBox::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
diff --git a/src/quicktemplates2/qquickdialogbuttonbox_p_p.h b/src/quicktemplates2/qquickdialogbuttonbox_p_p.h
index 66386911..6f9c9033 100644
--- a/src/quicktemplates2/qquickdialogbuttonbox_p_p.h
+++ b/src/quicktemplates2/qquickdialogbuttonbox_p_p.h
@@ -78,6 +78,8 @@ public:
QQuickAbstractButton *createStandardButton(QPlatformDialogHelper::StandardButton button);
void removeStandardButtons();
+ void updateLanguage();
+
Qt::Alignment alignment = 0;
QQuickDialogButtonBox::Position position = QQuickDialogButtonBox::Footer;
QPlatformDialogHelper::StandardButtons standardButtons = QPlatformDialogHelper::NoButton;
diff --git a/src/quicktemplates2/qquickicon.cpp b/src/quicktemplates2/qquickicon.cpp
index 5a689108..bf0a4658 100644
--- a/src/quicktemplates2/qquickicon.cpp
+++ b/src/quicktemplates2/qquickicon.cpp
@@ -112,12 +112,14 @@ void QQuickIcon::setName(const QString &name)
if ((d->resolveMask & QQuickIconPrivate::NameResolved) && d->name == name)
return;
+ d.detach();
d->name = name;
d->resolveMask |= QQuickIconPrivate::NameResolved;
}
void QQuickIcon::resetName()
{
+ d.detach();
d->name = QString();
d->resolveMask &= ~QQuickIconPrivate::NameResolved;
}
@@ -132,12 +134,14 @@ void QQuickIcon::setSource(const QUrl &source)
if ((d->resolveMask & QQuickIconPrivate::SourceResolved) && d->source == source)
return;
+ d.detach();
d->source = source;
d->resolveMask |= QQuickIconPrivate::SourceResolved;
}
void QQuickIcon::resetSource()
{
+ d.detach();
d->source = QString();
d->resolveMask &= ~QQuickIconPrivate::SourceResolved;
}
@@ -152,12 +156,14 @@ void QQuickIcon::setWidth(int width)
if ((d->resolveMask & QQuickIconPrivate::WidthResolved) && d->width == width)
return;
+ d.detach();
d->width = width;
d->resolveMask |= QQuickIconPrivate::WidthResolved;
}
void QQuickIcon::resetWidth()
{
+ d.detach();
d->width = 0;
d->resolveMask &= ~QQuickIconPrivate::WidthResolved;
}
@@ -172,12 +178,14 @@ void QQuickIcon::setHeight(int height)
if ((d->resolveMask & QQuickIconPrivate::HeightResolved) && d->height == height)
return;
+ d.detach();
d->height = height;
d->resolveMask |= QQuickIconPrivate::HeightResolved;
}
void QQuickIcon::resetHeight()
{
+ d.detach();
d->height = 0;
d->resolveMask &= ~QQuickIconPrivate::HeightResolved;
}
@@ -192,12 +200,14 @@ void QQuickIcon::setColor(const QColor &color)
if ((d->resolveMask & QQuickIconPrivate::ColorResolved) && d->color == color)
return;
+ d.detach();
d->color = color;
d->resolveMask |= QQuickIconPrivate::ColorResolved;
}
void QQuickIcon::resetColor()
{
+ d.detach();
d->color = Qt::transparent;
d->resolveMask &= ~QQuickIconPrivate::ColorResolved;
}
@@ -212,12 +222,14 @@ void QQuickIcon::setCache(bool cache)
if ((d->resolveMask & QQuickIconPrivate::CacheResolved) && d->cache == cache)
return;
+ d.detach();
d->cache = cache;
d->resolveMask |= QQuickIconPrivate::CacheResolved;
}
void QQuickIcon::resetCache()
{
+ d.detach();
d->cache = true;
d->resolveMask &= ~QQuickIconPrivate::CacheResolved;
}
@@ -225,24 +237,25 @@ void QQuickIcon::resetCache()
QQuickIcon QQuickIcon::resolve(const QQuickIcon &other) const
{
QQuickIcon resolved = *this;
+ resolved.d.detach();
if (!(d->resolveMask & QQuickIconPrivate::NameResolved))
- resolved.setName(other.name());
+ resolved.d->name = other.d->name;
if (!(d->resolveMask & QQuickIconPrivate::SourceResolved))
- resolved.setSource(other.source());
+ resolved.d->source = other.d->source;
if (!(d->resolveMask & QQuickIconPrivate::WidthResolved))
- resolved.setWidth(other.width());
+ resolved.d->width = other.d->width;
if (!(d->resolveMask & QQuickIconPrivate::HeightResolved))
- resolved.setHeight(other.height());
+ resolved.d->height = other.d->height;
if (!(d->resolveMask & QQuickIconPrivate::ColorResolved))
- resolved.setColor(other.color());
+ resolved.d->color = other.d->color;
if (!(d->resolveMask & QQuickIconPrivate::CacheResolved))
- resolved.setCache(other.cache());
+ resolved.d->cache = other.d->cache;
return resolved;
}
diff --git a/src/quicktemplates2/qquickicon_p.h b/src/quicktemplates2/qquickicon_p.h
index 57cab720..1835585d 100644
--- a/src/quicktemplates2/qquickicon_p.h
+++ b/src/quicktemplates2/qquickicon_p.h
@@ -107,7 +107,7 @@ public:
QQuickIcon resolve(const QQuickIcon &other) const;
private:
- QSharedDataPointer<QQuickIconPrivate> d;
+ QExplicitlySharedDataPointer<QQuickIconPrivate> d;
};
QT_END_NAMESPACE
diff --git a/src/quicktemplates2/qquickitemdelegate.cpp b/src/quicktemplates2/qquickitemdelegate.cpp
index ac409118..8156ab65 100644
--- a/src/quicktemplates2/qquickitemdelegate.cpp
+++ b/src/quicktemplates2/qquickitemdelegate.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
in various views and controls, such as \l ListView and \l ComboBox.
ItemDelegate inherits its API from AbstractButton. For instance, you can set
- \l {AbstractButton::text}{text}, display an \l {Icons in Qt Quick Controls 2}{icon},
+ \l {AbstractButton::text}{text}, display an \l {Icons in Qt Quick Controls}{icon},
and react to \l {AbstractButton::clicked}{clicks} using the AbstractButton API.
\snippet qtquickcontrols2-itemdelegate.qml 1
diff --git a/src/quicktemplates2/qquickmenu.cpp b/src/quicktemplates2/qquickmenu.cpp
index 498c6d00..91372777 100644
--- a/src/quicktemplates2/qquickmenu.cpp
+++ b/src/quicktemplates2/qquickmenu.cpp
@@ -1487,7 +1487,9 @@ void QQuickMenu::timerEvent(QTimerEvent *event)
if (QQuickMenu *subMenu = d->currentSubMenu())
subMenu->open();
d->stopHoverTimer();
+ return;
}
+ QQuickPopup::timerEvent(event);
}
QFont QQuickMenu::defaultFont() const
diff --git a/src/quicktemplates2/qquickmenubar.cpp b/src/quicktemplates2/qquickmenubar.cpp
index 6016e70d..1761d999 100644
--- a/src/quicktemplates2/qquickmenubar.cpp
+++ b/src/quicktemplates2/qquickmenubar.cpp
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
menus in a menu bar can be accessed using \l menuAt().
\sa {Customizing MenuBar}, Menu, MenuBarItem, {Menu Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
QQuickItem *QQuickMenuBarPrivate::beginCreateItem()
diff --git a/src/quicktemplates2/qquickmenuitem.cpp b/src/quicktemplates2/qquickmenuitem.cpp
index 22fe664a..a7fc63e8 100644
--- a/src/quicktemplates2/qquickmenuitem.cpp
+++ b/src/quicktemplates2/qquickmenuitem.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
example.
MenuItem inherits its API from AbstractButton. For instance, you can set
- \l {AbstractButton::text}{text} and \l {Icons in Qt Quick Controls 2}{icon}
+ \l {AbstractButton::text}{text} and \l {Icons in Qt Quick Controls}{icon}
using the AbstractButton API.
\code
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp
index cf72c8a6..3f358706 100644
--- a/src/quicktemplates2/qquickoverlay.cpp
+++ b/src/quicktemplates2/qquickoverlay.cpp
@@ -126,11 +126,6 @@ bool QQuickOverlayPrivate::startDrag(QEvent *event, const QPointF &pos)
return false;
}
-static bool isTouchEvent(QEvent *event)
-{
- return event->type() == QEvent::TouchBegin || event->type() == QEvent::TouchUpdate || event->type() == QEvent::TouchEnd;
-}
-
bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target)
{
if (target) {
@@ -139,7 +134,18 @@ bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuick
return true;
}
return false;
- } else if (!mouseGrabberPopup || isTouchEvent(event)) {
+ }
+
+ switch (event->type()) {
+ default: {
+ if (mouseGrabberPopup)
+ break;
+#if QT_CONFIG(quicktemplates2_multitouch)
+ Q_FALLTHROUGH();
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+#endif
// allow non-modal popups to close themselves,
// and non-dimming modal popups to block the event
const auto popups = stackingOrderPopups();
@@ -149,6 +155,8 @@ bool QQuickOverlayPrivate::handlePress(QQuickItem *source, QEvent *event, QQuick
return true;
}
}
+ break;
+ }
}
event->ignore();
diff --git a/src/quicktemplates2/qquickoverlay_p.h b/src/quicktemplates2/qquickoverlay_p.h
index 0d8bccf5..1d238163 100644
--- a/src/quicktemplates2/qquickoverlay_p.h
+++ b/src/quicktemplates2/qquickoverlay_p.h
@@ -86,7 +86,7 @@ Q_SIGNALS:
protected:
void itemChange(ItemChange change, const ItemChangeData &data) override;
- void geometryChanged(const QRectF &oldGeometry, const QRectF &newGeometry) override;
+ void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
diff --git a/src/quicktemplates2/qquickpage.cpp b/src/quicktemplates2/qquickpage.cpp
index cb90ac48..78bae921 100644
--- a/src/quicktemplates2/qquickpage.cpp
+++ b/src/quicktemplates2/qquickpage.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE
\endqml
\sa ApplicationWindow, {Container Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
static const QQuickItemPrivate::ChangeTypes LayoutChanges = QQuickItemPrivate::Geometry | QQuickItemPrivate::Visibility | QQuickItemPrivate::Destroyed
diff --git a/src/quicktemplates2/qquickpane.cpp b/src/quicktemplates2/qquickpane.cpp
index fd9d2cf0..18c8bd51 100644
--- a/src/quicktemplates2/qquickpane.cpp
+++ b/src/quicktemplates2/qquickpane.cpp
@@ -120,7 +120,7 @@ QT_BEGIN_NAMESPACE
\endcode
\sa {Customizing Pane}, {Container Controls},
- {Focus Management in Qt Quick Controls 2}, {Event Handling}
+ {Focus Management in Qt Quick Controls}, {Event Handling}
*/
void QQuickPanePrivate::init()
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index dd7dede6..f0cf1869 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -2582,6 +2582,7 @@ void QQuickPopup::itemChange(QQuickItem::ItemChange change, const QQuickItem::It
else
d->popupItem->ungrabShortcut();
}
+ break;
default:
break;
}
diff --git a/src/quicktemplates2/qquickpopup_p_p.h b/src/quicktemplates2/qquickpopup_p_p.h
index e32fdb28..8a85f914 100644
--- a/src/quicktemplates2/qquickpopup_p_p.h
+++ b/src/quicktemplates2/qquickpopup_p_p.h
@@ -187,7 +187,7 @@ public:
QQuickPopup::ClosePolicy closePolicy = DefaultClosePolicy;
QQuickItem *parentItem = nullptr;
QQuickItem *dimmer = nullptr;
- QQuickWindow *window = nullptr;
+ QPointer<QQuickWindow> window;
QQuickTransition *enter = nullptr;
QQuickTransition *exit = nullptr;
QQuickPopupItem *popupItem = nullptr;
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp
index acf4dca3..378ece50 100644
--- a/src/quicktemplates2/qquickrangeslider.cpp
+++ b/src/quicktemplates2/qquickrangeslider.cpp
@@ -89,7 +89,7 @@ QT_BEGIN_NAMESPACE
For a slider that allows the user to select a single value, see \l Slider.
\sa {Customizing RangeSlider}, {Input Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
class QQuickRangeSliderNodePrivate : public QObjectPrivate
diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp
index 98bd174e..70390351 100644
--- a/src/quicktemplates2/qquickscrollview.cpp
+++ b/src/quicktemplates2/qquickscrollview.cpp
@@ -113,7 +113,7 @@ QT_BEGIN_NAMESPACE
\snippet qtquickcontrols2-scrollview-interactive.qml file
\sa ScrollBar, ScrollIndicator, {Customizing ScrollView}, {Container Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
class QQuickScrollViewPrivate : public QQuickPanePrivate
diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp
index 274929b0..389e5c54 100644
--- a/src/quicktemplates2/qquickspinbox.cpp
+++ b/src/quicktemplates2/qquickspinbox.cpp
@@ -92,7 +92,7 @@ static const int AUTO_REPEAT_INTERVAL = 100;
\snippet qtquickcontrols2-spinbox-double.qml 1
- \sa Tumbler, {Customizing SpinBox}, {Focus Management in Qt Quick Controls 2}
+ \sa Tumbler, {Customizing SpinBox}, {Focus Management in Qt Quick Controls}
*/
/*!
diff --git a/src/quicktemplates2/qquickstackelement.cpp b/src/quicktemplates2/qquickstackelement.cpp
index 7ae5c495..4c14022a 100644
--- a/src/quicktemplates2/qquickstackelement.cpp
+++ b/src/quicktemplates2/qquickstackelement.cpp
@@ -44,6 +44,7 @@
#include <QtQml/private/qv4qobjectwrapper_p.h>
#include <QtQml/private/qqmlcomponent_p.h>
#include <QtQml/private/qqmlengine_p.h>
+#include <QtQml/private/qqmlapiversion_p.h>
QT_BEGIN_NAMESPACE
@@ -210,7 +211,12 @@ void QQuickStackElement::initialize()
QV4::ScopedValue ipv(scope, properties.value());
QV4::Scoped<QV4::QmlContext> qmlContext(scope, qmlCallingContext.value());
QV4::ScopedValue qmlObject(scope, QV4::QObjectWrapper::wrap(v4, item));
+#if Q_QML_PRIVATE_API_VERSION >= 6
+ RequiredProperties requiredPropertiesCurrentlyNotSupported;
+ QQmlComponentPrivate::setInitialProperties(v4, qmlContext, qmlObject, ipv, requiredPropertiesCurrentlyNotSupported, item);
+#else
QQmlComponentPrivate::setInitialProperties(v4, qmlContext, qmlObject, ipv);
+#endif
properties.clear();
}
diff --git a/src/quicktemplates2/qquickstackview.cpp b/src/quicktemplates2/qquickstackview.cpp
index 18f65127..b2a95731 100644
--- a/src/quicktemplates2/qquickstackview.cpp
+++ b/src/quicktemplates2/qquickstackview.cpp
@@ -373,7 +373,7 @@ QT_BEGIN_NAMESPACE
\endlist
\sa {Customizing StackView}, {Navigation Controls}, {Container Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
QQuickStackView::QQuickStackView(QQuickItem *parent)
diff --git a/src/quicktemplates2/qquickswipeview.cpp b/src/quicktemplates2/qquickswipeview.cpp
index e6a88b47..3ba4f4d3 100644
--- a/src/quicktemplates2/qquickswipeview.cpp
+++ b/src/quicktemplates2/qquickswipeview.cpp
@@ -100,7 +100,7 @@ QT_BEGIN_NAMESPACE
or using anchors for its children works as expected.
\sa TabBar, PageIndicator, {Customizing SwipeView}, {Navigation Controls}, {Container Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
class QQuickSwipeViewPrivate : public QQuickContainerPrivate
diff --git a/src/quicktemplates2/qquicktabbar.cpp b/src/quicktemplates2/qquicktabbar.cpp
index 745023c3..5a439b4b 100644
--- a/src/quicktemplates2/qquicktabbar.cpp
+++ b/src/quicktemplates2/qquicktabbar.cpp
@@ -92,7 +92,7 @@ QT_BEGIN_NAMESPACE
\snippet qtquickcontrols2-tabbar-flickable.qml 1
\sa TabButton, {Customizing TabBar}, {Navigation Controls}, {Container Controls},
- {Focus Management in Qt Quick Controls 2}
+ {Focus Management in Qt Quick Controls}
*/
class QQuickTabBarPrivate : public QQuickContainerPrivate
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp
index 95bf5bb1..f7b8969c 100644
--- a/src/quicktemplates2/qquicktextarea.cpp
+++ b/src/quicktemplates2/qquicktextarea.cpp
@@ -369,6 +369,8 @@ void QQuickTextAreaPrivate::detachFlickable()
QObjectPrivate::disconnect(flickable, &QQuickFlickable::contentHeightChanged, this, &QQuickTextAreaPrivate::resizeFlickableControl);
flickable = nullptr;
+
+ resizeBackground();
}
void QQuickTextAreaPrivate::ensureCursorVisible()
@@ -433,11 +435,21 @@ void QQuickTextAreaPrivate::resizeFlickableContent()
void QQuickTextAreaPrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff)
{
- Q_UNUSED(item);
- Q_UNUSED(change);
Q_UNUSED(diff);
+ if (!resizingBackground && item == background) {
+ QQuickItemPrivate *p = QQuickItemPrivate::get(item);
+ // Only set hasBackgroundWidth/Height if it was a width/height change,
+ // otherwise we're prevented from setting a width/height in the future.
+ if (change.widthChange())
+ extra.value().hasBackgroundWidth = p->widthValid;
+ if (change.heightChange())
+ extra.value().hasBackgroundHeight = p->heightValid;
+ }
- resizeFlickableControl();
+ if (flickable)
+ resizeFlickableControl();
+ else
+ resizeBackground();
}
qreal QQuickTextAreaPrivate::getImplicitWidth() const
@@ -512,11 +524,8 @@ void QQuickTextAreaPrivate::executeBackground(bool complete)
if (!background || complete)
quickBeginDeferred(q, backgroundName(), background);
- if (complete) {
+ if (complete)
quickCompleteDeferred(q, backgroundName(), background);
- if (background)
- QQuickControlPrivate::addImplicitSizeListener(background, this, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry);
- }
}
void QQuickTextAreaPrivate::itemImplicitWidthChanged(QQuickItem *item)
@@ -625,21 +634,20 @@ void QQuickTextArea::setBackground(QQuickItem *background)
d->background = background;
if (background) {
+ QQuickItemPrivate *p = QQuickItemPrivate::get(background);
+ if (p->widthValid || p->heightValid) {
+ d->extra.value().hasBackgroundWidth = p->widthValid;
+ d->extra.value().hasBackgroundHeight = p->heightValid;
+ }
if (d->flickable)
background->setParentItem(d->flickable);
else
background->setParentItem(this);
if (qFuzzyIsNull(background->z()))
background->setZ(-1);
- QQuickItemPrivate *p = QQuickItemPrivate::get(background);
- if (p->widthValid || p->heightValid) {
- d->extra.value().hasBackgroundWidth = p->widthValid;
- d->extra.value().hasBackgroundHeight = p->heightValid;
- }
- if (isComponentComplete()) {
+ if (isComponentComplete())
d->resizeBackground();
- QQuickControlPrivate::addImplicitSizeListener(background, d, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry);
- }
+ QQuickControlPrivate::addImplicitSizeListener(background, d, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry);
}
if (!qFuzzyCompare(oldImplicitBackgroundWidth, implicitBackgroundWidth()))
diff --git a/src/quicktemplates2/qquicktoolbutton.cpp b/src/quicktemplates2/qquicktoolbutton.cpp
index eb70fbc4..b613e69b 100644
--- a/src/quicktemplates2/qquicktoolbutton.cpp
+++ b/src/quicktemplates2/qquicktoolbutton.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
\snippet qtquickcontrols2-toolbar.qml 1
ToolButton inherits its API from AbstractButton. For instance, you can set
- \l {AbstractButton::text}{text}, display an \l {Icons in Qt Quick Controls 2}{icon},
+ \l {AbstractButton::text}{text}, display an \l {Icons in Qt Quick Controls}{icon},
and react to \l {AbstractButton::clicked}{clicks} using the AbstractButton API.
\sa ToolBar, {Customizing ToolButton}, {Button Controls}
diff --git a/src/quicktemplates2/qquicktooltip.cpp b/src/quicktemplates2/qquicktooltip.cpp
index ddf434a2..0a36e0c7 100644
--- a/src/quicktemplates2/qquicktooltip.cpp
+++ b/src/quicktemplates2/qquicktooltip.cpp
@@ -238,12 +238,13 @@ void QQuickToolTip::setTimeout(int timeout)
if (d->timeout == timeout)
return;
+ d->timeout = timeout;
+
if (timeout <= 0)
d->stopTimeout();
else if (isVisible())
d->startTimeout();
- d->timeout = timeout;
emit timeoutChanged();
}
@@ -327,10 +328,14 @@ void QQuickToolTip::timerEvent(QTimerEvent *event)
if (event->timerId() == d->timeoutTimer.timerId()) {
d->stopTimeout();
QQuickPopup::setVisible(false);
- } else if (event->timerId() == d->delayTimer.timerId()) {
+ return;
+ }
+ if (event->timerId() == d->delayTimer.timerId()) {
d->stopDelay();
QQuickPopup::setVisible(true);
+ return;
}
+ QQuickPopup::timerEvent(event);
}
#if QT_CONFIG(accessibility)
diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp
index 8b702c60..85c70b1b 100644
--- a/src/quicktemplates2/qquicktumbler.cpp
+++ b/src/quicktemplates2/qquicktumbler.cpp
@@ -949,9 +949,20 @@ void QQuickTumblerAttachedPrivate::calculateDisplacement()
const qreal contentY = tumblerPrivate->viewContentY;
const qreal delegateH = delegateHeight(tumbler);
const qreal preferredHighlightBegin = tumblerPrivate->view->property("preferredHighlightBegin").toReal();
- // Tumbler's displacement goes from negative at the top to positive towards the bottom, so we must switch this around.
- const qreal reverseDisplacement = (contentY + preferredHighlightBegin) / delegateH;
- displacement = reverseDisplacement - index;
+ const qreal itemY = qobject_cast<QQuickItem*>(parent)->y();
+ qreal currentItemY = 0;
+ auto currentItem = tumblerPrivate->view->property("currentItem").value<QQuickItem*>();
+ if (currentItem)
+ currentItemY = currentItem->y();
+ // Start from the y position of the current item.
+ const qreal topOfCurrentItemInViewport = currentItemY - contentY;
+ // Then, calculate the distance between it and the preferredHighlightBegin.
+ const qreal relativePositionToPreferredHighlightBegin = topOfCurrentItemInViewport - preferredHighlightBegin;
+ // Next, calculate the distance between us and the current item.
+ const qreal distanceFromCurrentItem = currentItemY - itemY;
+ const qreal displacementInPixels = distanceFromCurrentItem - relativePositionToPreferredHighlightBegin;
+ // Convert it from pixels to a floating point index.
+ displacement = displacementInPixels / delegateH;
}
emitIfDisplacementChanged(previousDisplacement, displacement);
diff --git a/tests/auto/calendar/data/tst_monthgrid.qml b/tests/auto/calendar/data/tst_monthgrid.qml
index 25c8378b..6d125712 100644
--- a/tests/auto/calendar/data/tst_monthgrid.qml
+++ b/tests/auto/calendar/data/tst_monthgrid.qml
@@ -148,28 +148,29 @@ TestCase {
control.month = 0
compare(control.month, 0)
- ignoreWarning(Qt.resolvedUrl("tst_monthgrid.qml") + ":65:9: QML AbstractMonthGrid: month -1 is out of range [0...11]")
+
+ ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: month -1 is out of range \[0...11\]$/)
control.month = -1
compare(control.month, 0)
control.month = 11
compare(control.month, 11)
- ignoreWarning(Qt.resolvedUrl("tst_monthgrid.qml") + ":65:9: QML AbstractMonthGrid: month 12 is out of range [0...11]")
+ ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: month 12 is out of range \[0...11\]$/)
control.month = 12
compare(control.month, 11)
control.year = -271820
compare(control.year, -271820)
- ignoreWarning(Qt.resolvedUrl("tst_monthgrid.qml") + ":65:9: QML AbstractMonthGrid: year -271821 is out of range [-271820...275759]")
+ ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: year -271821 is out of range \[-271820...275759\]$/)
control.year = -271821
compare(control.year, -271820)
control.year = 275759
compare(control.year, 275759)
- ignoreWarning(Qt.resolvedUrl("tst_monthgrid.qml") + ":65:9: QML AbstractMonthGrid: year 275760 is out of range [-271820...275759]")
+ ignoreWarning(/tst_monthgrid.qml:65:9: QML (Abstract)?MonthGrid: year 275760 is out of range \[-271820...275759\]$/)
control.year = 275760
compare(control.year, 275759)
diff --git a/tests/auto/calendar/data/tst_weeknumbercolumn.qml b/tests/auto/calendar/data/tst_weeknumbercolumn.qml
index f94fed43..d1b50339 100644
--- a/tests/auto/calendar/data/tst_weeknumbercolumn.qml
+++ b/tests/auto/calendar/data/tst_weeknumbercolumn.qml
@@ -93,28 +93,28 @@ TestCase {
control.month = 0
compare(control.month, 0)
- ignoreWarning(Qt.resolvedUrl("tst_weeknumbercolumn.qml") + ":65:9: QML AbstractWeekNumberColumn: month -1 is out of range [0...11]")
+ ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: month -1 is out of range \[0...11\]$/)
control.month = -1
compare(control.month, 0)
control.month = 11
compare(control.month, 11)
- ignoreWarning(Qt.resolvedUrl("tst_weeknumbercolumn.qml") + ":65:9: QML AbstractWeekNumberColumn: month 12 is out of range [0...11]")
+ ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: month 12 is out of range \[0...11\]$/)
control.month = 12
compare(control.month, 11)
control.year = -271820
compare(control.year, -271820)
- ignoreWarning(Qt.resolvedUrl("tst_weeknumbercolumn.qml") + ":65:9: QML AbstractWeekNumberColumn: year -271821 is out of range [-271820...275759]")
+ ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: year -271821 is out of range \[-271820...275759\]$/)
control.year = -271821
compare(control.year, -271820)
control.year = 275759
compare(control.year, 275759)
- ignoreWarning(Qt.resolvedUrl("tst_weeknumbercolumn.qml") + ":65:9: QML AbstractWeekNumberColumn: year 275760 is out of range [-271820...275759]")
+ ignoreWarning(/tst_weeknumbercolumn.qml:65:9: QML (Abstract)?WeekNumberColumn: year 275760 is out of range \[-271820...275759\]$/)
control.year = 275760
compare(control.year, 275759)
diff --git a/tests/auto/controls/data/tst_abstractbutton.qml b/tests/auto/controls/data/tst_abstractbutton.qml
index 80155f69..ee26a6d6 100644
--- a/tests/auto/controls/data/tst_abstractbutton.qml
+++ b/tests/auto/controls/data/tst_abstractbutton.qml
@@ -599,7 +599,7 @@ TestCase {
AbstractButton {
action: Action {
text: "Default"
- icon.name: "default"
+ icon.name: checked ? "checked" : "unchecked"
icon.source: "qrc:/icons/default.png"
checkable: true
checked: true
@@ -617,6 +617,7 @@ TestCase {
compare(control.checkable, true)
compare(control.checked, true)
compare(control.enabled, false)
+ compare(control.icon.name, "checked")
var textSpy = signalSpy.createObject(control, { target: control, signalName: "textChanged" })
verify(textSpy.valid)
@@ -630,6 +631,7 @@ TestCase {
compare(control.checkable, false) // propagates
compare(control.checked, false) // propagates
compare(control.enabled, true) // propagates
+ compare(control.icon.name, "unchecked") // propagates
compare(textSpy.count, 1)
// changes via button
@@ -637,19 +639,23 @@ TestCase {
control.checkable = true
control.checked = true
control.enabled = false
+ control.icon.name = "default"
compare(control.text, "Button")
compare(control.checkable, true)
compare(control.checked, true)
compare(control.enabled, false)
+ compare(control.icon.name, "default")
compare(control.action.text, "Action") // does NOT propagate
compare(control.action.checkable, true) // propagates
compare(control.action.checked, true) // propagates
compare(control.action.enabled, true) // does NOT propagate
+ compare(control.action.icon.name, control.action.checked ? "checked" : "unchecked") // does NOT propagate
compare(textSpy.count, 2)
// remove the action so that only the button's properties are left
control.action = null
compare(control.text, "Button")
+ compare(control.icon.name, "default")
compare(textSpy.count, 2)
// setting an action while button has a particular property set
diff --git a/tests/auto/controls/data/tst_dial.qml b/tests/auto/controls/data/tst_dial.qml
index cd2f6112..86999594 100644
--- a/tests/auto/controls/data/tst_dial.qml
+++ b/tests/auto/controls/data/tst_dial.qml
@@ -470,15 +470,15 @@ TestCase {
function test_snapMode_data(immediate) {
return [
- { tag: "NoSnap", snapMode: Slider.NoSnap, from: 0, to: 2, values: [0, 0, 1], positions: [0, 0.5, 0.5] },
- { tag: "SnapAlways (0..2)", snapMode: Slider.SnapAlways, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] },
- { tag: "SnapAlways (1..3)", snapMode: Slider.SnapAlways, from: 1, to: 3, values: [1.0, 1.0, 2.0], positions: [0.0, 0.5, 0.5] },
- { tag: "SnapAlways (-1..1)", snapMode: Slider.SnapAlways, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [0.5, 0.5, 0.5] },
- { tag: "SnapAlways (1..-1)", snapMode: Slider.SnapAlways, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] },
- { tag: "SnapOnRelease (0..2)", snapMode: Slider.SnapOnRelease, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] },
- { tag: "SnapOnRelease (1..3)", snapMode: Slider.SnapOnRelease, from: 1, to: 3, values: [1.0, 1.0, 2.0], positions: [0.0, 0.5, 0.5] },
- { tag: "SnapOnRelease (-1..1)", snapMode: Slider.SnapOnRelease, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [immediate ? 0.0 : 0.5, 0.5, 0.5] },
- { tag: "SnapOnRelease (1..-1)", snapMode: Slider.SnapOnRelease, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] }
+ { tag: "NoSnap", snapMode: Dial.NoSnap, from: 0, to: 2, values: [0, 0, 1], positions: [0, 0.5, 0.5] },
+ { tag: "SnapAlways (0..2)", snapMode: Dial.SnapAlways, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] },
+ { tag: "SnapAlways (1..3)", snapMode: Dial.SnapAlways, from: 1, to: 3, values: [1.0, 1.0, 2.0], positions: [0.0, 0.5, 0.5] },
+ { tag: "SnapAlways (-1..1)", snapMode: Dial.SnapAlways, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [0.5, 0.5, 0.5] },
+ { tag: "SnapAlways (1..-1)", snapMode: Dial.SnapAlways, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] },
+ { tag: "SnapOnRelease (0..2)", snapMode: Dial.SnapOnRelease, from: 0, to: 2, values: [0.0, 0.0, 1.0], positions: [0.0, 0.5, 0.5] },
+ { tag: "SnapOnRelease (1..3)", snapMode: Dial.SnapOnRelease, from: 1, to: 3, values: [1.0, 1.0, 2.0], positions: [0.0, 0.5, 0.5] },
+ { tag: "SnapOnRelease (-1..1)", snapMode: Dial.SnapOnRelease, from: -1, to: 1, values: [0.0, 0.0, 0.0], positions: [immediate ? 0.0 : 0.5, 0.5, 0.5] },
+ { tag: "SnapOnRelease (1..-1)", snapMode: Dial.SnapOnRelease, from: 1, to: -1, values: [1.0, 1.0, 0.0], positions: [0.0, 0.5, 0.5] }
]
}
diff --git a/tests/auto/controls/data/tst_textarea.qml b/tests/auto/controls/data/tst_textarea.qml
index ee40c9b7..1e455ffc 100644
--- a/tests/auto/controls/data/tst_textarea.qml
+++ b/tests/auto/controls/data/tst_textarea.qml
@@ -688,4 +688,72 @@ TestCase {
compare(control.background.width, 100)
compare(control.background.height, 100)
}
+
+ // QTBUG-76369
+ Component {
+ id: testResizeBackground
+ Item {
+ width: 200
+ height: 200
+ property alias textArea: textArea
+ ScrollView {
+ anchors.fill: parent
+ ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
+ TextArea {
+ id: textArea
+ // workaround test failing due to default insets on Imagine
+ topInset: undefined
+ leftInset: undefined
+ rightInset: undefined
+ bottomInset: undefined
+ wrapMode : TextEdit.WordWrap
+ readOnly: false
+ selectByMouse: true
+ focus: true
+ text: "test message"
+
+ background: Rectangle {
+ y: parent.height - height - textArea.bottomPadding / 2
+ implicitWidth: 120
+ height: textArea.activeFocus ? 2 : 1
+ }
+ }
+ }
+ }
+ }
+
+ function test_resize_background() {
+ var control = createTemporaryObject(testResizeBackground, testCase)
+
+ compare(control.textArea.background.width, control.width)
+ compare(control.textArea.background.height, 1)
+ control.width = 400
+ control.height = 400
+ compare(control.textArea.background.width, control.width)
+ compare(control.textArea.background.height, 1)
+ control.width = 200
+ control.height = 200
+ compare(control.textArea.background.width, control.width)
+ compare(control.textArea.background.height, 1)
+
+ // hasBackgroundWidth=true
+ control.textArea.background.width = 1
+ compare(control.textArea.background.width, 1)
+ compare(control.textArea.background.height, 1)
+ control.width = 400
+ control.height = 400
+ compare(control.textArea.background.width, 1)
+ compare(control.textArea.background.height, 1)
+ // hasBackgroundHeight=false
+ control.textArea.background.height = undefined
+ compare(control.textArea.background.width, 1)
+ compare(control.textArea.background.height, 0)
+ control.textArea.background.y = 0
+ compare(control.textArea.background.width, 1)
+ compare(control.textArea.background.height, control.height)
+ control.width = 200
+ control.height = 200
+ compare(control.textArea.background.width, 1)
+ compare(control.textArea.background.height, control.height)
+ }
}
diff --git a/tests/auto/controls/data/tst_tooltip.qml b/tests/auto/controls/data/tst_tooltip.qml
index 18911895..70579c70 100644
--- a/tests/auto/controls/data/tst_tooltip.qml
+++ b/tests/auto/controls/data/tst_tooltip.qml
@@ -205,6 +205,15 @@ TestCase {
else
control.visible = true
compare(control.visible, true)
+ // wait a bit to make sure that it's still visible
+ wait(50)
+ compare(control.visible, true)
+ // re-arm for another 200 ms
+ control.timeout = 200
+ compare(control.visible, true)
+ // ensure that it's still visible after 150 ms (where old timeout < 150 < new timeout)
+ wait(150)
+ compare(control.visible, true)
tryCompare(control, "visible", false)
}
diff --git a/tests/auto/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml
index c9cc10d7..5b3ef6e3 100644
--- a/tests/auto/controls/data/tst_tumbler.qml
+++ b/tests/auto/controls/data/tst_tumbler.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -54,8 +54,8 @@ import QtQuick.Controls 2.12
TestCase {
id: testCase
- width: 200
- height: 200
+ width: 300
+ height: 300
visible: true
when: windowShown
name: "Tumbler"
@@ -513,6 +513,7 @@ TestCase {
Text {
text: parent.displacement.toFixed(2)
anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
}
property real displacement: Tumbler.displacement
@@ -1236,4 +1237,24 @@ TestCase {
// 5 - 2 = 3
compare(tumbler.currentIndex, 3);
}
+
+ function test_displacementAfterResizing() {
+ createTumbler({
+ width: 200,
+ wrap: false,
+ delegate: displacementDelegate,
+ model: 30,
+ visibleItemCount: 7,
+ currentIndex: 15
+ })
+
+ var delegate = findChild(tumblerView, "delegate15")
+ verify(delegate)
+
+ tryCompare(delegate, "displacement", 0)
+
+ // Resizing the Tumbler shouldn't affect the displacement.
+ tumbler.height *= 1.4
+ tryCompare(delegate, "displacement", 0)
+ }
}
diff --git a/tests/auto/focus/BLACKLIST b/tests/auto/focus/BLACKLIST
new file mode 100644
index 00000000..730d3844
--- /dev/null
+++ b/tests/auto/focus/BLACKLIST
@@ -0,0 +1,3 @@
+# QTBUG-78261
+[policy]
+opensuse-leap
diff --git a/tests/auto/focus/tst_focus.cpp b/tests/auto/focus/tst_focus.cpp
index 958b996b..8a1b36ad 100644
--- a/tests/auto/focus/tst_focus.cpp
+++ b/tests/auto/focus/tst_focus.cpp
@@ -232,7 +232,9 @@ void tst_focus::policy()
QVERIFY(!control->hasActiveFocus());
// Qt::WheelFocus
- QWheelEvent wheelEvent(QPoint(control->width() / 2, control->height() / 2), 10, Qt::NoButton, Qt::NoModifier);
+ QWheelEvent wheelEvent(QPointF(control->width() / 2, control->height() / 2), QPointF(),
+ QPoint(), QPoint(0, 10), Qt::NoButton, Qt::NoModifier,
+ Qt::NoScrollPhase, false);
QGuiApplication::sendEvent(control, &wheelEvent);
QVERIFY(!control->hasActiveFocus());
QVERIFY(!control->hasVisualFocus());
@@ -403,7 +405,9 @@ void tst_focus::scope()
QVERIFY(control->hasActiveFocus());
// Qt::WheelFocus
- QWheelEvent wheelEvent(QPoint(control->width() / 2, control->height() / 2), 10, Qt::NoButton, Qt::NoModifier);
+ QWheelEvent wheelEvent(QPointF(control->width() / 2, control->height() / 2), QPointF(),
+ QPoint(), QPoint(0, 10), Qt::NoButton, Qt::NoModifier,
+ Qt::NoScrollPhase, false);
QGuiApplication::sendEvent(control, &wheelEvent);
QVERIFY(!child->hasActiveFocus());
QVERIFY(control->hasActiveFocus());
diff --git a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
index 816f9b67..7644cacf 100644
--- a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
+++ b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
@@ -350,7 +350,8 @@ void tst_QQuickDrawer::position()
QVERIFY(drawer);
drawer->setEdge(edge);
- QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, press);
+ // Give it some time (50 ms) before the press to avoid flakiness on OpenSUSE: QTBUG-77946
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, press, 50);
QTest::mouseMove(window, from);
QTest::mouseMove(window, to);
QCOMPARE(drawer->position(), position);
@@ -403,7 +404,8 @@ void tst_QQuickDrawer::dragMargin()
int leftX = qMax<int>(0, dragMargin);
int leftDistance = startDragDistance + drawer->width() * 0.45;
QVERIFY(leftDistance > QGuiApplication::styleHints()->startDragDistance());
- QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(leftX, drawer->height() / 2));
+ // Give it some time (50 ms) before the press to avoid flakiness on OpenSUSE: QTBUG-77946
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(leftX, drawer->height() / 2), 50);
QTest::mouseMove(window, QPoint(leftX + startDragDistance, drawer->height() / 2));
QTest::mouseMove(window, QPoint(leftX + leftDistance, drawer->height() / 2));
QCOMPARE(drawer->position(), dragFromLeft);
@@ -613,7 +615,9 @@ void tst_QQuickDrawer::wheel_data()
static bool sendWheelEvent(QQuickItem *item, const QPoint &localPos, int degrees)
{
QQuickWindow *window = item->window();
- QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0), QPoint(0, 8 * degrees), 0, Qt::Vertical, Qt::NoButton, 0);
+ QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0),
+ QPoint(0, 8 * degrees), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase,
+ false);
QSpontaneKeyEvent::setSpontaneous(&wheelEvent);
return qGuiApp->notify(window, &wheelEvent);
}
diff --git a/tests/auto/qquickmaterialstyle/data/tst_material.qml b/tests/auto/qquickmaterialstyle/data/tst_material.qml
index 45bc0dab..9f2456b8 100644
--- a/tests/auto/qquickmaterialstyle/data/tst_material.qml
+++ b/tests/auto/qquickmaterialstyle/data/tst_material.qml
@@ -715,39 +715,4 @@ TestCase {
control.destroy()
}
-
- Component {
- id: testResizeBackground
- Item {
- width: 200
- height: 200
- property alias textArea: textArea
- ScrollView {
- anchors.fill: parent
- ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
- TextArea {
- id: textArea
- wrapMode : TextEdit.WordWrap
- readOnly: false
- selectByMouse: true
- focus: true
- text: "test message"
- }
- }
- }
- }
-
- function test_resize_background() {
- var control = testCase.createTemporaryObject(testResizeBackground, testCase)
- compare(control.textArea.background.height, 1)
- compare(control.textArea.background.width, control.width)
- control.width = 400
- control.height = 400
- compare(control.textArea.background.height, 1)
- compare(control.textArea.background.width, control.width)
- control.width = 200
- control.height = 200
- compare(control.textArea.background.height, 1)
- compare(control.textArea.background.width, control.width)
- }
}
diff --git a/tests/auto/qquickpopup/data/toolTipCrashOnClose.qml b/tests/auto/qquickpopup/data/toolTipCrashOnClose.qml
new file mode 100644
index 00000000..8de14f4c
--- /dev/null
+++ b/tests/auto/qquickpopup/data/toolTipCrashOnClose.qml
@@ -0,0 +1,94 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 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.13
+import QtQuick.Window 2.13
+import QtQuick.Controls 2.13
+import QtGraphicalEffects 1.13
+
+Window {
+ width: 640
+ height: 480
+
+ readonly property bool toolTipOpened: mouseArea.ToolTip.toolTip.opened
+
+ Component.onCompleted: contentItem.objectName = "windowContentItem"
+
+ // For the setOverlayParentToNull test.
+ function nullifyOverlayParent() {
+ Overlay.overlay.parent = null
+ }
+
+ Item {
+ objectName: "outerItem"
+ anchors.fill: parent
+
+ Item {
+ objectName: "innerItem"
+ anchors.fill: parent
+
+ ColorOverlay {
+ objectName: "colorOverlay"
+ source: parent
+ anchors.fill: parent
+ }
+
+ MouseArea {
+ id: mouseArea
+ objectName: "mouseArea"
+ anchors.fill: parent
+ hoverEnabled: true
+
+ ToolTip.visible: containsMouse
+ ToolTip.text: "ToolTip text"
+ }
+ }
+ }
+}
diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp
index c2f876b8..e1e2c470 100644
--- a/tests/auto/qquickpopup/tst_qquickpopup.cpp
+++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp
@@ -89,6 +89,8 @@ private slots:
void disabledPalette();
void disabledParentPalette();
void countChanged();
+ void toolTipCrashOnClose();
+ void setOverlayParentToNull();
};
void tst_QQuickPopup::initTestCase()
@@ -494,7 +496,7 @@ void tst_QQuickPopup::closePolicy()
QTRY_VERIFY(popup->isOpened());
// press outside popup and its parent
- QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(1, 1));
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(1, 1), 50);
if (closePolicy.testFlag(QQuickPopup::CloseOnPressOutside) || closePolicy.testFlag(QQuickPopup::CloseOnPressOutsideParent))
QTRY_VERIFY(!popup->isVisible());
else
@@ -741,7 +743,9 @@ void tst_QQuickPopup::wheel_data()
static bool sendWheelEvent(QQuickItem *item, const QPoint &localPos, int degrees)
{
QQuickWindow *window = item->window();
- QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0), QPoint(0, 8 * degrees), 0, Qt::Vertical, Qt::NoButton, 0);
+ QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0),
+ QPoint(0, 8 * degrees), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase,
+ false);
QSpontaneKeyEvent::setSpontaneous(&wheelEvent);
return qGuiApp->notify(window, &wheelEvent);
}
@@ -1187,6 +1191,46 @@ void tst_QQuickPopup::countChanged()
QVERIFY(window->setProperty("isModel1", false));
QTRY_COMPARE(window->property("count").toInt(), 2);
}
+
+// QTBUG-73243
+void tst_QQuickPopup::toolTipCrashOnClose()
+{
+ QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml");
+
+ QQuickWindow *window = helper.window;
+ window->show();
+ // TODO: Using ignoreMessage() fails in CI with macOS for release builds,
+ // so for now we let the warning through.
+// QTest::ignoreMessage(QtWarningMsg, "ShaderEffectSource: 'recursive' must be set to true when rendering recursively.");
+ QVERIFY(QTest::qWaitForWindowActive(window));
+
+ QTest::mouseMove(window, QPoint(window->width() / 2, window->height() / 2));
+ QTRY_VERIFY(window->property("toolTipOpened").toBool());
+
+ QVERIFY(window->close());
+ // Shouldn't crash.
+}
+
+void tst_QQuickPopup::setOverlayParentToNull()
+{
+ QQuickApplicationHelper helper(this, "toolTipCrashOnClose.qml");
+
+ QQuickWindow *window = helper.window;
+ window->show();
+ // TODO: Using ignoreMessage() fails in CI with macOS for release builds,
+ // so for now we let the warning through.
+// QTest::ignoreMessage(QtWarningMsg, "ShaderEffectSource: 'recursive' must be set to true when rendering recursively.");
+ QVERIFY(QTest::qWaitForWindowActive(window));
+
+ QVERIFY(QMetaObject::invokeMethod(window, "nullifyOverlayParent"));
+
+ QTest::mouseMove(window, QPoint(window->width() / 2, window->height() / 2));
+ QTRY_VERIFY(window->property("toolTipOpened").toBool());
+
+ QVERIFY(window->close());
+ // While nullifying the overlay parent doesn't make much sense, it shouldn't crash.
+}
+
QTEST_QUICKCONTROLS_MAIN(tst_QQuickPopup)
#include "tst_qquickpopup.moc"
diff --git a/tests/auto/translation/data/dialogButtonBox.qml b/tests/auto/translation/data/dialogButtonBox.qml
new file mode 100644
index 00000000..03a3ae0e
--- /dev/null
+++ b/tests/auto/translation/data/dialogButtonBox.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 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.13
+import QtQuick.Controls 2.13
+
+Item {
+ property Dialog dialog: Dialog {
+ width: 300
+ height: 300
+ visible: true
+ standardButtons: DialogButtonBox.Save | DialogButtonBox.Discard
+ }
+}
diff --git a/tests/auto/translation/qtbase_fr.ts b/tests/auto/translation/qtbase_fr.ts
new file mode 100644
index 00000000..a2a05a07
--- /dev/null
+++ b/tests/auto/translation/qtbase_fr.ts
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="fr_FR">
+<context>
+ <name>QPlatformTheme</name>
+ <message>
+ <source>Save</source>
+ <translation>Enregistrer</translation>
+ </message>
+ <message>
+ <source>Discard</source>
+ <translation>Ne pas tenir compte</translation>
+ </message>
+</context>
+<context>
+ <name>QGnomeTheme</name>
+ <message>
+ <source>&amp;Save</source>
+ <translation>&amp;Enregistrer</translation>
+ </message>
+</context>
+</TS>
diff --git a/tests/auto/translation/translation.pro b/tests/auto/translation/translation.pro
new file mode 100644
index 00000000..d2d9d6ee
--- /dev/null
+++ b/tests/auto/translation/translation.pro
@@ -0,0 +1,19 @@
+CONFIG += testcase
+TARGET = tst_translation
+SOURCES += tst_translation.cpp
+
+macos:CONFIG -= app_bundle
+
+QT += testlib gui-private quicktemplates2-private
+
+include (../shared/util.pri)
+
+TESTDATA = data/*
+
+OTHER_FILES += \
+ data/*.qml
+
+# We only want to run lrelease, which is why we use EXTRA_TRANSLATIONS.
+EXTRA_TRANSLATIONS = qtbase_fr.ts
+# Embed the translations in a qrc file.
+CONFIG += lrelease embed_translations
diff --git a/tests/auto/translation/tst_translation.cpp b/tests/auto/translation/tst_translation.cpp
new file mode 100644
index 00000000..9cbca915
--- /dev/null
+++ b/tests/auto/translation/tst_translation.cpp
@@ -0,0 +1,100 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite 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$
+**
+****************************************************************************/
+
+#include <QtTest/qtest.h>
+#include "../shared/visualtestutil.h"
+
+#include <QtCore/qtranslator.h>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpa/qplatformtheme.h>
+#include <QtQuick/qquickview.h>
+#include <QtQuickTemplates2/private/qquickabstractbutton_p.h>
+#include <QtQuickTemplates2/private/qquickdialog_p.h>
+#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>
+
+using namespace QQuickVisualTestUtil;
+
+class tst_translation : public QQmlDataTest
+{
+ Q_OBJECT
+
+private slots:
+ void dialogButtonBox();
+};
+
+void tst_translation::dialogButtonBox()
+{
+ QQuickView view(testFileUrl("dialogButtonBox.qml"));
+ if (view.status() != QQuickView::Ready)
+ QFAIL("Failed to load QML file");
+ view.show();
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+
+ QQuickDialog *dialog = view.rootObject()->property("dialog").value<QQuickDialog*>();
+ QVERIFY(dialog);
+
+ QQuickDialogButtonBox *dialogButtonBox = qobject_cast<QQuickDialogButtonBox*>(dialog->footer());
+ QVERIFY(dialogButtonBox);
+
+ QQuickAbstractButton *saveButton = dialogButtonBox->standardButton(QPlatformDialogHelper::Save);
+ QVERIFY(saveButton);
+ QString defaultSaveText = QGuiApplicationPrivate::platformTheme()->standardButtonText(QPlatformDialogHelper::Save);
+ defaultSaveText = QPlatformTheme::removeMnemonics(defaultSaveText);
+ QCOMPARE(saveButton->text(), defaultSaveText);
+
+ QQuickAbstractButton *discardButton = dialogButtonBox->standardButton(QPlatformDialogHelper::Discard);
+ QVERIFY(discardButton);
+ QString defaultDiscardText = QGuiApplicationPrivate::platformTheme()->standardButtonText(QPlatformDialogHelper::Discard);
+ defaultDiscardText = QPlatformTheme::removeMnemonics(defaultDiscardText);
+ QCOMPARE(discardButton->text(), defaultDiscardText);
+
+ QTranslator translator;
+ QVERIFY(translator.load(":/i18n/qtbase_fr.qm"));
+ QVERIFY(qApp->installTranslator(&translator));
+ view.engine()->retranslate();
+
+ QString translatedSaveText = QGuiApplicationPrivate::platformTheme()->standardButtonText(QPlatformDialogHelper::Save);
+ translatedSaveText = QPlatformTheme::removeMnemonics(translatedSaveText);
+ QCOMPARE(saveButton->text(), translatedSaveText);
+
+ QString translatedDiscardText = QGuiApplicationPrivate::platformTheme()->standardButtonText(QPlatformDialogHelper::Discard);
+ translatedDiscardText = QPlatformTheme::removeMnemonics(translatedDiscardText);
+ QCOMPARE(discardButton->text(), translatedDiscardText);
+}
+
+QTEST_MAIN(tst_translation)
+
+#include "tst_translation.moc"