aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/calendar/qquickcalendar.cpp2
-rw-r--r--src/imports/calendar/qquickcalendarmodel.cpp2
-rw-r--r--src/imports/calendar/qquickdayofweekrow.cpp2
-rw-r--r--src/imports/calendar/qquickmonthgrid.cpp2
-rw-r--r--src/imports/calendar/qquickweeknumbercolumn.cpp2
-rw-r--r--src/imports/calendar/qquickweeknumbermodel.cpp2
-rw-r--r--src/imports/controls/ComboBox.qml11
-rw-r--r--src/imports/controls/HorizontalHeaderView.qml66
-rw-r--r--src/imports/controls/VerticalHeaderView.qml66
-rw-r--r--src/imports/controls/controls.pri4
-rw-r--r--src/imports/controls/controls.pro2
-rw-r--r--src/imports/controls/designer/qtquickcontrols2.metainfo4
-rw-r--r--src/imports/controls/doc/qtquickcontrols.qdocconf2
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml119
-rw-r--r--src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml8
-rw-r--r--src/imports/controls/doc/src/includes/customize-button-background.qdocinc25
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc125
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc2
-rw-r--r--src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc14
-rw-r--r--src/imports/controls/fusion/ComboBox.qml15
-rw-r--r--src/imports/controls/fusion/HorizontalHeaderView.qml76
-rw-r--r--src/imports/controls/fusion/VerticalHeaderView.qml76
-rw-r--r--src/imports/controls/fusion/fusion.pri4
-rw-r--r--src/imports/controls/fusion/qquickfusiondial.cpp2
-rw-r--r--src/imports/controls/imagine/ComboBox.qml13
-rw-r--r--src/imports/controls/imagine/Dial.qml3
-rw-r--r--src/imports/controls/imagine/HorizontalHeaderView.qml66
-rw-r--r--src/imports/controls/imagine/VerticalHeaderView.qml66
-rw-r--r--src/imports/controls/imagine/imagine.pri4
-rw-r--r--src/imports/controls/imagine/qquickimaginestyle.cpp2
-rw-r--r--src/imports/controls/material/ComboBox.qml15
-rw-r--r--src/imports/controls/material/HorizontalHeaderView.qml67
-rw-r--r--src/imports/controls/material/VerticalHeaderView.qml67
-rw-r--r--src/imports/controls/material/material.pri4
-rw-r--r--src/imports/controls/material/shaders/+qsb/RectangularGlow.fragbin2321 -> 2007 bytes
-rw-r--r--src/imports/controls/material/shaders/compile.bat40
-rw-r--r--src/imports/controls/qquickdefaultbusyindicator.cpp2
-rw-r--r--src/imports/controls/qquickdefaultprogressbar.cpp2
-rw-r--r--src/imports/controls/qtquickcontrols2plugin.cpp14
-rw-r--r--src/imports/controls/universal/ComboBox.qml13
-rw-r--r--src/imports/controls/universal/HorizontalHeaderView.qml68
-rw-r--r--src/imports/controls/universal/VerticalHeaderView.qml68
-rw-r--r--src/imports/controls/universal/universal.pri4
-rw-r--r--src/imports/platform/qquickplatformcolordialog.cpp2
-rw-r--r--src/imports/platform/qquickplatformdialog.cpp6
-rw-r--r--src/imports/platform/qquickplatformfiledialog.cpp6
-rw-r--r--src/imports/platform/qquickplatformfolderdialog.cpp4
-rw-r--r--src/imports/platform/qquickplatformfontdialog.cpp2
-rw-r--r--src/imports/platform/qquickplatformmenu.cpp6
-rw-r--r--src/imports/platform/qquickplatformmenubar.cpp4
-rw-r--r--src/imports/platform/qquickplatformmenuitem.cpp4
-rw-r--r--src/imports/platform/qquickplatformmenuitemgroup.cpp4
-rw-r--r--src/imports/platform/qquickplatformmenuseparator.cpp2
-rw-r--r--src/imports/platform/qquickplatformmessagedialog.cpp2
-rw-r--r--src/imports/platform/qquickplatformstandardpaths.cpp20
-rw-r--r--src/imports/platform/qquickplatformsystemtrayicon.cpp4
-rw-r--r--src/imports/templates/qtquicktemplates2plugin.cpp36
57 files changed, 1135 insertions, 118 deletions
diff --git a/src/imports/calendar/qquickcalendar.cpp b/src/imports/calendar/qquickcalendar.cpp
index 2ad449f1..3b16d7f9 100644
--- a/src/imports/calendar/qquickcalendar.cpp
+++ b/src/imports/calendar/qquickcalendar.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Calendar
\inherits QObject
- \instantiates QQuickCalendar
+//! \instantiates QQuickCalendar
\inqmlmodule Qt.labs.calendar
\brief A calendar namespace.
diff --git a/src/imports/calendar/qquickcalendarmodel.cpp b/src/imports/calendar/qquickcalendarmodel.cpp
index 053a4a5f..ee5e0bd3 100644
--- a/src/imports/calendar/qquickcalendarmodel.cpp
+++ b/src/imports/calendar/qquickcalendarmodel.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype CalendarModel
\inherits QAbstractListModel
- \instantiates QQuickCalendarModel
+//! \instantiates QQuickCalendarModel
\inqmlmodule Qt.labs.calendar
\brief A calendar model.
diff --git a/src/imports/calendar/qquickdayofweekrow.cpp b/src/imports/calendar/qquickdayofweekrow.cpp
index da3264f9..d5432f8e 100644
--- a/src/imports/calendar/qquickdayofweekrow.cpp
+++ b/src/imports/calendar/qquickdayofweekrow.cpp
@@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype DayOfWeekRow
\inherits Control
- \instantiates QQuickDayOfWeekRow
+//! \instantiates QQuickDayOfWeekRow
\inqmlmodule Qt.labs.calendar
\brief A row of names for the days in a week.
diff --git a/src/imports/calendar/qquickmonthgrid.cpp b/src/imports/calendar/qquickmonthgrid.cpp
index 46b18db6..966b0c60 100644
--- a/src/imports/calendar/qquickmonthgrid.cpp
+++ b/src/imports/calendar/qquickmonthgrid.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype MonthGrid
\inherits Control
- \instantiates QQuickMonthGrid
+//! \instantiates QQuickMonthGrid
\inqmlmodule Qt.labs.calendar
\brief A grid of days for a calendar month.
diff --git a/src/imports/calendar/qquickweeknumbercolumn.cpp b/src/imports/calendar/qquickweeknumbercolumn.cpp
index c1179879..6c661274 100644
--- a/src/imports/calendar/qquickweeknumbercolumn.cpp
+++ b/src/imports/calendar/qquickweeknumbercolumn.cpp
@@ -45,7 +45,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype WeekNumberColumn
\inherits Control
- \instantiates QQuickWeekNumberColumn
+//! \instantiates QQuickWeekNumberColumn
\inqmlmodule Qt.labs.calendar
\brief A column of week numbers.
diff --git a/src/imports/calendar/qquickweeknumbermodel.cpp b/src/imports/calendar/qquickweeknumbermodel.cpp
index c45d8938..8144fb12 100644
--- a/src/imports/calendar/qquickweeknumbermodel.cpp
+++ b/src/imports/calendar/qquickweeknumbermodel.cpp
@@ -46,7 +46,7 @@ class QQuickWeekNumberModelPrivate : public QAbstractItemModelPrivate
Q_DECLARE_PUBLIC(QQuickWeekNumberModel)
public:
- QQuickWeekNumberModelPrivate() : month(-1), year(-1)
+ QQuickWeekNumberModelPrivate() : month(-1), year(-1), weekNumbers{}
{
QDate date = QDate::currentDate();
init(date.month(), date.year(), locale);
diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml
index 8eefc686..b30293f5 100644
--- a/src/imports/controls/ComboBox.qml
+++ b/src/imports/controls/ComboBox.qml
@@ -34,11 +34,11 @@
**
****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Window 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Controls.impl 2.14
-import QtQuick.Templates 2.14 as T
+import QtQuick 2.15
+import QtQuick.Window 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Controls.impl 2.15
+import QtQuick.Templates 2.15 as T
T.ComboBox {
id: control
@@ -84,6 +84,7 @@ T.ComboBox {
readOnly: control.down
inputMethodHints: control.inputMethodHints
validator: control.validator
+ selectByMouse: control.selectTextByMouse
font: control.font
color: control.editable ? control.palette.text : control.palette.buttonText
diff --git a/src/imports/controls/HorizontalHeaderView.qml b/src/imports/controls/HorizontalHeaderView.qml
new file mode 100644
index 00000000..7f0454da
--- /dev/null
+++ b/src/imports/controls/HorizontalHeaderView.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+
+T.HorizontalHeaderView {
+ id: control
+
+ implicitWidth: syncView ? syncView.width : 0
+ implicitHeight: contentHeight
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: text.implicitWidth + (cellPadding * 2)
+ implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2))
+ color: "#f6f6f6"
+ border.color: "#e4e4e4"
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "#ff26282a"
+ }
+ }
+}
diff --git a/src/imports/controls/VerticalHeaderView.qml b/src/imports/controls/VerticalHeaderView.qml
new file mode 100644
index 00000000..5fbfaedf
--- /dev/null
+++ b/src/imports/controls/VerticalHeaderView.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+
+T.VerticalHeaderView {
+ id: control
+
+ implicitWidth: contentWidth
+ implicitHeight: syncView ? syncView.height : 0
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2))
+ implicitHeight: text.implicitHeight + (cellPadding * 2)
+ color: "#f6f6f6"
+ border.color: "#e4e4e4"
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "#ff26282a"
+ }
+ }
+}
diff --git a/src/imports/controls/controls.pri b/src/imports/controls/controls.pri
index fbf5d075..03fc0f4b 100644
--- a/src/imports/controls/controls.pri
+++ b/src/imports/controls/controls.pri
@@ -32,6 +32,7 @@ QML_FILES += \
$$PWD/Drawer.qml \
$$PWD/Frame.qml \
$$PWD/GroupBox.qml \
+ $$PWD/HorizontalHeaderView.qml \
$$PWD/ItemDelegate.qml \
$$PWD/Label.qml \
$$PWD/Menu.qml \
@@ -67,4 +68,5 @@ QML_FILES += \
$$PWD/ToolButton.qml \
$$PWD/ToolSeparator.qml \
$$PWD/ToolTip.qml \
- $$PWD/Tumbler.qml
+ $$PWD/Tumbler.qml \
+ $$PWD/VerticalHeaderView.qml
diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro
index 2aeaf9ab..66373d55 100644
--- a/src/imports/controls/controls.pro
+++ b/src/imports/controls/controls.pro
@@ -19,7 +19,7 @@ SOURCES += \
RESOURCES += \
$$PWD/qtquickcontrols2plugin.qrc
-!static: qtConfig(quick-designer): include(designer/designer.pri)
+qtConfig(quick-designer): include(designer/designer.pri)
include(doc/doc.pri)
CONFIG += no_cxx_module install_qml_files builtin_resources qtquickcompiler
diff --git a/src/imports/controls/designer/qtquickcontrols2.metainfo b/src/imports/controls/designer/qtquickcontrols2.metainfo
index 9e6030b1..d27f1b90 100644
--- a/src/imports/controls/designer/qtquickcontrols2.metainfo
+++ b/src/imports/controls/designer/qtquickcontrols2.metainfo
@@ -443,7 +443,7 @@ MetaInfo {
version: "2.0"
requiredImport: "QtQuick.Controls"
- Property { name: "text"; type: "binding"; value: "qsTr(\"Text Area\")" }
+ Property { name: "placeholderText"; type: "binding"; value: "qsTr(\"Text Area\")" }
}
}
@@ -458,7 +458,7 @@ MetaInfo {
version: "2.0"
requiredImport: "QtQuick.Controls"
- Property { name: "text"; type: "binding"; value: "qsTr(\"Text Field\")" }
+ Property { name: "placeholderText"; type: "binding"; value: "qsTr(\"Text Field\")" }
}
}
diff --git a/src/imports/controls/doc/qtquickcontrols.qdocconf b/src/imports/controls/doc/qtquickcontrols.qdocconf
index f6798f1f..d52aceb8 100644
--- a/src/imports/controls/doc/qtquickcontrols.qdocconf
+++ b/src/imports/controls/doc/qtquickcontrols.qdocconf
@@ -33,7 +33,7 @@ qhp.QtQuickControls.subprojects.examples.title = Examples
qhp.QtQuickControls.subprojects.examples.indexTitle = Qt Quick Controls Examples
qhp.QtQuickControls.subprojects.examples.selectors = fake:example
-depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols1 qtquickextras qmake qtsql qtwidgets qtlabscalendar qtlabsplatform qtgraphicaleffects
+depends = qtcore qtgui qtdoc qtqml qtqmlmodels qtquick qtquickdialogs qtquickcontrols1 qtquickextras qmake qtsql qtwidgets qtlabscalendar qtlabsplatform qtgraphicaleffects
# Specify the install path under QT_INSTALL_EXAMPLES
# Note: paths passed to \example command must contain the parent directory, e.g.
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml
new file mode 100644
index 00000000..07ec84d8
--- /dev/null
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-headerview-simple.qml
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+//![file]
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import Qt.labs.qmlmodels 1.0
+
+ApplicationWindow {
+ visible: true
+ width: 640
+ height: 480
+
+ //! [horizontal]
+ HorizontalHeaderView {
+ id: horizontalHeader
+ syncView: tableView
+ anchors.left: tableView.left
+ }
+ //! [horizontal]
+
+ //! [vertical]
+ VerticalHeaderView {
+ id: verticalHeader
+ syncView: tableView
+ anchors.top: tableView.top
+ }
+ //! [vertical]
+
+ TableView {
+ id: tableView
+ anchors.fill: parent
+ anchors.topMargin: horizontalHeader.height
+ anchors.leftMargin: verticalHeader.width
+ columnSpacing: 1
+ rowSpacing: 1
+ clip: true
+
+ model: TableModel {
+ TableModelColumn { display: "name" }
+ TableModelColumn { display: "color" }
+
+ rows: [
+ {
+ "name": "cat",
+ "color": "black"
+ },
+ {
+ "name": "dog",
+ "color": "brown"
+ },
+ {
+ "name": "bird",
+ "color": "white"
+ }
+ ]
+ }
+
+ delegate: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 50
+ border.width: 1
+
+ Text {
+ text: display
+ anchors.centerIn: parent
+ }
+ }
+ }
+}
+
+//![file]
diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml
index 1c5db214..b8510ddd 100644
--- a/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml
+++ b/src/imports/controls/doc/snippets/qtquickcontrols2-rangeslider-custom.qml
@@ -54,22 +54,22 @@ RangeSlider {
}
first.handle: Rectangle {
- x: control.leftPadding + first.visualPosition * (control.availableWidth - width)
+ x: control.leftPadding + control.first.visualPosition * (control.availableWidth - width)
y: control.topPadding + control.availableHeight / 2 - height / 2
implicitWidth: 26
implicitHeight: 26
radius: 13
- color: first.pressed ? "#f0f0f0" : "#f6f6f6"
+ color: control.first.pressed ? "#f0f0f0" : "#f6f6f6"
border.color: "#bdbebf"
}
second.handle: Rectangle {
- x: control.leftPadding + second.visualPosition * (control.availableWidth - width)
+ x: control.leftPadding + control.second.visualPosition * (control.availableWidth - width)
y: control.topPadding + control.availableHeight / 2 - height / 2
implicitWidth: 26
implicitHeight: 26
radius: 13
- color: second.pressed ? "#f0f0f0" : "#f6f6f6"
+ color: control.second.pressed ? "#f0f0f0" : "#f6f6f6"
border.color: "#bdbebf"
}
}
diff --git a/src/imports/controls/doc/src/includes/customize-button-background.qdocinc b/src/imports/controls/doc/src/includes/customize-button-background.qdocinc
new file mode 100644
index 00000000..59df7d8e
--- /dev/null
+++ b/src/imports/controls/doc/src/includes/customize-button-background.qdocinc
@@ -0,0 +1,25 @@
+//! [file]
+\qml \QtMinorVersion
+import QtQuick 2.\1
+import QtQuick.Controls 2.\1
+
+ApplicationWindow {
+ width: 400
+ height: 400
+ visible: true
+
+ Button {
+ id: button
+ text: "A Special Button"
+ background: Rectangle {
+ implicitWidth: 100
+ implicitHeight: 40
+ color: button.down ? "#d6d6d6" : "#f6f6f6"
+ border.color: "#26282a"
+ border.width: 1
+ radius: 4
+ }
+ }
+}
+\endqml
+//! [file]
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
index cd06a456..5901663a 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -48,29 +48,7 @@
can override the \l {Control::}{background} item and set the radius
property of Rectangle:
- \qml \QtMinorVersion
- import QtQuick 2.\1
- import QtQuick.Controls 2.\1
-
- ApplicationWindow {
- width: 400
- height: 400
- visible: true
-
- Button {
- id: button
- text: "A Special Button"
- background: Rectangle {
- implicitWidth: 100
- implicitHeight: 40
- color: button.down ? "#d6d6d6" : "#f6f6f6"
- border.color: "#26282a"
- border.width: 1
- radius: 4
- }
- }
- }
- \endqml
+ \include customize-button-background.qdocinc file
The second way to create the button is good if you plan to use your rounded
button in several places. It involves moving the code into its own QML file
@@ -166,7 +144,8 @@
By default, the styling system uses the Default style as a fallback for
controls that aren't implemented. To customize or extend any other built-in
- style, it is possible to specify a different fallback style using \l QQuickStyle.
+ style, it is possible to specify a different fallback style using
+ \l[QtQuickControls2]{QQuickStyle}.
What this means is that you can implement as many controls as you like for
your custom style, and place them almost anywhere. It also allows users to
@@ -175,7 +154,7 @@
\section3 Previewing Custom Styles in Qt Quick Designer
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,
+ in Qt Quick Designer. In order to do so,
ensure that the project has a
\l {Qt Quick Controls Configuration File}{qtquickcontrols2.conf} file,
and that the following entry exists:
@@ -213,6 +192,102 @@
files.
\endlist
+ \section3 Considerations for custom styles
+
+ When implementing your own style and customizing controls, there are some
+ points to keep in mind to ensure that your application is as performant as
+ possible.
+
+ \section4 Avoid assigning an id to styles' implementations of item delegates
+
+ As explained in \l {Definition of a Style}, when you implement your
+ own style for a control, you start off with the relevant template for
+ that control. For example, a style's \c Button.qml will be structured
+ similarly to this:
+
+ \qml
+ T.Button {
+ // ...
+
+ background: Rectangle {
+ // ...
+ }
+
+ contentItem: Text {
+ // ...
+ }
+
+ // ...
+ }
+ \endqml
+
+ When you use a Button in your application, the \c background and
+ \c contentItem items will be created and parented to the root \c Button
+ item:
+
+ \qml
+ // Creates the Button root item, the Rectangle background,
+ // and the Text contentItem.
+ Button {
+ text: qsTr("Confirm")
+ }
+ \endqml
+
+ Suppose you then needed to do a one-off customization of the Button (as
+ explained in \l {Customizing a Control}):
+
+ \include customize-button-background.qdocinc file
+
+ In QML, this would normally result in both the default \c background
+ implementation and the one-off, custom \c background items being created.
+ Qt Quick Controls uses a technique that avoids creating both items, and
+ instead only creates the custom \c background, greatly improving the
+ creation performance of controls.
+
+ This technique relies on the absence of an \l {The id Attribute}{id} in the
+ style's implementation of that item. If an id is assigned, the technique
+ cannot work, and both items will be created. For example, it can be
+ tempting to assign an id to the \c background or \c contentItem so that
+ other objects within the file can refer to those items:
+
+ \qml
+ T.Button {
+ // ...
+
+ background: Rectangle {
+ id: backgroundRect
+ // ...
+ }
+
+ contentItem: Text {
+ // Use backgroundRect in some way...
+ }
+
+ // ...
+ }
+ \endqml
+
+ With this code, every time a Button instance with a customized background
+ is created, both backgrounds will be created, resulting in sub-optimal
+ creation performance.
+
+ Prior to Qt 5.15, the old, unused background would be deleted to release
+ the resources associated with it. However, as the control does not own the
+ items, it should not delete them. As of Qt 5.15, old items are no longer
+ deleted, and so the \c backgroundRect item will live longer than it needs
+ to—typically until the application exits. Although the old item will be
+ hidden, visually unparented from the control, and removed from the
+ accessibility tree, it is important to keep the creation time and memory
+ usage of these unused items in mind when assigning an id in this context.
+
+ \section4 Avoid imperative assignments of custom items
+
+ The technique mentioned in the section above only works when an item is
+ \l {Prefer Declarative Bindings Over Imperative Assignments}{declaratively}
+ assigned for the first time, and so imperative assignments will result in
+ orphaned items. Always use declarative bindings to assign custom items
+ when possible.
+
\section3 Attached properties
It is common for a style to have certain properties or attributes that
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
index 6e15762d..ac2e9cc1 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-imagine.qdoc
@@ -2478,7 +2478,7 @@
The Imagine style supports palette customization via the \l {Control::}{palette}
property and the \l {Palette Configuration}{qtquickcontrols2.conf} file.
- As with other styles, the exact \l {palette QML Basic Type}{palette roles}
+ As with other styles, the exact \l[QML]{palette}{palette roles}
that the Imagine style uses are style-dependent. However, as most of the visual
appearance of controls (for example: backgrounds) are managed through image assets,
only the roles that are typically used for text will have an effect.
diff --git a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
index 75e59f42..ddf41771 100644
--- a/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
+++ b/src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc
@@ -70,15 +70,15 @@
\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
+ style using \l[CPP]{QQuickStyle} in C++, pass a command line argument, or set an
environment variable. Alternatively, the preferred style and style-specific
attributes can be specified in a configuration file.
The priority of these approaches follows the order they are listed below,
- from highest to lowest. That is, using QQuickStyle to set the style will
+ from highest to lowest. That is, using \c QQuickStyle to set the style will
always take priority over using the command line argument, for example.
- \warning When resolving a given style name to an absolute path, QQuickStyle
+ \warning When resolving a given style name to an absolute path, \c QQuickStyle
may search the root resource directory (\c {:}). Consequently, make sure
that your resource directories are named differently than the names of the
styles that your application supports. Otherwise, the styles may not load.
@@ -87,14 +87,16 @@
\section2 Using QQuickStyle in C++
- \l QQuickStyle provides C++ API for configuring a specific style. The following
- example runs a Qt Quick Controls application with the Material style:
+ \l[CPP]{QQuickStyle} provides C++ API for configuring a specific
+ style. The following example runs a Qt Quick Controls application
+ with the Material style:
\code
QQuickStyle::setStyle("Material");
\endcode
- See the detailed description of \l QQuickStyle for more details.
+ See the detailed description of \l[CPP]{QQuickStyle} for more
+ details.
\section2 Command line argument
diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml
index e9b836ef..d8ef1888 100644
--- a/src/imports/controls/fusion/ComboBox.qml
+++ b/src/imports/controls/fusion/ComboBox.qml
@@ -34,13 +34,13 @@
**
****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Window 2.14
-import QtQuick.Templates 2.14 as T
-import QtQuick.Controls 2.14
-import QtQuick.Controls.impl 2.14
-import QtQuick.Controls.Fusion 2.14
-import QtQuick.Controls.Fusion.impl 2.14
+import QtQuick 2.15
+import QtQuick.Window 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls 2.15
+import QtQuick.Controls.impl 2.15
+import QtQuick.Controls.Fusion 2.15
+import QtQuick.Controls.Fusion.impl 2.15
T.ComboBox {
id: control
@@ -84,6 +84,7 @@ T.ComboBox {
readOnly: control.down
inputMethodHints: control.inputMethodHints
validator: control.validator
+ selectByMouse: control.selectTextByMouse
font: control.font
color: control.editable ? control.palette.text : control.palette.buttonText
diff --git a/src/imports/controls/fusion/HorizontalHeaderView.qml b/src/imports/controls/fusion/HorizontalHeaderView.qml
new file mode 100644
index 00000000..3d0f247b
--- /dev/null
+++ b/src/imports/controls/fusion/HorizontalHeaderView.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+
+T.HorizontalHeaderView {
+ id: control
+
+ implicitWidth: syncView ? syncView.width : 0
+ implicitHeight: contentHeight
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: text.implicitWidth + (cellPadding * 2)
+ implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2))
+ border.color: "#cacaca"
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: "#fbfbfb"
+ }
+ GradientStop {
+ position: 1
+ color: "#e0dfe0"
+ }
+ }
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "#ff26282a"
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/VerticalHeaderView.qml b/src/imports/controls/fusion/VerticalHeaderView.qml
new file mode 100644
index 00000000..5ad0db8f
--- /dev/null
+++ b/src/imports/controls/fusion/VerticalHeaderView.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+
+T.VerticalHeaderView {
+ id: control
+
+ implicitWidth: contentWidth
+ implicitHeight: syncView ? syncView.height : 0
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2))
+ implicitHeight: text.implicitHeight + (cellPadding * 2)
+ border.color: "#cacaca"
+
+ gradient: Gradient {
+ GradientStop {
+ position: 0
+ color: "#fbfbfb"
+ }
+ GradientStop {
+ position: 1
+ color: "#e0dfe0"
+ }
+ }
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "#ff26282a"
+ }
+ }
+}
diff --git a/src/imports/controls/fusion/fusion.pri b/src/imports/controls/fusion/fusion.pri
index 72978db5..bdc413fd 100644
--- a/src/imports/controls/fusion/fusion.pri
+++ b/src/imports/controls/fusion/fusion.pri
@@ -28,6 +28,7 @@ QML_FILES += \
$$PWD/Drawer.qml \
$$PWD/Frame.qml \
$$PWD/GroupBox.qml \
+ $$PWD/HorizontalHeaderView.qml \
$$PWD/ItemDelegate.qml \
$$PWD/Label.qml \
$$PWD/Menu.qml \
@@ -64,4 +65,5 @@ QML_FILES += \
$$PWD/ToolButton.qml \
$$PWD/ToolSeparator.qml \
$$PWD/ToolTip.qml \
- $$PWD/Tumbler.qml
+ $$PWD/Tumbler.qml \
+ $$PWD/VerticalHeaderView.qml
diff --git a/src/imports/controls/fusion/qquickfusiondial.cpp b/src/imports/controls/fusion/qquickfusiondial.cpp
index 182f5c0f..50436634 100644
--- a/src/imports/controls/fusion/qquickfusiondial.cpp
+++ b/src/imports/controls/fusion/qquickfusiondial.cpp
@@ -84,7 +84,7 @@ void QQuickFusionDial::paint(QPainter *painter)
QColor buttonColor = m_palette.button().color();
const bool enabled = isEnabled();
- qreal r = qMin(width, height) / 2;
+ qreal r = qMin(width, height) / 2.0;
r -= r/50;
const qreal penSize = r/20.0;
diff --git a/src/imports/controls/imagine/ComboBox.qml b/src/imports/controls/imagine/ComboBox.qml
index 2d582e98..92937826 100644
--- a/src/imports/controls/imagine/ComboBox.qml
+++ b/src/imports/controls/imagine/ComboBox.qml
@@ -34,12 +34,12 @@
**
****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Window 2.14
-import QtQuick.Templates 2.14 as T
-import QtQuick.Controls 2.14
-import QtQuick.Controls.Imagine 2.14
-import QtQuick.Controls.Imagine.impl 2.14
+import QtQuick 2.15
+import QtQuick.Window 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls 2.15
+import QtQuick.Controls.Imagine 2.15
+import QtQuick.Controls.Imagine.impl 2.15
T.ComboBox {
id: control
@@ -98,6 +98,7 @@ T.ComboBox {
readOnly: control.down
inputMethodHints: control.inputMethodHints
validator: control.validator
+ selectByMouse: control.selectTextByMouse
font: control.font
color: control.flat ? control.palette.windowText : control.editable ? control.palette.text : control.palette.buttonText
diff --git a/src/imports/controls/imagine/Dial.qml b/src/imports/controls/imagine/Dial.qml
index f10634e6..f8c394f3 100644
--- a/src/imports/controls/imagine/Dial.qml
+++ b/src/imports/controls/imagine/Dial.qml
@@ -74,7 +74,7 @@ T.Dial {
transform: [
Translate {
- y: -background.height * 0.4 + handle.height / 2
+ y: -Math.min(control.background.width, control.background.height) * 0.4 + control.handle.height / 2
},
Rotation {
angle: control.angle
@@ -89,6 +89,7 @@ T.Dial {
y: control.height / 2 - height / 2
width: Math.max(64, Math.min(control.width, control.height))
height: width
+ fillMode: Image.PreserveAspectFit
source: Imagine.url + "dial-background"
NinePatchImageSelector on source {
diff --git a/src/imports/controls/imagine/HorizontalHeaderView.qml b/src/imports/controls/imagine/HorizontalHeaderView.qml
new file mode 100644
index 00000000..7f0454da
--- /dev/null
+++ b/src/imports/controls/imagine/HorizontalHeaderView.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+
+T.HorizontalHeaderView {
+ id: control
+
+ implicitWidth: syncView ? syncView.width : 0
+ implicitHeight: contentHeight
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: text.implicitWidth + (cellPadding * 2)
+ implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2))
+ color: "#f6f6f6"
+ border.color: "#e4e4e4"
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "#ff26282a"
+ }
+ }
+}
diff --git a/src/imports/controls/imagine/VerticalHeaderView.qml b/src/imports/controls/imagine/VerticalHeaderView.qml
new file mode 100644
index 00000000..5fbfaedf
--- /dev/null
+++ b/src/imports/controls/imagine/VerticalHeaderView.qml
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+
+T.VerticalHeaderView {
+ id: control
+
+ implicitWidth: contentWidth
+ implicitHeight: syncView ? syncView.height : 0
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2))
+ implicitHeight: text.implicitHeight + (cellPadding * 2)
+ color: "#f6f6f6"
+ border.color: "#e4e4e4"
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: "#ff26282a"
+ }
+ }
+}
diff --git a/src/imports/controls/imagine/imagine.pri b/src/imports/controls/imagine/imagine.pri
index 081a509e..4c6bcf1b 100644
--- a/src/imports/controls/imagine/imagine.pri
+++ b/src/imports/controls/imagine/imagine.pri
@@ -12,6 +12,7 @@ QML_FILES += \
$$PWD/Drawer.qml \
$$PWD/Frame.qml \
$$PWD/GroupBox.qml \
+ $$PWD/HorizontalHeaderView.qml \
$$PWD/ItemDelegate.qml \
$$PWD/Label.qml \
$$PWD/Menu.qml \
@@ -44,7 +45,8 @@ QML_FILES += \
$$PWD/ToolButton.qml \
$$PWD/ToolSeparator.qml \
$$PWD/ToolTip.qml \
- $$PWD/Tumbler.qml
+ $$PWD/Tumbler.qml \
+ $$PWD/VerticalHeaderView.qml
HEADERS += \
$$PWD/qquickimageselector_p.h \
diff --git a/src/imports/controls/imagine/qquickimaginestyle.cpp b/src/imports/controls/imagine/qquickimaginestyle.cpp
index 9e1431de..745bef10 100644
--- a/src/imports/controls/imagine/qquickimaginestyle.cpp
+++ b/src/imports/controls/imagine/qquickimaginestyle.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC_WITH_ARGS(QString, GlobalPath, (QLatin1String("qrc:/qt-project.org/imports/QtQuick/Controls.2/Imagine/images/")))
-static const QString ensureSlash(const QString &path)
+static QString ensureSlash(const QString &path)
{
const QChar slash = QLatin1Char('/');
return path.endsWith(slash) ? path : path + slash;
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml
index 7d635902..e4ee332b 100644
--- a/src/imports/controls/material/ComboBox.qml
+++ b/src/imports/controls/material/ComboBox.qml
@@ -34,13 +34,13 @@
**
****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Window 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Controls.impl 2.14
-import QtQuick.Templates 2.14 as T
-import QtQuick.Controls.Material 2.14
-import QtQuick.Controls.Material.impl 2.14
+import QtQuick 2.15
+import QtQuick.Window 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Controls.impl 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls.Material 2.15
+import QtQuick.Controls.Material.impl 2.15
T.ComboBox {
id: control
@@ -89,6 +89,7 @@ T.ComboBox {
readOnly: control.down
inputMethodHints: control.inputMethodHints
validator: control.validator
+ selectByMouse: control.selectTextByMouse
font: control.font
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
diff --git a/src/imports/controls/material/HorizontalHeaderView.qml b/src/imports/controls/material/HorizontalHeaderView.qml
new file mode 100644
index 00000000..504579cc
--- /dev/null
+++ b/src/imports/controls/material/HorizontalHeaderView.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls.Material 2.15
+import QtQuick.Controls.Material.impl 2.15
+
+T.HorizontalHeaderView {
+ id: control
+
+ implicitWidth: syncView ? syncView.width : 0
+ implicitHeight: contentHeight
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: text.implicitWidth + (cellPadding * 2)
+ implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2))
+ color: control.Material.backgroundColor
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: enabled ? control.Material.foreground : control.Material.hintTextColor
+ }
+ }
+}
diff --git a/src/imports/controls/material/VerticalHeaderView.qml b/src/imports/controls/material/VerticalHeaderView.qml
new file mode 100644
index 00000000..7f8ecc92
--- /dev/null
+++ b/src/imports/controls/material/VerticalHeaderView.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls.Material 2.15
+import QtQuick.Controls.Material.impl 2.15
+
+T.VerticalHeaderView {
+ id: control
+
+ implicitWidth: contentWidth
+ implicitHeight: syncView ? syncView.height : 0
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2))
+ implicitHeight: text.implicitHeight + (cellPadding * 2)
+ color: control.Material.backgroundColor
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: enabled ? control.Material.foreground : control.Material.hintTextColor
+ }
+ }
+}
diff --git a/src/imports/controls/material/material.pri b/src/imports/controls/material/material.pri
index bda1fb21..457a8df1 100644
--- a/src/imports/controls/material/material.pri
+++ b/src/imports/controls/material/material.pri
@@ -30,6 +30,7 @@ QML_FILES += \
$$PWD/ElevationEffect.qml \
$$PWD/Frame.qml \
$$PWD/GroupBox.qml \
+ $$PWD/HorizontalHeaderView.qml \
$$PWD/ItemDelegate.qml \
$$PWD/Label.qml \
$$PWD/Menu.qml \
@@ -68,4 +69,5 @@ QML_FILES += \
$$PWD/ToolButton.qml \
$$PWD/ToolSeparator.qml \
$$PWD/ToolTip.qml \
- $$PWD/Tumbler.qml
+ $$PWD/Tumbler.qml \
+ $$PWD/VerticalHeaderView.qml
diff --git a/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag b/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag
index a805b134..5cfa2db6 100644
--- a/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag
+++ b/src/imports/controls/material/shaders/+qsb/RectangularGlow.frag
Binary files differ
diff --git a/src/imports/controls/material/shaders/compile.bat b/src/imports/controls/material/shaders/compile.bat
new file mode 100644
index 00000000..e87efa7a
--- /dev/null
+++ b/src/imports/controls/material/shaders/compile.bat
@@ -0,0 +1,40 @@
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+::
+:: Copyright (C) 2019 The Qt Company Ltd.
+:: Contact: https://www.qt.io/licensing/
+::
+:: This file is part of the QtQuick module of the Qt Toolkit.
+::
+:: $QT_BEGIN_LICENSE:LGPL$
+:: 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 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.LGPL3 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-3.0.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 (at your option) the GNU General
+:: Public license version 3 or any later version approved by the KDE Free
+:: Qt Foundation. The licenses are as published by the Free Software
+:: Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+:: included in the packaging of this file. Please review the following
+:: information to ensure the GNU General Public License requirements will
+:: be met: https://www.gnu.org/licenses/gpl-2.0.html and
+:: https://www.gnu.org/licenses/gpl-3.0.html.
+::
+:: $QT_END_LICENSE$
+::
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+qsb --glsl "150,120,100 es" --hlsl 50 --msl 12 -o +qsb/RectangularGlow.frag RectangularGlow_rhi.frag
diff --git a/src/imports/controls/qquickdefaultbusyindicator.cpp b/src/imports/controls/qquickdefaultbusyindicator.cpp
index 98a3cae3..aca795d9 100644
--- a/src/imports/controls/qquickdefaultbusyindicator.cpp
+++ b/src/imports/controls/qquickdefaultbusyindicator.cpp
@@ -124,7 +124,7 @@ void QQuickDefaultBusyIndicatorNode::sync(QQuickItem *item)
Q_ASSERT(rectNode->type() == QSGNode::GeometryNodeType);
QPointF pos = QPointF(sz / 2 - circleRadius, sz / 2 - circleRadius);
- pos = moveCircle(pos, 360 / CircleCount * i, sz / 2 - circleRadius);
+ pos = moveCircle(pos, 360.0 / CircleCount * i, sz / 2 - circleRadius);
QMatrix4x4 m;
m.translate(dx + pos.x(), dy + pos.y());
diff --git a/src/imports/controls/qquickdefaultprogressbar.cpp b/src/imports/controls/qquickdefaultprogressbar.cpp
index e8657255..f44065e4 100644
--- a/src/imports/controls/qquickdefaultprogressbar.cpp
+++ b/src/imports/controls/qquickdefaultprogressbar.cpp
@@ -59,7 +59,7 @@ static inline qreal blockStartX(int blockIndex)
static inline qreal blockRestX(int blockIndex, qreal availableWidth)
{
- const qreal spanRightEdgePos = availableWidth / 2 + BlockSpan / 2;
+ const qreal spanRightEdgePos = availableWidth / 2 + BlockSpan / 2.0;
return spanRightEdgePos - (blockIndex + 1) * BlockWidth - (blockIndex * BlockRestingSpacing);
}
diff --git a/src/imports/controls/qtquickcontrols2plugin.cpp b/src/imports/controls/qtquickcontrols2plugin.cpp
index 5d59d8ca..6730848f 100644
--- a/src/imports/controls/qtquickcontrols2plugin.cpp
+++ b/src/imports/controls/qtquickcontrols2plugin.cpp
@@ -79,6 +79,7 @@ public:
~QtQuickControls2Plugin();
void registerTypes(const char *uri) override;
+ void unregisterTypes() override;
QString name() const override;
void initializeTheme(QQuickTheme *theme) override;
@@ -94,7 +95,8 @@ QtQuickControls2Plugin::QtQuickControls2Plugin(QObject *parent) : QQuickStylePlu
QtQuickControls2Plugin::~QtQuickControls2Plugin()
{
- QQuickStylePrivate::reset();
+ // Intentionally empty: we use register/unregisterTypes() to do
+ // initialization and cleanup, as plugins are not unloaded on macOS.
}
static bool isDefaultStyle(const QString &style)
@@ -194,6 +196,10 @@ void QtQuickControls2Plugin::registerTypes(const char *uri)
qmlRegisterUncreatableType<QQuickSplitHandleAttached>(uri, 2, 13, "SplitHandle",
QStringLiteral("SplitHandle is only available as an attached property."));
+ // QtQuick.Controls 2.15 (new types in Qt 5.15)
+ qmlRegisterType(resolvedUrl(QStringLiteral("HorizontalHeaderView.qml")), uri, 2, 15, "HorizontalHeaderView");
+ qmlRegisterType(resolvedUrl(QStringLiteral("VerticalHeaderView.qml")), uri, 2, 15, "VerticalHeaderView");
+
// The minor version used to be the current Qt 5 minor. For compatibility it is the last
// Qt 5 release.
const QByteArray import = QByteArray(uri) + ".impl";
@@ -234,6 +240,12 @@ void QtQuickControls2Plugin::registerTypes(const char *uri)
qmlRegisterRevision<QQuickText, 6>(import, 2, 3);
}
+void QtQuickControls2Plugin::unregisterTypes()
+{
+ QQuickStylePlugin::unregisterTypes();
+ QQuickStylePrivate::reset();
+}
+
QString QtQuickControls2Plugin::name() const
{
return QStringLiteral("Default");
diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml
index 9a4e119b..fd2d8935 100644
--- a/src/imports/controls/universal/ComboBox.qml
+++ b/src/imports/controls/universal/ComboBox.qml
@@ -34,12 +34,12 @@
**
****************************************************************************/
-import QtQuick 2.14
-import QtQuick.Window 2.14
-import QtQuick.Controls 2.14
-import QtQuick.Controls.impl 2.14
-import QtQuick.Templates 2.14 as T
-import QtQuick.Controls.Universal 2.14
+import QtQuick 2.15
+import QtQuick.Window 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Controls.impl 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls.Universal 2.15
T.ComboBox {
id: control
@@ -94,6 +94,7 @@ T.ComboBox {
readOnly: control.down
inputMethodHints: control.inputMethodHints
validator: control.validator
+ selectByMouse: control.selectTextByMouse
font: control.font
color: !control.enabled ? control.Universal.chromeDisabledLowColor :
diff --git a/src/imports/controls/universal/HorizontalHeaderView.qml b/src/imports/controls/universal/HorizontalHeaderView.qml
new file mode 100644
index 00000000..8cdfda35
--- /dev/null
+++ b/src/imports/controls/universal/HorizontalHeaderView.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Controls.impl 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls.Universal 2.15
+import QtQuick.Controls.Universal.impl 2.15
+
+T.HorizontalHeaderView {
+ id: control
+
+ implicitWidth: syncView ? syncView.width : 0
+ implicitHeight: contentHeight
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: text.implicitWidth + (cellPadding * 2)
+ implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2))
+ color: control.Universal.background
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: Color.transparent(control.Universal.foreground, enabled ? 1.0 : 0.2)
+ }
+ }
+}
diff --git a/src/imports/controls/universal/VerticalHeaderView.qml b/src/imports/controls/universal/VerticalHeaderView.qml
new file mode 100644
index 00000000..7c7544af
--- /dev/null
+++ b/src/imports/controls/universal/VerticalHeaderView.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Controls.impl 2.15
+import QtQuick.Templates 2.15 as T
+import QtQuick.Controls.Universal 2.15
+import QtQuick.Controls.Universal.impl 2.15
+
+T.VerticalHeaderView {
+ id: control
+
+ implicitWidth: contentWidth
+ implicitHeight: syncView ? syncView.height : 0
+
+ delegate: Rectangle {
+ // Qt6: add cellPadding (and font etc) as public API in headerview
+ readonly property real cellPadding: 8
+
+ implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2))
+ implicitHeight: text.implicitHeight + (cellPadding * 2)
+ color: control.Universal.background
+
+ Text {
+ id: text
+ text: model[control.textRole]
+ width: parent.width
+ height: parent.height
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ color: Color.transparent(control.Universal.foreground, enabled ? 1.0 : 0.2)
+ }
+ }
+}
diff --git a/src/imports/controls/universal/universal.pri b/src/imports/controls/universal/universal.pri
index 4440acbf..8f1b905c 100644
--- a/src/imports/controls/universal/universal.pri
+++ b/src/imports/controls/universal/universal.pri
@@ -13,6 +13,7 @@ QML_FILES += \
$$PWD/Drawer.qml \
$$PWD/Frame.qml \
$$PWD/GroupBox.qml \
+ $$PWD/HorizontalHeaderView.qml \
$$PWD/ItemDelegate.qml \
$$PWD/Label.qml \
$$PWD/Menu.qml \
@@ -48,7 +49,8 @@ QML_FILES += \
$$PWD/ToolButton.qml \
$$PWD/ToolSeparator.qml \
$$PWD/ToolTip.qml \
- $$PWD/Tumbler.qml
+ $$PWD/Tumbler.qml \
+ $$PWD/VerticalHeaderView.qml
HEADERS += \
$$PWD/qquickuniversalbusyindicator_p.h \
diff --git a/src/imports/platform/qquickplatformcolordialog.cpp b/src/imports/platform/qquickplatformcolordialog.cpp
index 0b8cfd97..04a5e079 100644
--- a/src/imports/platform/qquickplatformcolordialog.cpp
+++ b/src/imports/platform/qquickplatformcolordialog.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype ColorDialog
\inherits Dialog
- \instantiates QQuickPlatformColorDialog
+//! \instantiates QQuickPlatformColorDialog
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native color dialog.
diff --git a/src/imports/platform/qquickplatformdialog.cpp b/src/imports/platform/qquickplatformdialog.cpp
index 41fc1316..983c2766 100644
--- a/src/imports/platform/qquickplatformdialog.cpp
+++ b/src/imports/platform/qquickplatformdialog.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Dialog
\inherits QtObject
- \instantiates QQuickPlatformDialog
+//! \instantiates QQuickPlatformDialog
\inqmlmodule Qt.labs.platform
\since 5.8
\brief The base class of native dialogs.
@@ -119,7 +119,7 @@ QPlatformDialogHelper *QQuickPlatformDialog::handle() const
*/
QQmlListProperty<QObject> QQuickPlatformDialog::data()
{
- return QQmlListProperty<QObject>(this, m_data);
+ return QQmlListProperty<QObject>(this, &m_data);
}
/*!
@@ -407,3 +407,5 @@ QWindow *QQuickPlatformDialog::findParentWindow() const
}
QT_END_NAMESPACE
+
+#include "moc_qquickplatformdialog_p.cpp"
diff --git a/src/imports/platform/qquickplatformfiledialog.cpp b/src/imports/platform/qquickplatformfiledialog.cpp
index 9c1eb684..2ef08ef6 100644
--- a/src/imports/platform/qquickplatformfiledialog.cpp
+++ b/src/imports/platform/qquickplatformfiledialog.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype FileDialog
\inherits Dialog
- \instantiates QQuickPlatformFileDialog
+//! \instantiates QQuickPlatformFileDialog
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native file dialog.
@@ -303,7 +303,7 @@ void QQuickPlatformFileDialog::setOptions(QFileDialogOptions::FileDialogOptions
void QQuickPlatformFileDialog::resetOptions()
{
- setOptions(0);
+ setOptions({});
}
/*!
@@ -623,7 +623,7 @@ static QStringList extractExtensions(const QString &filter)
const int to = filter.lastIndexOf(QLatin1Char(')')) - 1;
if (from >= 0 && from < to) {
const QStringRef ref = filter.midRef(from + 1, to - from);
- const QVector<QStringRef> exts = ref.split(QLatin1Char(' '), QString::SkipEmptyParts);
+ const QVector<QStringRef> exts = ref.split(QLatin1Char(' '), Qt::SkipEmptyParts);
for (const QStringRef &ref : exts)
extensions += extractExtension(ref.toString());
}
diff --git a/src/imports/platform/qquickplatformfolderdialog.cpp b/src/imports/platform/qquickplatformfolderdialog.cpp
index 512dce52..4ae6341e 100644
--- a/src/imports/platform/qquickplatformfolderdialog.cpp
+++ b/src/imports/platform/qquickplatformfolderdialog.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype FolderDialog
\inherits Dialog
- \instantiates QQuickPlatformFolderDialog
+//! \instantiates QQuickPlatformFolderDialog
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native folder dialog.
@@ -186,7 +186,7 @@ void QQuickPlatformFolderDialog::setOptions(QFileDialogOptions::FileDialogOption
void QQuickPlatformFolderDialog::resetOptions()
{
- setOptions(0);
+ setOptions({});
}
/*!
diff --git a/src/imports/platform/qquickplatformfontdialog.cpp b/src/imports/platform/qquickplatformfontdialog.cpp
index ecd6ba4a..f3eca2c3 100644
--- a/src/imports/platform/qquickplatformfontdialog.cpp
+++ b/src/imports/platform/qquickplatformfontdialog.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype FontDialog
\inherits Dialog
- \instantiates QQuickPlatformFontDialog
+//! \instantiates QQuickPlatformFontDialog
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native font dialog.
diff --git a/src/imports/platform/qquickplatformmenu.cpp b/src/imports/platform/qquickplatformmenu.cpp
index 844fbbd9..8954d439 100644
--- a/src/imports/platform/qquickplatformmenu.cpp
+++ b/src/imports/platform/qquickplatformmenu.cpp
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Menu
\inherits QtObject
- \instantiates QQuickPlatformMenu
+//! \instantiates QQuickPlatformMenu
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native menu.
@@ -127,7 +127,7 @@ QT_BEGIN_NAMESPACE
\section2 Dynamically Generating Menu Items
It is possible to dynamically generate menu items. One of the easiest ways
- to do so is with \l Instantiator. For example, to implement a
+ to do so is with \l[QtQml]{Instantiator}. For example, to implement a
"Recent Files" submenu, where the items are based on a list of files stored
in settings, the following code could be used:
@@ -938,3 +938,5 @@ void QQuickPlatformMenu::updateIcon()
}
QT_END_NAMESPACE
+
+#include "moc_qquickplatformmenu_p.cpp"
diff --git a/src/imports/platform/qquickplatformmenubar.cpp b/src/imports/platform/qquickplatformmenubar.cpp
index 4487b9a7..592a6bfe 100644
--- a/src/imports/platform/qquickplatformmenubar.cpp
+++ b/src/imports/platform/qquickplatformmenubar.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype MenuBar
\inherits QtObject
- \instantiates QQuickPlatformMenuBar
+//! \instantiates QQuickPlatformMenuBar
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native menubar.
@@ -328,3 +328,5 @@ void QQuickPlatformMenuBar::menus_clear(QQmlListProperty<QQuickPlatformMenu> *pr
}
QT_END_NAMESPACE
+
+#include "moc_qquickplatformmenubar_p.cpp"
diff --git a/src/imports/platform/qquickplatformmenuitem.cpp b/src/imports/platform/qquickplatformmenuitem.cpp
index d657fd12..e5741b6b 100644
--- a/src/imports/platform/qquickplatformmenuitem.cpp
+++ b/src/imports/platform/qquickplatformmenuitem.cpp
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype MenuItem
\inherits QtObject
- \instantiates QQuickPlatformMenuItem
+//! \instantiates QQuickPlatformMenuItem
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native menu item.
@@ -623,3 +623,5 @@ void QQuickPlatformMenuItem::updateIcon()
}
QT_END_NAMESPACE
+
+#include "moc_qquickplatformmenuitem_p.cpp"
diff --git a/src/imports/platform/qquickplatformmenuitemgroup.cpp b/src/imports/platform/qquickplatformmenuitemgroup.cpp
index f07d0a1b..e0773bb1 100644
--- a/src/imports/platform/qquickplatformmenuitemgroup.cpp
+++ b/src/imports/platform/qquickplatformmenuitemgroup.cpp
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype MenuItemGroup
\inherits QtObject
- \instantiates QQuickPlatformMenuItemGroup
+//! \instantiates QQuickPlatformMenuItemGroup
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A group for managing native menu items.
@@ -388,3 +388,5 @@ void QQuickPlatformMenuItemGroup::items_clear(QQmlListProperty<QQuickPlatformMen
}
QT_END_NAMESPACE
+
+#include "moc_qquickplatformmenuitemgroup_p.cpp"
diff --git a/src/imports/platform/qquickplatformmenuseparator.cpp b/src/imports/platform/qquickplatformmenuseparator.cpp
index 34767ff6..f29d5b9e 100644
--- a/src/imports/platform/qquickplatformmenuseparator.cpp
+++ b/src/imports/platform/qquickplatformmenuseparator.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype MenuSeparator
\inherits MenuItem
- \instantiates QQuickPlatformMenuSeparator
+//! \instantiates QQuickPlatformMenuSeparator
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native menu separator.
diff --git a/src/imports/platform/qquickplatformmessagedialog.cpp b/src/imports/platform/qquickplatformmessagedialog.cpp
index ffc4b296..075b4d62 100644
--- a/src/imports/platform/qquickplatformmessagedialog.cpp
+++ b/src/imports/platform/qquickplatformmessagedialog.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype MessageDialog
\inherits Dialog
- \instantiates QQuickPlatformMessageDialog
+//! \instantiates QQuickPlatformMessageDialog
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A native message dialog.
diff --git a/src/imports/platform/qquickplatformstandardpaths.cpp b/src/imports/platform/qquickplatformstandardpaths.cpp
index 4687ba69..a6fff1c0 100644
--- a/src/imports/platform/qquickplatformstandardpaths.cpp
+++ b/src/imports/platform/qquickplatformstandardpaths.cpp
@@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype StandardPaths
\inherits QtObject
- \instantiates QQuickPlatformStandardPaths
+//! \instantiates QQuickPlatformStandardPaths
\inqmlmodule Qt.labs.platform
\since 5.8
\brief Provides access to the standard system paths.
@@ -89,6 +89,8 @@ QObject *QQuickPlatformStandardPaths::create(QQmlEngine *engine, QJSEngine *scri
/*!
\qmlmethod string Qt.labs.platform::StandardPaths::displayName(StandardLocation type)
+ \include standardpath/functiondocs.qdocinc displayName
+
\sa QStandardPaths::displayName()
*/
QString QQuickPlatformStandardPaths::displayName(QStandardPaths::StandardLocation type)
@@ -99,6 +101,8 @@ QString QQuickPlatformStandardPaths::displayName(QStandardPaths::StandardLocatio
/*!
\qmlmethod url Qt.labs.platform::StandardPaths::findExecutable(string executableName, list<string> paths)
+ \include standardpath/functiondocs.qdocinc findExecutable
+
\sa QStandardPaths::findExecutable()
*/
QUrl QQuickPlatformStandardPaths::findExecutable(const QString &executableName, const QStringList &paths)
@@ -107,7 +111,9 @@ QUrl QQuickPlatformStandardPaths::findExecutable(const QString &executableName,
}
/*!
- \qmlmethod url Qt.labs.platform::StandardPaths::locate(StandardLocation type, string fileName, LocateOptions options = LocateFile)
+ \qmlmethod url Qt.labs.platform::StandardPaths::locate(StandardLocation type, string fileName, LocateOptions options)
+
+ \include standardpath/functiondocs.qdocinc locate
\sa QStandardPaths::locate()
*/
@@ -117,7 +123,9 @@ QUrl QQuickPlatformStandardPaths::locate(QStandardPaths::StandardLocation type,
}
/*!
- \qmlmethod list<url> Qt.labs.platform::StandardPaths::locateAll(StandardLocation type, string fileName, LocateOptions options = LocateFile)
+ \qmlmethod list<url> Qt.labs.platform::StandardPaths::locateAll(StandardLocation type, string fileName, LocateOptions options)
+
+ \include standardpath/functiondocs.qdocinc locateAll
\sa QStandardPaths::locateAll()
*/
@@ -129,6 +137,8 @@ QList<QUrl> QQuickPlatformStandardPaths::locateAll(QStandardPaths::StandardLocat
/*!
\qmlmethod void Qt.labs.platform::StandardPaths::setTestModeEnabled(bool testMode)
+ \include standardpath/functiondocs.qdocinc setTestModeEnabled
+
\sa QStandardPaths::setTestModeEnabled()
*/
void QQuickPlatformStandardPaths::setTestModeEnabled(bool testMode)
@@ -139,6 +149,8 @@ void QQuickPlatformStandardPaths::setTestModeEnabled(bool testMode)
/*!
\qmlmethod list<url> Qt.labs.platform::StandardPaths::standardLocations(StandardLocation type)
+ \include standardpath/functiondocs.qdocinc standardLocations
+
\sa QStandardPaths::standardLocations()
*/
QList<QUrl> QQuickPlatformStandardPaths::standardLocations(QStandardPaths::StandardLocation type)
@@ -149,6 +161,8 @@ QList<QUrl> QQuickPlatformStandardPaths::standardLocations(QStandardPaths::Stand
/*!
\qmlmethod url Qt.labs.platform::StandardPaths::writableLocation(StandardLocation type)
+ \include standardpath/functiondocs.qdocinc writableLocation
+
\sa QStandardPaths::writableLocation()
*/
QUrl QQuickPlatformStandardPaths::writableLocation(QStandardPaths::StandardLocation type)
diff --git a/src/imports/platform/qquickplatformsystemtrayicon.cpp b/src/imports/platform/qquickplatformsystemtrayicon.cpp
index 202bc3bf..4a96b38f 100644
--- a/src/imports/platform/qquickplatformsystemtrayicon.cpp
+++ b/src/imports/platform/qquickplatformsystemtrayicon.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype SystemTrayIcon
\inherits QtObject
- \instantiates QQuickPlatformSystemTrayIcon
+//! \instantiates QQuickPlatformSystemTrayIcon
\inqmlmodule Qt.labs.platform
\since 5.8
\brief A system tray icon.
@@ -482,3 +482,5 @@ void QQuickPlatformSystemTrayIcon::updateIcon()
}
QT_END_NAMESPACE
+
+#include "moc_qquickplatformsystemtrayicon_p.cpp"
diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp
index 470e86e0..9c57b471 100644
--- a/src/imports/templates/qtquicktemplates2plugin.cpp
+++ b/src/imports/templates/qtquicktemplates2plugin.cpp
@@ -56,6 +56,7 @@
#include <QtQuickTemplates2/private/qquickdrawer_p.h>
#include <QtQuickTemplates2/private/qquickframe_p.h>
#include <QtQuickTemplates2/private/qquickgroupbox_p.h>
+#include <QtQuickTemplates2/private/qquickheaderview_p.h>
#include <QtQuickTemplates2/private/qquickicon_p.h>
#include <QtQuickTemplates2/private/qquickitemdelegate_p.h>
#include <QtQuickTemplates2/private/qquicklabel_p.h>
@@ -130,6 +131,7 @@ public:
~QtQuickTemplates2Plugin();
void registerTypes(const char *uri) override;
+ void unregisterTypes() override;
private:
bool registered;
@@ -141,24 +143,21 @@ private:
QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent)
: QQmlExtensionPlugin(parent), registered(false)
{
-#if QT_CONFIG(shortcut)
- originalContextMatcher = qt_quick_shortcut_context_matcher();
- qt_quick_set_shortcut_context_matcher(QQuickShortcutContext::matcher);
-#endif
}
QtQuickTemplates2Plugin::~QtQuickTemplates2Plugin()
{
- if (registered)
- cleanupProviders();
-
-#if QT_CONFIG(shortcut)
- qt_quick_set_shortcut_context_matcher(originalContextMatcher);
-#endif
+ // Intentionally empty: we use register/unregisterTypes() to do
+ // initialization and cleanup, as plugins are not unloaded on macOS.
}
void QtQuickTemplates2Plugin::registerTypes(const char *uri)
{
+#if QT_CONFIG(shortcut)
+ originalContextMatcher = qt_quick_shortcut_context_matcher();
+ qt_quick_set_shortcut_context_matcher(QQuickShortcutContext::matcher);
+#endif
+
registered = true;
initProviders();
@@ -354,6 +353,23 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri)
// QtQuick.Templates 2.14 (new types and revisions in Qt 5.14)
qmlRegisterType<QQuickComboBox, 14>(uri, 2, 14, "ComboBox");
+
+ // QtQuick.Templates 2.15 (new types and revisions in Qt 5.15)
+ qmlRegisterType<QQuickComboBox, 15>(uri, 2, 15, "ComboBox");
+ // Register QQuickTableView here to expose headerView's base, with a irregular type name to 'hide' it.
+ qmlRegisterType<QQuickTableView, 15>(uri, 2, 15, "__TableView__");
+ qmlRegisterType<QQuickHorizontalHeaderView>(uri, 2, 15, "HorizontalHeaderView");
+ qmlRegisterType<QQuickVerticalHeaderView>(uri, 2, 15, "VerticalHeaderView");
+}
+
+void QtQuickTemplates2Plugin::unregisterTypes()
+{
+ if (registered)
+ cleanupProviders();
+
+#if QT_CONFIG(shortcut)
+ qt_quick_set_shortcut_context_matcher(originalContextMatcher);
+#endif
}
QT_END_NAMESPACE