aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-11-02 13:05:58 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2016-11-02 13:05:58 +0100
commit5169a1ecd03eaea95ab07aeefc8d76cca7530563 (patch)
tree2666aecdf5a9c90d9b68dd7df8c6b5d1507541a6
parent7decf1ee51df6c772b84ba8bed2f1e3d0e344908 (diff)
parent814601e9cdf5895152cedcd1968fd2a4eecd3cd3 (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/imports/controls/Drawer.qml src/imports/controls/Frame.qml src/imports/controls/GroupBox.qml src/imports/controls/Page.qml src/imports/controls/Pane.qml src/imports/controls/ToolBar.qml src/imports/controls/Tumbler.qml src/quicktemplates2/qquickapplicationwindow.cpp src/quicktemplates2/qquickpopup.cpp tests/auto/accessibility/data/busyindicator.qml tests/auto/accessibility/data/button.qml tests/auto/accessibility/data/checkbox.qml tests/auto/accessibility/data/control.qml tests/auto/accessibility/data/dial.qml tests/auto/accessibility/data/label.qml tests/auto/accessibility/data/menu.qml tests/auto/accessibility/data/pageindicator.qml tests/auto/accessibility/data/popup.qml tests/auto/accessibility/data/progressbar.qml tests/auto/accessibility/data/radiobutton.qml tests/auto/accessibility/data/rangeslider.qml tests/auto/accessibility/data/scrollbar.qml tests/auto/accessibility/data/scrollindicator.qml tests/auto/accessibility/data/slider.qml tests/auto/accessibility/data/spinbox.qml tests/auto/accessibility/data/switch.qml tests/auto/accessibility/data/tabbar.qml tests/auto/accessibility/data/tabbutton.qml tests/auto/accessibility/data/textarea.qml tests/auto/accessibility/data/textfield.qml tests/auto/accessibility/data/toolbar.qml tests/auto/accessibility/data/toolbutton.qml tests/auto/accessibility/tst_accessibility.cpp Change-Id: Ibc3f592162e97bef9147b35da8c9a79e73a907e6
-rw-r--r--src/imports/controls/BusyIndicator.qml2
-rw-r--r--src/imports/controls/Button.qml4
-rw-r--r--src/imports/controls/CheckBox.qml4
-rw-r--r--src/imports/controls/CheckDelegate.qml6
-rw-r--r--src/imports/controls/ComboBox.qml10
-rw-r--r--src/imports/controls/Dial.qml4
-rw-r--r--src/imports/controls/Drawer.qml7
-rw-r--r--src/imports/controls/Frame.qml2
-rw-r--r--src/imports/controls/GroupBox.qml4
-rw-r--r--src/imports/controls/ItemDelegate.qml4
-rw-r--r--src/imports/controls/Menu.qml4
-rw-r--r--src/imports/controls/MenuItem.qml6
-rw-r--r--src/imports/controls/Page.qml2
-rw-r--r--src/imports/controls/PageIndicator.qml4
-rw-r--r--src/imports/controls/Pane.qml2
-rw-r--r--src/imports/controls/ProgressBar.qml4
-rw-r--r--src/imports/controls/RadioButton.qml4
-rw-r--r--src/imports/controls/RadioDelegate.qml6
-rw-r--r--src/imports/controls/RangeSlider.qml6
-rw-r--r--src/imports/controls/ScrollBar.qml2
-rw-r--r--src/imports/controls/ScrollIndicator.qml2
-rw-r--r--src/imports/controls/Slider.qml4
-rw-r--r--src/imports/controls/SpinBox.qml10
-rw-r--r--src/imports/controls/StackView.qml12
-rw-r--r--src/imports/controls/SwipeDelegate.qml4
-rw-r--r--src/imports/controls/SwipeView.qml2
-rw-r--r--src/imports/controls/Switch.qml4
-rw-r--r--src/imports/controls/SwitchDelegate.qml6
-rw-r--r--src/imports/controls/TabBar.qml4
-rw-r--r--src/imports/controls/TabButton.qml4
-rw-r--r--src/imports/controls/TextField.qml2
-rw-r--r--src/imports/controls/ToolBar.qml2
-rw-r--r--src/imports/controls/ToolButton.qml4
-rw-r--r--src/imports/controls/ToolTip.qml4
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-busyindicator.gifbin3241 -> 17357 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-drawer.gifbin0 -> 55780 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-popup.pngbin0 -> 21693 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-popup.svg391
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-swipeview.gifbin0 -> 35983 bytes
-rw-r--r--src/imports/controls/doc/images/qtquickcontrols2-toolbar.pngbin3358 -> 1186 bytes
-rw-r--r--src/imports/controls/doc/qtquickcontrols2.qdocconf1
-rw-r--r--src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml27
-rw-r--r--src/imports/templates/qtquicktemplates2plugin.cpp19
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp2
-rw-r--r--src/quicktemplates2/qquickapplicationwindow.cpp67
-rw-r--r--src/quicktemplates2/qquickbusyindicator.cpp14
-rw-r--r--src/quicktemplates2/qquickbutton.cpp2
-rw-r--r--src/quicktemplates2/qquickbuttongroup.cpp2
-rw-r--r--src/quicktemplates2/qquickcheckbox.cpp2
-rw-r--r--src/quicktemplates2/qquickcheckdelegate.cpp2
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp21
-rw-r--r--src/quicktemplates2/qquickcombobox_p.h5
-rw-r--r--src/quicktemplates2/qquickcontainer.cpp2
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp2
-rw-r--r--src/quicktemplates2/qquickdial.cpp4
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp16
-rw-r--r--src/quicktemplates2/qquickframe.cpp9
-rw-r--r--src/quicktemplates2/qquickframe_p.h4
-rw-r--r--src/quicktemplates2/qquickgroupbox.cpp19
-rw-r--r--src/quicktemplates2/qquickgroupbox_p.h5
-rw-r--r--src/quicktemplates2/qquickitemdelegate.cpp2
-rw-r--r--src/quicktemplates2/qquicklabel.cpp2
-rw-r--r--src/quicktemplates2/qquickmenu.cpp2
-rw-r--r--src/quicktemplates2/qquickmenuitem.cpp2
-rw-r--r--src/quicktemplates2/qquickpage.cpp12
-rw-r--r--src/quicktemplates2/qquickpage_p.h1
-rw-r--r--src/quicktemplates2/qquickpopup.cpp259
-rw-r--r--src/quicktemplates2/qquickpopup_p.h7
-rw-r--r--src/quicktemplates2/qquickpopup_p_p.h5
-rw-r--r--src/quicktemplates2/qquickprogressbar.cpp24
-rw-r--r--src/quicktemplates2/qquickradiobutton.cpp2
-rw-r--r--src/quicktemplates2/qquickradiodelegate.cpp2
-rw-r--r--src/quicktemplates2/qquickrangeslider.cpp2
-rw-r--r--src/quicktemplates2/qquickscrollbar.cpp2
-rw-r--r--src/quicktemplates2/qquickscrollindicator.cpp2
-rw-r--r--src/quicktemplates2/qquickshortcutcontext.cpp83
-rw-r--r--src/quicktemplates2/qquickshortcutcontext_p_p.h65
-rw-r--r--src/quicktemplates2/qquickslider.cpp2
-rw-r--r--src/quicktemplates2/qquickspinbox.cpp13
-rw-r--r--src/quicktemplates2/qquickswipedelegate.cpp12
-rw-r--r--src/quicktemplates2/qquickswipeview.cpp2
-rw-r--r--src/quicktemplates2/qquickswitch.cpp2
-rw-r--r--src/quicktemplates2/qquickswitchdelegate.cpp2
-rw-r--r--src/quicktemplates2/qquicktabbar.cpp13
-rw-r--r--src/quicktemplates2/qquicktabbutton.cpp2
-rw-r--r--src/quicktemplates2/qquicktextarea.cpp2
-rw-r--r--src/quicktemplates2/qquicktextfield.cpp2
-rw-r--r--src/quicktemplates2/qquicktoolbar.cpp19
-rw-r--r--src/quicktemplates2/qquicktoolbutton.cpp6
-rw-r--r--src/quicktemplates2/qquicktooltip.cpp26
-rw-r--r--src/quicktemplates2/qquicktooltip_p.h1
-rw-r--r--src/quicktemplates2/qquicktumbler.cpp2
-rw-r--r--src/quicktemplates2/quicktemplates2.pri2
-rw-r--r--tests/auto/accessibility/data/busyindicator.qml10
-rw-r--r--tests/auto/accessibility/data/button.qml11
-rw-r--r--tests/auto/accessibility/data/checkbox.qml11
-rw-r--r--tests/auto/accessibility/data/checkdelegate.qml6
-rw-r--r--tests/auto/accessibility/data/combobox.qml6
-rw-r--r--tests/auto/accessibility/data/control.qml10
-rw-r--r--tests/auto/accessibility/data/dayofweekrow-2.qml10
-rw-r--r--tests/auto/accessibility/data/dayofweekrow.qml11
-rw-r--r--tests/auto/accessibility/data/dial.qml10
-rw-r--r--tests/auto/accessibility/data/dialog.qml10
-rw-r--r--tests/auto/accessibility/data/frame.qml4
-rw-r--r--tests/auto/accessibility/data/groupbox.qml6
-rw-r--r--tests/auto/accessibility/data/itemdelegate.qml6
-rw-r--r--tests/auto/accessibility/data/label.qml11
-rw-r--r--tests/auto/accessibility/data/menu.qml10
-rw-r--r--tests/auto/accessibility/data/menuitem.qml6
-rw-r--r--tests/auto/accessibility/data/monthgrid-2.qml11
-rw-r--r--tests/auto/accessibility/data/monthgrid.qml13
-rw-r--r--tests/auto/accessibility/data/page.qml6
-rw-r--r--tests/auto/accessibility/data/pageindicator.qml10
-rw-r--r--tests/auto/accessibility/data/pane.qml4
-rw-r--r--tests/auto/accessibility/data/popup.qml10
-rw-r--r--tests/auto/accessibility/data/progressbar.qml15
-rw-r--r--tests/auto/accessibility/data/radiobutton.qml11
-rw-r--r--tests/auto/accessibility/data/rangeslider.qml21
-rw-r--r--tests/auto/accessibility/data/scrollbar.qml10
-rw-r--r--tests/auto/accessibility/data/scrollindicator.qml10
-rw-r--r--tests/auto/accessibility/data/slider.qml19
-rw-r--r--tests/auto/accessibility/data/spinbox.qml17
-rw-r--r--tests/auto/accessibility/data/switch.qml11
-rw-r--r--tests/auto/accessibility/data/switchdelegate.qml6
-rw-r--r--tests/auto/accessibility/data/tabbar.qml10
-rw-r--r--tests/auto/accessibility/data/tabbutton.qml15
-rw-r--r--tests/auto/accessibility/data/textarea.qml11
-rw-r--r--tests/auto/accessibility/data/textfield.qml11
-rw-r--r--tests/auto/accessibility/data/toolbar.qml10
-rw-r--r--tests/auto/accessibility/data/toolbutton.qml11
-rw-r--r--tests/auto/accessibility/data/tooltip.qml6
-rw-r--r--tests/auto/accessibility/data/weeknumbercolumn-2.qml10
-rw-r--r--tests/auto/accessibility/data/weeknumbercolumn.qml11
-rw-r--r--tests/auto/accessibility/tst_accessibility.cpp37
-rw-r--r--tests/auto/controls/data/tst_combobox.qml1
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml2
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-drawer.qml89
-rw-r--r--tests/manual/gifs/data/qtquickcontrols2-swipeview.qml89
-rw-r--r--tests/manual/gifs/tst_gifs.cpp60
139 files changed, 1477 insertions, 557 deletions
diff --git a/src/imports/controls/BusyIndicator.qml b/src/imports/controls/BusyIndicator.qml
index 936764fa..171e5869 100644
--- a/src/imports/controls/BusyIndicator.qml
+++ b/src/imports/controls/BusyIndicator.qml
@@ -47,7 +47,6 @@ T.BusyIndicator {
padding: 6
- //! [contentItem]
contentItem: BusyRing {
id: ring
implicitWidth: 48
@@ -61,5 +60,4 @@ T.BusyIndicator {
running: control.visible && control.running
}
}
- //! [contentItem]
}
diff --git a/src/imports/controls/Button.qml b/src/imports/controls/Button.qml
index 5410afa9..85d52b12 100644
--- a/src/imports/controls/Button.qml
+++ b/src/imports/controls/Button.qml
@@ -52,7 +52,6 @@ T.Button {
leftPadding: padding + 2
rightPadding: padding + 2
- //! [contentItem]
contentItem: Text {
text: control.text
font: control.font
@@ -64,9 +63,7 @@ T.Button {
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
@@ -77,5 +74,4 @@ T.Button {
border.color: Default.focusColor
border.width: control.visualFocus ? 2 : 0
}
- //! [background]
}
diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml
index 38614b6a..98fb31e1 100644
--- a/src/imports/controls/CheckBox.qml
+++ b/src/imports/controls/CheckBox.qml
@@ -52,15 +52,12 @@ T.CheckBox {
padding: 6
spacing: 6
- //! [indicator]
indicator: CheckIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
}
- //! [indicator]
- //! [contentItem]
contentItem: Text {
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
@@ -74,5 +71,4 @@ T.CheckBox {
verticalAlignment: Text.AlignVCenter
opacity: enabled ? 1 : 0.3
}
- //! [contentItem]
}
diff --git a/src/imports/controls/CheckDelegate.qml b/src/imports/controls/CheckDelegate.qml
index ad4bb44f..929dc4b5 100644
--- a/src/imports/controls/CheckDelegate.qml
+++ b/src/imports/controls/CheckDelegate.qml
@@ -52,7 +52,6 @@ T.CheckDelegate {
padding: 12
spacing: 12
- //! [contentItem]
contentItem: Text {
leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
@@ -65,23 +64,18 @@ T.CheckDelegate {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
- //! [indicator]
indicator: CheckIndicator {
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
control: control
}
- //! [indicator]
- //! [background]
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
visible: control.down || control.highlighted
color: control.down ? Default.delegatePressedColor : Default.delegateColor
}
- //! [background]
}
diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml
index f461b34e..e174a70d 100644
--- a/src/imports/controls/ComboBox.qml
+++ b/src/imports/controls/ComboBox.qml
@@ -55,7 +55,6 @@ T.ComboBox {
leftPadding: padding + 6
rightPadding: padding + 6
- //! [delegate]
delegate: ItemDelegate {
width: control.popup.width
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
@@ -63,9 +62,7 @@ T.ComboBox {
highlighted: control.highlightedIndex == index
hoverEnabled: control.hoverEnabled
}
- //! [delegate]
- //! [indicator]
indicator: Image {
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
@@ -74,9 +71,7 @@ T.ComboBox {
sourceSize.height: height
opacity: enabled ? 1 : 0.3
}
- //! [indicator]
- //! [contentItem]
contentItem: Text {
leftPadding: control.mirrored && control.indicator ? control.indicator.width + control.spacing : 0
rightPadding: !control.mirrored && control.indicator ? control.indicator.width + control.spacing : 0
@@ -89,9 +84,7 @@ T.ComboBox {
elide: Text.ElideRight
opacity: enabled ? 1 : 0.3
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 120
implicitHeight: 40
@@ -102,9 +95,7 @@ T.ComboBox {
border.width: control.visualFocus ? 2 : 0
visible: !control.flat || control.pressed
}
- //! [background]
- //! [popup]
popup: T.Popup {
y: control.height - (control.visualFocus ? 0 : 1)
width: control.width
@@ -135,5 +126,4 @@ T.ComboBox {
background: Rectangle { }
}
- //! [popup]
}
diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml
index f19fcc2b..67c3b0fb 100644
--- a/src/imports/controls/Dial.qml
+++ b/src/imports/controls/Dial.qml
@@ -45,7 +45,6 @@ T.Dial {
implicitWidth: 184
implicitHeight: 184
- //! [background]
background: DialRing {
width: control.availableWidth
height: control.availableHeight
@@ -53,9 +52,7 @@ T.Dial {
progress: control.position
opacity: control.enabled ? 1 : 0.3
}
- //! [background]
- //! [handle]
handle: Image {
id: handleItem
x: background.x + background.width / 2 - handle.width / 2
@@ -78,5 +75,4 @@ T.Dial {
}
]
}
- //! [handle]
}
diff --git a/src/imports/controls/Drawer.qml b/src/imports/controls/Drawer.qml
index 90fef012..a90893d9 100644
--- a/src/imports/controls/Drawer.qml
+++ b/src/imports/controls/Drawer.qml
@@ -55,15 +55,9 @@ T.Drawer {
rightPadding: control.edge === Qt.LeftEdge
bottomPadding: control.edge === Qt.TopEdge
- //! [enter]
enter: Transition { SmoothedAnimation { velocity: 5 } }
- //! [enter]
-
- //! [exit]
exit: Transition { SmoothedAnimation { velocity: 5 } }
- //! [exit]
- //! [background]
background: Rectangle {
Rectangle {
readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge
@@ -74,5 +68,4 @@ T.Drawer {
y: control.edge === Qt.TopEdge ? parent.height - 1 : 0
}
}
- //! [background]
}
diff --git a/src/imports/controls/Frame.qml b/src/imports/controls/Frame.qml
index eae1f25d..6086d92b 100644
--- a/src/imports/controls/Frame.qml
+++ b/src/imports/controls/Frame.qml
@@ -50,10 +50,8 @@ T.Frame {
padding: 12
- //! [background]
background: Rectangle {
color: "transparent"
border.color: Default.frameLightColor
}
- //! [background]
}
diff --git a/src/imports/controls/GroupBox.qml b/src/imports/controls/GroupBox.qml
index a761c8dc..4f083b15 100644
--- a/src/imports/controls/GroupBox.qml
+++ b/src/imports/controls/GroupBox.qml
@@ -54,7 +54,6 @@ T.GroupBox {
padding: 12
topPadding: padding + (label && label.implicitWidth > 0 ? label.implicitHeight + spacing : 0)
- //! [label]
label: Text {
x: control.leftPadding
width: control.availableWidth
@@ -66,9 +65,7 @@ T.GroupBox {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
- //! [label]
- //! [background]
background: Rectangle {
y: control.topPadding - control.padding
width: parent.width
@@ -77,5 +74,4 @@ T.GroupBox {
color: "transparent"
border.color: Default.frameLightColor
}
- //! [background]
}
diff --git a/src/imports/controls/ItemDelegate.qml b/src/imports/controls/ItemDelegate.qml
index a1bf9b22..23d72080 100644
--- a/src/imports/controls/ItemDelegate.qml
+++ b/src/imports/controls/ItemDelegate.qml
@@ -52,7 +52,6 @@ T.ItemDelegate {
padding: 12
spacing: 12
- //! [contentItem]
contentItem: Text {
leftPadding: control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0
rightPadding: !control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0
@@ -65,9 +64,7 @@ T.ItemDelegate {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
@@ -76,5 +73,4 @@ T.ItemDelegate {
? (control.pressed ? Default.focusPressedColor : Default.delegateFocusColor)
: (control.down ? Default.delegatePressedColor : Default.delegateColor)
}
- //! [background]
}
diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml
index 0461b2b6..e449f6d1 100644
--- a/src/imports/controls/Menu.qml
+++ b/src/imports/controls/Menu.qml
@@ -49,7 +49,6 @@ T.Menu {
margins: 0
- //! [contentItem]
contentItem: ListView {
implicitHeight: contentHeight
model: control.contentModel
@@ -61,14 +60,11 @@ T.Menu {
ScrollIndicator.vertical: ScrollIndicator {}
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 200
implicitHeight: 40
color: Default.backgroundColor
border.color: Default.frameDarkColor
}
- //! [background]
}
diff --git a/src/imports/controls/MenuItem.qml b/src/imports/controls/MenuItem.qml
index 0d4b609d..cd224393 100644
--- a/src/imports/controls/MenuItem.qml
+++ b/src/imports/controls/MenuItem.qml
@@ -51,7 +51,6 @@ T.MenuItem {
padding: 6
- //! [contentItem]
contentItem: Text {
leftPadding: control.checkable && !control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.checkable && control.mirrored ? control.indicator.width + control.spacing : 0
@@ -64,9 +63,7 @@ T.MenuItem {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
- //! [indicator]
indicator: Image {
x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
y: control.topPadding + (control.availableHeight - height) / 2
@@ -74,9 +71,7 @@ T.MenuItem {
visible: control.checked
source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" : ""
}
- //! [indicator]
- //! [background]
background: Item {
implicitWidth: 200
implicitHeight: 40
@@ -89,5 +84,4 @@ T.MenuItem {
color: control.visualFocus || control.down ? Default.delegateColor : "transparent"
}
}
- //! [background]
}
diff --git a/src/imports/controls/Page.qml b/src/imports/controls/Page.qml
index edd8d628..02f81e07 100644
--- a/src/imports/controls/Page.qml
+++ b/src/imports/controls/Page.qml
@@ -54,9 +54,7 @@ T.Page {
contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
- //! [background]
background: Rectangle {
color: Default.backgroundColor
}
- //! [background]
}
diff --git a/src/imports/controls/PageIndicator.qml b/src/imports/controls/PageIndicator.qml
index b546a9cc..0273af98 100644
--- a/src/imports/controls/PageIndicator.qml
+++ b/src/imports/controls/PageIndicator.qml
@@ -50,7 +50,6 @@ T.PageIndicator {
padding: 6
spacing: 6
- //! [delegate]
delegate: Rectangle {
implicitWidth: 8
implicitHeight: 8
@@ -61,9 +60,7 @@ T.PageIndicator {
opacity: index === currentIndex ? 0.95 : pressed ? 0.7 : 0.45
Behavior on opacity { OpacityAnimator { duration: 100 } }
}
- //! [delegate]
- //! [contentItem]
contentItem: Row {
spacing: control.spacing
@@ -72,5 +69,4 @@ T.PageIndicator {
delegate: control.delegate
}
}
- //! [contentItem]
}
diff --git a/src/imports/controls/Pane.qml b/src/imports/controls/Pane.qml
index 482ec18b..2aeeee5d 100644
--- a/src/imports/controls/Pane.qml
+++ b/src/imports/controls/Pane.qml
@@ -50,9 +50,7 @@ T.Pane {
padding: 12
- //! [background]
background: Rectangle {
color: Default.backgroundColor
}
- //! [background]
}
diff --git a/src/imports/controls/ProgressBar.qml b/src/imports/controls/ProgressBar.qml
index a0d0912a..a050383b 100644
--- a/src/imports/controls/ProgressBar.qml
+++ b/src/imports/controls/ProgressBar.qml
@@ -47,7 +47,6 @@ T.ProgressBar {
implicitHeight: Math.max(background ? background.implicitHeight : 0,
contentItem.implicitHeight + topPadding + bottomPadding)
- //! [contentItem]
contentItem: ProgressStrip {
id: strip
implicitHeight: 6
@@ -61,9 +60,7 @@ T.ProgressBar {
running: control.visible && control.indeterminate
}
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 200
implicitHeight: 6
@@ -74,5 +71,4 @@ T.ProgressBar {
color: Default.progressBarColor
}
- //! [background]
}
diff --git a/src/imports/controls/RadioButton.qml b/src/imports/controls/RadioButton.qml
index 65c9328b..35395d85 100644
--- a/src/imports/controls/RadioButton.qml
+++ b/src/imports/controls/RadioButton.qml
@@ -52,15 +52,12 @@ T.RadioButton {
padding: 6
spacing: 6
- //! [indicator]
indicator: RadioIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
}
- //! [indicator]
- //! [contentItem]
contentItem: Text {
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
@@ -74,5 +71,4 @@ T.RadioButton {
verticalAlignment: Text.AlignVCenter
opacity: enabled ? 1 : 0.3
}
- //! [contentItem]
}
diff --git a/src/imports/controls/RadioDelegate.qml b/src/imports/controls/RadioDelegate.qml
index 85e66aa0..5df649d9 100644
--- a/src/imports/controls/RadioDelegate.qml
+++ b/src/imports/controls/RadioDelegate.qml
@@ -52,7 +52,6 @@ T.RadioDelegate {
padding: 12
spacing: 12
- //! [contentItem]
contentItem: Text {
leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
@@ -65,23 +64,18 @@ T.RadioDelegate {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
- //! [indicator]
indicator: RadioIndicator {
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2
control: control
}
- //! [indicator]
- //! [background]
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
visible: control.down || control.highlighted
color: control.down ? Default.delegatePressedColor : Default.delegateColor
}
- //! [background]
}
diff --git a/src/imports/controls/RangeSlider.qml b/src/imports/controls/RangeSlider.qml
index e6b8b011..52e28ba4 100644
--- a/src/imports/controls/RangeSlider.qml
+++ b/src/imports/controls/RangeSlider.qml
@@ -51,7 +51,6 @@ T.RangeSlider {
padding: 6
- //! [firstHandle]
first.handle: Rectangle {
x: control.leftPadding + (horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height))
@@ -68,9 +67,7 @@ T.RangeSlider {
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
- //! [firstHandle]
- //! [secondHandle]
second.handle: Rectangle {
x: control.leftPadding + (horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height))
@@ -87,9 +84,7 @@ T.RangeSlider {
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
- //! [secondHandle]
- //! [background]
background: Rectangle {
x: control.leftPadding + (horizontal ? 0 : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : 0)
@@ -103,5 +98,4 @@ T.RangeSlider {
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
- //! [background]
}
diff --git a/src/imports/controls/ScrollBar.qml b/src/imports/controls/ScrollBar.qml
index fcca30e8..52ec1995 100644
--- a/src/imports/controls/ScrollBar.qml
+++ b/src/imports/controls/ScrollBar.qml
@@ -49,7 +49,6 @@ T.ScrollBar {
padding: 2
- //! [contentItem]
contentItem: Rectangle {
id: handle
@@ -75,5 +74,4 @@ T.ScrollBar {
}
}
}
- //! [contentItem]
}
diff --git a/src/imports/controls/ScrollIndicator.qml b/src/imports/controls/ScrollIndicator.qml
index 50f58575..8ef60ed6 100644
--- a/src/imports/controls/ScrollIndicator.qml
+++ b/src/imports/controls/ScrollIndicator.qml
@@ -49,7 +49,6 @@ T.ScrollIndicator {
padding: 2
- //! [contentItem]
contentItem: Rectangle {
id: indicator
@@ -76,5 +75,4 @@ T.ScrollIndicator {
}
]
}
- //! [contentItem]
}
diff --git a/src/imports/controls/Slider.qml b/src/imports/controls/Slider.qml
index bebd5591..2a14d31c 100644
--- a/src/imports/controls/Slider.qml
+++ b/src/imports/controls/Slider.qml
@@ -49,7 +49,6 @@ T.Slider {
padding: 6
- //! [handle]
handle: Rectangle {
x: control.leftPadding + (horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
@@ -66,9 +65,7 @@ T.Slider {
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
- //! [handle]
- //! [background]
background: Rectangle {
x: control.leftPadding + (horizontal ? 0 : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : 0)
@@ -82,5 +79,4 @@ T.Slider {
readonly property bool horizontal: control.orientation === Qt.Horizontal
}
- //! [background]
}
diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml
index b9e2199e..6a564d6e 100644
--- a/src/imports/controls/SpinBox.qml
+++ b/src/imports/controls/SpinBox.qml
@@ -56,15 +56,12 @@ T.SpinBox {
leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0))
rightPadding: padding + (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0))
- //! [validator]
validator: IntValidator {
locale: control.locale.name
bottom: Math.min(control.from, control.to)
top: Math.max(control.from, control.to)
}
- //! [validator]
- //! [contentItem]
contentItem: TextInput {
z: 2
text: control.textFromValue(control.value, control.locale)
@@ -92,9 +89,7 @@ T.SpinBox {
border.width: 2
}
}
- //! [contentItem]
- //! [up.indicator]
up.indicator: Rectangle {
x: control.mirrored ? 0 : parent.width - width
height: parent.height
@@ -117,9 +112,7 @@ T.SpinBox {
color: enabled ? Default.textColor : Default.textDisabledColor
}
}
- //! [up.indicator]
- //! [down.indicator]
down.indicator: Rectangle {
x: control.mirrored ? parent.width - width : 0
height: parent.height
@@ -135,12 +128,9 @@ T.SpinBox {
color: enabled ? Default.textColor : Default.textDisabledColor
}
}
- //! [down.indicator]
- //! [background]
background: Rectangle {
implicitWidth: 140
border.color: Default.buttonColor
}
- //! [background]
}
diff --git a/src/imports/controls/StackView.qml b/src/imports/controls/StackView.qml
index 93e4503f..96120d2b 100644
--- a/src/imports/controls/StackView.qml
+++ b/src/imports/controls/StackView.qml
@@ -41,39 +41,27 @@ import QtQuick.Templates 2.1 as T
T.StackView {
id: control
- //! [popEnter]
popEnter: Transition {
XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
}
- //! [popEnter]
- //! [popExit]
popExit: Transition {
XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * control.width; duration: 400; easing.type: Easing.OutCubic }
}
- //! [popExit]
- //! [pushEnter]
pushEnter: Transition {
XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
}
- //! [pushEnter]
- //! [pushExit]
pushExit: Transition {
XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic }
}
- //! [pushExit]
- //! [replaceEnter]
replaceEnter: Transition {
XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
}
- //! [replaceEnter]
- //! [replaceExit]
replaceExit: Transition {
XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic }
}
- //! [replaceExit]
}
diff --git a/src/imports/controls/SwipeDelegate.qml b/src/imports/controls/SwipeDelegate.qml
index 8b9c9f2f..b140eb95 100644
--- a/src/imports/controls/SwipeDelegate.qml
+++ b/src/imports/controls/SwipeDelegate.qml
@@ -52,7 +52,6 @@ T.SwipeDelegate {
padding: 12
spacing: 12
- //! [contentItem]
contentItem: Text {
leftPadding: control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0
rightPadding: !control.mirrored ? (control.indicator ? control.indicator.width : 0) + control.spacing : 0
@@ -73,9 +72,7 @@ T.SwipeDelegate {
}
}
}
- //! [contentItem]
- //! [background]
background: Rectangle {
color: control.visualFocus
? (control.down ? Default.focusPressedColor : Default.delegateFocusColor)
@@ -89,5 +86,4 @@ T.SwipeDelegate {
}
}
}
- //! [background]
}
diff --git a/src/imports/controls/SwipeView.qml b/src/imports/controls/SwipeView.qml
index cd026f7c..42a327a0 100644
--- a/src/imports/controls/SwipeView.qml
+++ b/src/imports/controls/SwipeView.qml
@@ -48,7 +48,6 @@ T.SwipeView {
Accessible.role: Accessible.PageTabList
- //! [contentItem]
contentItem: ListView {
model: control.contentModel
interactive: control.interactive
@@ -64,5 +63,4 @@ T.SwipeView {
preferredHighlightEnd: 0
highlightMoveDuration: 250
}
- //! [contentItem]
}
diff --git a/src/imports/controls/Switch.qml b/src/imports/controls/Switch.qml
index 16f2744f..1918189a 100644
--- a/src/imports/controls/Switch.qml
+++ b/src/imports/controls/Switch.qml
@@ -52,15 +52,12 @@ T.Switch {
padding: 6
spacing: 6
- //! [indicator]
indicator: SwitchIndicator {
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
}
- //! [indicator]
- //! [contentItem]
contentItem: Text {
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
@@ -73,5 +70,4 @@ T.Switch {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
}
diff --git a/src/imports/controls/SwitchDelegate.qml b/src/imports/controls/SwitchDelegate.qml
index 8f2af81c..a030ec07 100644
--- a/src/imports/controls/SwitchDelegate.qml
+++ b/src/imports/controls/SwitchDelegate.qml
@@ -52,15 +52,12 @@ T.SwitchDelegate {
padding: 12
spacing: 12
- //! [indicator]
indicator: SwitchIndicator {
x: text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + (control.availableHeight - height) / 2
control: control
}
- //! [indicator]
- //! [contentItem]
contentItem: Text {
leftPadding: control.indicator && !control.mirrored ? 0 : control.indicator.width + control.spacing
rightPadding: control.indicator && control.mirrored ? 0 : control.indicator.width + control.spacing
@@ -73,14 +70,11 @@ T.SwitchDelegate {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 100
implicitHeight: 40
visible: control.down || control.highlighted
color: control.down ? Default.delegatePressedColor : Default.delegateColor
}
- //! [background]
}
diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml
index 8b23c94a..21358c39 100644
--- a/src/imports/controls/TabBar.qml
+++ b/src/imports/controls/TabBar.qml
@@ -47,7 +47,6 @@ T.TabBar {
spacing: 1
- //! [contentItem]
contentItem: ListView {
implicitWidth: contentWidth
implicitHeight: 40
@@ -66,9 +65,6 @@ T.TabBar {
preferredHighlightBegin: 40
preferredHighlightEnd: width - 40
}
- //! [contentItem]
- //! [background]
background: Rectangle { }
- //! [background]
}
diff --git a/src/imports/controls/TabButton.qml b/src/imports/controls/TabButton.qml
index 824c2737..f0d922a1 100644
--- a/src/imports/controls/TabButton.qml
+++ b/src/imports/controls/TabButton.qml
@@ -50,7 +50,6 @@ T.TabButton {
padding: 6
- //! [contentItem]
contentItem: Text {
text: control.text
font: control.font
@@ -60,14 +59,11 @@ T.TabButton {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitHeight: 40
color: control.down
? (control.checked ? Default.tabButtonCheckedPressedColor : Default.tabButtonPressedColor)
: (control.checked ? "transparent" : Default.tabButtonColor)
}
- //! [background]
}
diff --git a/src/imports/controls/TextField.qml b/src/imports/controls/TextField.qml
index e58b94c0..5e6e91b6 100644
--- a/src/imports/controls/TextField.qml
+++ b/src/imports/controls/TextField.qml
@@ -74,7 +74,6 @@ T.TextField {
elide: Text.ElideRight
}
- //! [background]
background: Rectangle {
implicitWidth: 200
implicitHeight: 40
@@ -82,5 +81,4 @@ T.TextField {
color: control.enabled ? Default.backgroundColor : Default.disabledDarkColor
border.color: control.activeFocus ? Default.focusColor : (control.enabled ? Default.disabledLightColor : "transparent")
}
- //! [background]
}
diff --git a/src/imports/controls/ToolBar.qml b/src/imports/controls/ToolBar.qml
index f5e5076c..d7c29be7 100644
--- a/src/imports/controls/ToolBar.qml
+++ b/src/imports/controls/ToolBar.qml
@@ -48,10 +48,8 @@ T.ToolBar {
contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0)
contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0)
- //! [background]
background: Rectangle {
implicitHeight: 40
color: Default.delegateColor
}
- //! [background]
}
diff --git a/src/imports/controls/ToolButton.qml b/src/imports/controls/ToolButton.qml
index f92845f8..8d91da10 100644
--- a/src/imports/controls/ToolButton.qml
+++ b/src/imports/controls/ToolButton.qml
@@ -50,7 +50,6 @@ T.ToolButton {
padding: 6
- //! [contentItem]
contentItem: Text {
text: control.text
font: control.font
@@ -59,9 +58,7 @@ T.ToolButton {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 40
implicitHeight: 40
@@ -70,5 +67,4 @@ T.ToolButton {
opacity: control.down ? 1.0 : control.enabled && (control.checked || control.highlighted) ? 0.5 : 0
visible: control.down || (control.enabled && (control.checked || control.highlighted))
}
- //! [background]
}
diff --git a/src/imports/controls/ToolTip.qml b/src/imports/controls/ToolTip.qml
index 783dc224..bf574c28 100644
--- a/src/imports/controls/ToolTip.qml
+++ b/src/imports/controls/ToolTip.qml
@@ -55,17 +55,13 @@ T.ToolTip {
closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
- //! [contentItem]
contentItem: Text {
text: control.text
font: control.font
// TODO: wrapMode: Label.Wrap
}
- //! [contentItem]
- //! [background]
background: Rectangle {
border.color: Default.frameDarkColor
}
- //! [background]
}
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-busyindicator.gif b/src/imports/controls/doc/images/qtquickcontrols2-busyindicator.gif
index 31ab2d1c..653d200f 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-busyindicator.gif
+++ b/src/imports/controls/doc/images/qtquickcontrols2-busyindicator.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-drawer.gif b/src/imports/controls/doc/images/qtquickcontrols2-drawer.gif
new file mode 100644
index 00000000..736f34f6
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-drawer.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.png b/src/imports/controls/doc/images/qtquickcontrols2-popup.png
new file mode 100644
index 00000000..4514948d
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.png
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.svg b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg
new file mode 100644
index 00000000..1d78addf
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg
@@ -0,0 +1,391 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="679.31317"
+ height="357.84125"
+ viewBox="0 0 679.31314 357.84124"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="qtquickcontrols2-popup.svg"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4">
+ <marker
+ inkscape:stockid="TriangleOutL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleOutL"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4327"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(0.8,0.8)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="TriangleInL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleInL"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4318"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(-0.8,-0.8)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Mstart"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Mstart"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4191"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="matrix(0.4,0,0,0.4,4,0)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow2Mend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow2Mend"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4212"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1"
+ d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+ transform="scale(-0.6,-0.6)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="TriangleInL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleInL-2"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4318-4"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(-0.8,-0.8)" />
+ </marker>
+ <marker
+ inkscape:stockid="TriangleOutL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleOutL-9"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4327-1"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(0.8,0.8)" />
+ </marker>
+ <marker
+ inkscape:stockid="TriangleInL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleInL-3"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4318-9"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(-0.8,-0.8)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="TriangleOutL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleOutL-0"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4327-5"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(0.8,0.8)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="TriangleInL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleInL-9"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4318-2"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(-0.8,-0.8)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="TriangleOutL"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="TriangleOutL-1"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path4327-2"
+ d="m 5.77,0 -8.65,5 0,-10 8.65,5 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="scale(0.8,0.8)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="359.69451"
+ inkscape:cy="143.84745"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ units="px" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(91.482322,-255.11685)">
+ <rect
+ style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect4136"
+ width="564.41473"
+ height="248.82799"
+ x="-30.289024"
+ y="321.69858" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138"
+ style="font-style:normal;font-weight:normal;font-size:15.41801071px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(1.1690183,0,0,1.1690183,19.800223,-141.31953)"><flowRegion
+ id="flowRegion4140"><rect
+ id="rect4142"
+ width="129.78784"
+ height="31.668232"
+ x="-34.519978"
+ y="400.22751"
+ style="font-size:15.41801071px;fill:#000000" /></flowRegion><flowPara
+ id="flowPara4144"
+ style="font-size:20.55734825px;fill:#000000">Background</flowPara><flowPara
+ id="flowPara4146" /></flowRoot> <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:27.60000038;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503"
+ id="rect4148"
+ width="464.22452"
+ height="165.94499"
+ x="18.895706"
+ y="364.74274" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,144.03104,146.23557)"><flowRegion
+ id="flowRegion4140-6"><rect
+ id="rect4142-6"
+ width="334.36047"
+ height="80.812172"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:40px;fill:#000000" /></flowRegion><flowPara
+ id="flowPara4146-6">Content item</flowPara></flowRoot> <path
+ style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1.04880464;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL);marker-end:url(#TriangleOutL)"
+ d="m 27.018805,516.90108 0,-133.62042"
+ id="path4179"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839902;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2);marker-end:url(#TriangleOutL-9)"
+ d="m 26.776662,538.68728 451.028788,0"
+ id="path4179-7"
+ inkscape:connector-curvature="0" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-2"
+ style="font-style:normal;font-weight:normal;font-size:20px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,10.003309,144.31674)"><flowRegion
+ id="flowRegion4140-6-6"><rect
+ id="rect4142-6-1"
+ width="117.17769"
+ height="101.01524"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:20px;fill:#000000" /></flowRegion><flowPara
+ id="flowPara9732"
+ style="font-size:17.5px;fill:#000000">Available height</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-2-7"
+ style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,10.811464,253.07573)"><flowRegion
+ id="flowRegion4140-6-6-4"><rect
+ id="rect4142-6-1-4"
+ width="252.53812"
+ height="61.619293"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara
+ style="font-size:17.5px;fill:#000000"
+ id="flowPara10048">Available width</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-1"
+ style="font-style:normal;font-weight:normal;font-size:25px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,210.99354,300.96896)"><flowRegion
+ id="flowRegion4140-6-9"><rect
+ id="rect4142-6-0"
+ width="270.72089"
+ height="68.690361"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:25px;fill:#000000" /></flowRegion><flowPara
+ id="flowPara4146-6-2"
+ style="font-size:17.5px">Width</flowPara></flowRoot> <path
+ style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.90119678;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-3);marker-end:url(#TriangleOutL-0)"
+ d="m -26.522148,583.27143 557.292688,0"
+ id="path4179-8"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:0.9011969;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-9);marker-end:url(#TriangleOutL-1)"
+ d="m -43.461661,566.30584 0,-239.7552"
+ id="path4179-9"
+ inkscape:connector-curvature="0" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-1-7"
+ style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,-112.00353,150.83655)"><flowRegion
+ id="flowRegion4140-6-9-7"><rect
+ id="rect4142-6-0-5"
+ width="270.72089"
+ height="68.690361"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara
+ id="flowPara4146-6-2-9"
+ style="font-size:17.5px;fill:#000000">Height</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-3"
+ style="font-style:normal;font-weight:normal;font-size:60px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,166.31611,-24.786365)"><flowRegion
+ id="flowRegion4140-6-67"><rect
+ id="rect4142-6-5"
+ width="334.36047"
+ height="80.812172"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:60px;fill:#000000" /></flowRegion><flowPara
+ id="flowPara4146-6-3">Popup</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-2-7-5"
+ style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,186.57489,257.45801)"><flowRegion
+ id="flowRegion4140-6-6-4-6"><rect
+ id="rect4142-6-1-4-2"
+ width="252.53812"
+ height="61.619293"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara
+ style="font-size:17.5px;fill:#000000"
+ id="flowPara10048-9">Bottom padding</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-2-7-5-1"
+ style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,193.9747,48.798368)"><flowRegion
+ id="flowRegion4140-6-6-4-6-2"><rect
+ id="rect4142-6-1-4-2-7"
+ width="252.53812"
+ height="61.619293"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara
+ style="font-size:17.5px;fill:#000000"
+ id="flowPara10048-9-0">Top padding</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-2-7-5-9"
+ style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,457.80767,148.11921)"><flowRegion
+ id="flowRegion4140-6-6-4-6-3"><rect
+ id="rect4142-6-1-4-2-6"
+ width="81.109558"
+ height="93.762154"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara
+ style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000"
+ id="flowPara4386">Right padding</flowPara></flowRoot> <flowRoot
+ xml:space="preserve"
+ id="flowRoot4138-6-2-7-5-9-2"
+ style="font-style:normal;font-weight:normal;font-size:17.5px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ transform="matrix(0.6007979,0,0,0.6007979,-54.735211,151.06168)"><flowRegion
+ id="flowRegion4140-6-6-4-6-3-5"><rect
+ id="rect4142-6-1-4-2-6-4"
+ width="81.109558"
+ height="93.762154"
+ x="42.426407"
+ y="481.62601"
+ style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara
+ style="font-size:17.02554321px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000"
+ id="flowPara4386-0">Left padding</flowPara></flowRoot> </g>
+</svg>
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-swipeview.gif b/src/imports/controls/doc/images/qtquickcontrols2-swipeview.gif
new file mode 100644
index 00000000..4af26c10
--- /dev/null
+++ b/src/imports/controls/doc/images/qtquickcontrols2-swipeview.gif
Binary files differ
diff --git a/src/imports/controls/doc/images/qtquickcontrols2-toolbar.png b/src/imports/controls/doc/images/qtquickcontrols2-toolbar.png
index f4808ca9..1fe353cc 100644
--- a/src/imports/controls/doc/images/qtquickcontrols2-toolbar.png
+++ b/src/imports/controls/doc/images/qtquickcontrols2-toolbar.png
Binary files differ
diff --git a/src/imports/controls/doc/qtquickcontrols2.qdocconf b/src/imports/controls/doc/qtquickcontrols2.qdocconf
index 15da00ad..42ff16f8 100644
--- a/src/imports/controls/doc/qtquickcontrols2.qdocconf
+++ b/src/imports/controls/doc/qtquickcontrols2.qdocconf
@@ -35,7 +35,6 @@ depends = qtcore qtgui qtdoc qtqml qtquick qtquickdialogs qtquickcontrols qtquic
# Note: paths passed to \example command must contain the parent directory, e.g.
# \example controls/tabs
exampledirs += ../../../../examples/quickcontrols2 \
- ../ \
../../../quicktemplates2 \
snippets \
snippets/screenshots
diff --git a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml
index 98a13b7b..2ec10c57 100644
--- a/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml
+++ b/src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-toolbar.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
@@ -29,19 +29,34 @@ import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.1
+Item {
+ width: children[0].implicitWidth * 2
+ height: children[0].implicitHeight
+ Binding {
+ target: children[0]
+ property: "width"
+ value: width
+ }
//! [1]
ToolBar {
RowLayout {
anchors.fill: parent
ToolButton {
- text: qsTr("\u25C0 Qt")
+ text: qsTr("‹")
onClicked: stack.pop()
}
- Item { Layout.fillWidth: true }
- Switch {
- checked: true
- text: qsTr("Notifications")
+ Label {
+ text: "Title"
+ elide: Label.ElideRight
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ Layout.fillWidth: true
+ }
+ ToolButton {
+ text: qsTr("⋮")
+ onClicked: menu.open()
}
}
}
//! [1]
+}
diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp
index fb8db27e..0e62200d 100644
--- a/src/imports/templates/qtquicktemplates2plugin.cpp
+++ b/src/imports/templates/qtquicktemplates2plugin.cpp
@@ -69,6 +69,7 @@
#include <QtQuickTemplates2/private/qquickroundbutton_p.h>
#include <QtQuickTemplates2/private/qquickscrollbar_p.h>
#include <QtQuickTemplates2/private/qquickscrollindicator_p.h>
+#include <QtQuickTemplates2/private/qquickshortcutcontext_p_p.h>
#include <QtQuickTemplates2/private/qquickslider_p.h>
#include <QtQuickTemplates2/private/qquickspinbox_p.h>
#include <QtQuickTemplates2/private/qquickstackview_p.h>
@@ -93,6 +94,11 @@ static inline void initResources()
#endif
}
+// qtdeclarative/src/quick/util/qquickshortcut.cpp
+typedef bool (*ShortcutContextMatcher)(QObject *, Qt::ShortcutContext);
+extern ShortcutContextMatcher qt_quick_shortcut_context_matcher();
+extern void qt_quick_set_shortcut_context_matcher(ShortcutContextMatcher matcher);
+
QT_BEGIN_NAMESPACE
class QtQuickTemplates2Plugin: public QQmlExtensionPlugin
@@ -102,12 +108,25 @@ class QtQuickTemplates2Plugin: public QQmlExtensionPlugin
public:
QtQuickTemplates2Plugin(QObject *parent = nullptr);
+ ~QtQuickTemplates2Plugin();
+
void registerTypes(const char *uri);
+
+private:
+ ShortcutContextMatcher originalContextMatcher;
};
QtQuickTemplates2Plugin::QtQuickTemplates2Plugin(QObject *parent) : QQmlExtensionPlugin(parent)
{
initResources();
+
+ originalContextMatcher = qt_quick_shortcut_context_matcher();
+ qt_quick_set_shortcut_context_matcher(QQuickShortcutContext::matcher);
+}
+
+QtQuickTemplates2Plugin::~QtQuickTemplates2Plugin()
+{
+ qt_quick_set_shortcut_context_matcher(originalContextMatcher);
}
void QtQuickTemplates2Plugin::registerTypes(const char *uri)
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index ce75a497..e7c34065 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -56,7 +56,7 @@ static const int AUTO_REPEAT_INTERVAL = 100;
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-buttons
- \brief Base type of all button controls.
+ \brief Abstract base type providing functionality common to buttons.
AbstractButton provides the interface for controls with button-like
behavior; for example, push buttons and checkable controls like
diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp
index 7f65b8bf..87dc8816 100644
--- a/src/quicktemplates2/qquickapplicationwindow.cpp
+++ b/src/quicktemplates2/qquickapplicationwindow.cpp
@@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-containers
- \brief Provides a top-level application window.
+ \brief Styled top-level window with support for a header and footer.
ApplicationWindow is a \l Window which makes it convenient to add
a \l header and \l footer item to the window.
@@ -90,10 +90,45 @@ QT_BEGIN_NAMESPACE
ApplicationWindow supports popups via its \l overlay property, which
ensures that popups are displayed above other content and that the
- background is dimmed when a modal popup is visible.
+ background is dimmed when a \l {Popup::}{modal} or \l {Popup::dim}
+ {dimmed} popup is visible.
\note By default, an ApplicationWindow is not visible.
+ \section2 Attached ApplicationWindow Properties
+
+ Due to how \l {Scope and Naming Resolution} works in QML, it is possible
+ to reference the \c id of the application root element anywhere in its
+ child QML objects. Even though this approach is fine for many applications
+ and use cases, for a generic QML component it may not be acceptable as it
+ creates a dependency to the surrounding environment.
+
+ ApplicationWindow provides a set of attached properties that can be used
+ to access the window and its building blocks from places where no direct
+ access to the window is available, without creating a dependency to a
+ certain window \c id. A QML component that uses the ApplicationWindow
+ attached properties works in any window regardless of its \c id. The
+ following example uses the attached \c overlay property to position the
+ popup to the center of the window, despite the position of the button
+ that opens the popup.
+
+ \code
+ Button {
+ onClicked: popup.open()
+
+ Popup {
+ id: popup
+
+ parent: ApplicationWindow.overlay
+
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: 100
+ height: 100
+ }
+ }
+ \endcode
+
\sa {Customizing ApplicationWindow}, Page, {Container Controls}
*/
@@ -315,6 +350,14 @@ void QQuickApplicationWindow::setBackground(QQuickItem *background)
This property holds the window header item. The header item is positioned to
the top, and resized to the width of the window. The default value is \c null.
+ \code
+ ApplicationWindow {
+ header: TabBar {
+ // ...
+ }
+ }
+ \endcode
+
\note Assigning a ToolBar, TabBar, or DialogButtonBox as a window header
automatically sets the respective \l ToolBar::position, \l TabBar::position,
or \l DialogButtonBox::position property to \c Header.
@@ -364,6 +407,14 @@ void QQuickApplicationWindow::setHeader(QQuickItem *header)
This property holds the window footer item. The footer item is positioned to
the bottom, and resized to the width of the window. The default value is \c null.
+ \code
+ ApplicationWindow {
+ footer: ToolBar {
+ // ...
+ }
+ }
+ \endcode
+
\note Assigning a ToolBar, TabBar, or DialogButtonBox as a window footer
automatically sets the respective \l ToolBar::position, \l TabBar::position,
or \l DialogButtonBox::position property to \c Footer.
@@ -726,6 +777,8 @@ QQuickApplicationWindowAttached::QQuickApplicationWindowAttached(QObject *parent
This attached property holds the application window. The property can be attached
to any item. The value is \c null if the item is not in an ApplicationWindow.
+
+ \sa {Attached ApplicationWindow Properties}
*/
QQuickApplicationWindow *QQuickApplicationWindowAttached::window() const
{
@@ -739,6 +792,8 @@ QQuickApplicationWindow *QQuickApplicationWindowAttached::window() const
This attached property holds the window content item. The property can be attached
to any item. The value is \c null if the item is not in an ApplicationWindow.
+
+ \sa {Attached ApplicationWindow Properties}
*/
QQuickItem *QQuickApplicationWindowAttached::contentItem() const
{
@@ -757,7 +812,7 @@ QQuickItem *QQuickApplicationWindowAttached::contentItem() const
The value is \c null if the item is not in an ApplicationWindow, or the window has
no active focus.
- \sa Window::activeFocusItem
+ \sa Window::activeFocusItem, {Attached ApplicationWindow Properties}
*/
QQuickItem *QQuickApplicationWindowAttached::activeFocusControl() const
{
@@ -774,6 +829,8 @@ QQuickItem *QQuickApplicationWindowAttached::activeFocusControl() const
This attached property holds the window header item. The property can be attached
to any item. The value is \c null if the item is not in an ApplicationWindow, or
the window has no header item.
+
+ \sa {Attached ApplicationWindow Properties}
*/
QQuickItem *QQuickApplicationWindowAttached::header() const
{
@@ -790,6 +847,8 @@ QQuickItem *QQuickApplicationWindowAttached::header() const
This attached property holds the window footer item. The property can be attached
to any item. The value is \c null if the item is not in an ApplicationWindow, or
the window has no footer item.
+
+ \sa {Attached ApplicationWindow Properties}
*/
QQuickItem *QQuickApplicationWindowAttached::footer() const
{
@@ -805,6 +864,8 @@ QQuickItem *QQuickApplicationWindowAttached::footer() const
This attached property holds the window overlay item. The property can be attached
to any item. The value is \c null if the item is not in an ApplicationWindow.
+
+ \sa {Attached ApplicationWindow Properties}
*/
QQuickOverlay *QQuickApplicationWindowAttached::overlay() const
{
diff --git a/src/quicktemplates2/qquickbusyindicator.cpp b/src/quicktemplates2/qquickbusyindicator.cpp
index 73181ec7..2cd3f62d 100644
--- a/src/quicktemplates2/qquickbusyindicator.cpp
+++ b/src/quicktemplates2/qquickbusyindicator.cpp
@@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-indicators
- \brief Indicates activity while content is being loaded.
+ \brief Indicates background activity, for example, while content is being loaded.
\image qtquickcontrols2-busyindicator.gif
@@ -61,6 +61,18 @@ QT_BEGIN_NAMESPACE
}
\endqml
+ BusyIndicator is similar to an indeterminate \l ProgressBar. Both can be
+ used to indicate background activity. The main difference is visual, and
+ that ProgressBar can also present a concrete amount of progress (when it
+ can be determined). Due to the visual difference, busy indicators and
+ indeterminate progress bars fit different places in user interfaces.
+ Typical places for a busy indicator:
+ \list
+ \li in the corner of a \l ToolBar
+ \li as an overlay on top of a \l Page
+ \li on the side of an \l ItemDelegate
+ \endlist
+
\sa {Customizing BusyIndicator}, {Indicator Controls}, ProgressBar
*/
diff --git a/src/quicktemplates2/qquickbutton.cpp b/src/quicktemplates2/qquickbutton.cpp
index ca85b008..3d00e40c 100644
--- a/src/quicktemplates2/qquickbutton.cpp
+++ b/src/quicktemplates2/qquickbutton.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-buttons
- \brief A push-button control that can be clicked by the user.
+ \brief Push-button that can be clicked to perform a command or answer a question.
\image qtquickcontrols2-button.gif
diff --git a/src/quicktemplates2/qquickbuttongroup.cpp b/src/quicktemplates2/qquickbuttongroup.cpp
index 9630cbaf..89941c19 100644
--- a/src/quicktemplates2/qquickbuttongroup.cpp
+++ b/src/quicktemplates2/qquickbuttongroup.cpp
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup utilities
- \brief A mutually-exclusive group of checkable controls.
+ \brief Mutually-exclusive group of checkable buttons.
ButtonGroup is a non-visual, mutually exclusive group of buttons.
It is used with controls such as RadioButton, where only one of the options
diff --git a/src/quicktemplates2/qquickcheckbox.cpp b/src/quicktemplates2/qquickcheckbox.cpp
index ae967c34..fd5ab6ba 100644
--- a/src/quicktemplates2/qquickcheckbox.cpp
+++ b/src/quicktemplates2/qquickcheckbox.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-buttons
- \brief An option button that can be checked or unchecked.
+ \brief Check button that can be toggled on or off.
\image qtquickcontrols2-checkbox.gif
diff --git a/src/quicktemplates2/qquickcheckdelegate.cpp b/src/quicktemplates2/qquickcheckdelegate.cpp
index 304d2b6c..51bc8501 100644
--- a/src/quicktemplates2/qquickcheckdelegate.cpp
+++ b/src/quicktemplates2/qquickcheckdelegate.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-delegates
- \brief An item delegate that can be checked or unchecked.
+ \brief Item delegate with a check indicator that can be toggled on or off.
\image qtquickcontrols2-checkdelegate.gif
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index 3aa67688..fba21453 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-input
- \brief A combined button and popup list taking minimal space.
+ \brief Combined button and popup list for selecting options.
\image qtquickcontrols2-combobox.gif
@@ -274,6 +274,8 @@ void QQuickComboBoxPrivate::updateCurrentText()
QString text = q->textAt(currentIndex);
if (currentText != text) {
currentText = text;
+ if (!hasDisplayText)
+ q->setAccessibleName(text);
emit q->currentTextChanged();
}
if (!hasDisplayText && displayText != text) {
@@ -595,6 +597,7 @@ void QQuickComboBox::setDisplayText(const QString &text)
return;
d->displayText = text;
+ setAccessibleName(text);
emit displayTextChanged();
}
@@ -996,4 +999,20 @@ QFont QQuickComboBox::defaultFont() const
return QQuickControlPrivate::themeFont(QPlatformTheme::ComboMenuItemFont);
}
+#ifndef QT_NO_ACCESSIBILITY
+QAccessible::Role QQuickComboBox::accessibleRole() const
+{
+ return QAccessible::ComboBox;
+}
+
+void QQuickComboBox::accessibilityActiveChanged(bool active)
+{
+ Q_D(QQuickComboBox);
+ QQuickControl::accessibilityActiveChanged(active);
+
+ if (active)
+ setAccessibleName(d->hasDisplayText ? d->displayText : d->currentText);
+}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/quicktemplates2/qquickcombobox_p.h b/src/quicktemplates2/qquickcombobox_p.h
index 3788d56a..0e18a4d5 100644
--- a/src/quicktemplates2/qquickcombobox_p.h
+++ b/src/quicktemplates2/qquickcombobox_p.h
@@ -151,6 +151,11 @@ protected:
QFont defaultFont() const override;
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::Role accessibleRole() const override;
+ void accessibilityActiveChanged(bool active) override;
+#endif
+
private:
Q_DISABLE_COPY(QQuickComboBox)
Q_DECLARE_PRIVATE(QQuickComboBox)
diff --git a/src/quicktemplates2/qquickcontainer.cpp b/src/quicktemplates2/qquickcontainer.cpp
index f7b6da00..decc6e8a 100644
--- a/src/quicktemplates2/qquickcontainer.cpp
+++ b/src/quicktemplates2/qquickcontainer.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-containers
- \brief A container control base type.
+ \brief Abstract base type providing functionality common to containers.
Container is the base type of container-like user interface controls that
allow dynamic insertion and removal of items.
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index b1f6bd5f..d8088f24 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
\instantiates QQuickControl
\inqmlmodule QtQuick.Controls
\since 5.7
- \brief The base type of user interface controls.
+ \brief Abstract base type providing functionality common to all controls.
Control is the base type of user interface controls. It receives input
events from the window system, and paints a representation of itself on
diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp
index 48d02faa..22c1133b 100644
--- a/src/quicktemplates2/qquickdial.cpp
+++ b/src/quicktemplates2/qquickdial.cpp
@@ -49,12 +49,14 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-input
- \brief A circular dial that is rotated to set a value.
+ \brief Circular dial that is rotated to set a value.
The Dial is similar to a traditional dial knob that is found on devices
such as stereos or industrial equipment. It allows the user to specify a
value within a range.
+ \image qtquickcontrols2-dial-no-wrap.gif
+
The value of the dial is set with the \l value property. The range is
set with the \l from and \l to properties. To enable or disable wrapping,
use the \l wrap property.
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index 423e7513..36493e79 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -53,21 +53,17 @@ QT_BEGIN_NAMESPACE
\since 5.7
\ingroup qtquickcontrols2-navigation
\ingroup qtquickcontrols2-popups
- \brief Provides a swipe-based side panel.
+ \brief Side panel that can be opened and closed using a swipe gesture.
Drawer provides a swipe-based side panel, similar to those often used in
touch interfaces to provide a central location for navigation.
- \table
- \row
- \li \image qtquickcontrols2-drawer-wireframe.png
- Drawer can be positioned at any of the four edges of the content item. \br
- In this image, it is against the left edge of the window.
+ \image qtquickcontrols2-drawer.gif
- \li \image qtquickcontrols2-drawer-expanded-wireframe.png
- The drawer is then opened by \e "dragging" it out from the left edge \br
- of the window.
- \endtable
+ Drawer can be positioned at any of the four edges of the content item.
+ The drawer above is positioned against the left edge of the window. The
+ drawer is then opened by \e "dragging" it out from the left edge of the
+ window.
\code
import QtQuick 2.7
diff --git a/src/quicktemplates2/qquickframe.cpp b/src/quicktemplates2/qquickframe.cpp
index bcc387c1..9deef6be 100644
--- a/src/quicktemplates2/qquickframe.cpp
+++ b/src/quicktemplates2/qquickframe.cpp
@@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-containers
- \brief A logical group of controls within a visual frame.
+ \brief Visual frame for a logical group of controls.
Frame is used to layout a logical group of controls together within a
visual frame. Frame does not provide a layout of its own, but requires
@@ -78,4 +78,11 @@ QQuickFrame::QQuickFrame(QQuickFramePrivate &dd, QQuickItem *parent) :
{
}
+#ifndef QT_NO_ACCESSIBILITY
+QAccessible::Role QQuickFrame::accessibleRole() const
+{
+ return QAccessible::Border;
+}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/quicktemplates2/qquickframe_p.h b/src/quicktemplates2/qquickframe_p.h
index 12a65afd..093da248 100644
--- a/src/quicktemplates2/qquickframe_p.h
+++ b/src/quicktemplates2/qquickframe_p.h
@@ -64,6 +64,10 @@ public:
protected:
QQuickFrame(QQuickFramePrivate &dd, QQuickItem *parent);
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::Role accessibleRole() const override;
+#endif
+
private:
Q_DISABLE_COPY(QQuickFrame)
Q_DECLARE_PRIVATE(QQuickFrame)
diff --git a/src/quicktemplates2/qquickgroupbox.cpp b/src/quicktemplates2/qquickgroupbox.cpp
index 5a5a8005..dd6d1883 100644
--- a/src/quicktemplates2/qquickgroupbox.cpp
+++ b/src/quicktemplates2/qquickgroupbox.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-containers
- \brief A logical group of controls within a titled visual frame.
+ \brief Visual frame and title for a logical group of controls.
GroupBox is used to layout a logical group of controls together, within
a \l {title}{titled} visual frame. GroupBox does not provide a layout of its own, but
@@ -118,6 +118,7 @@ void QQuickGroupBox::setTitle(const QString &title)
return;
d->title = title;
+ setAccessibleName(title);
emit titleChanged();
}
@@ -152,4 +153,20 @@ QFont QQuickGroupBox::defaultFont() const
return QQuickControlPrivate::themeFont(QPlatformTheme::GroupBoxTitleFont);
}
+#ifndef QT_NO_ACCESSIBILITY
+QAccessible::Role QQuickGroupBox::accessibleRole() const
+{
+ return QAccessible::Grouping;
+}
+
+void QQuickGroupBox::accessibilityActiveChanged(bool active)
+{
+ Q_D(QQuickGroupBox);
+ QQuickFrame::accessibilityActiveChanged(active);
+
+ if (active)
+ setAccessibleName(d->title);
+}
+#endif // QT_NO_ACCESSIBILITY
+
QT_END_NAMESPACE
diff --git a/src/quicktemplates2/qquickgroupbox_p.h b/src/quicktemplates2/qquickgroupbox_p.h
index 0f1bdc54..98f6ad06 100644
--- a/src/quicktemplates2/qquickgroupbox_p.h
+++ b/src/quicktemplates2/qquickgroupbox_p.h
@@ -76,6 +76,11 @@ Q_SIGNALS:
protected:
QFont defaultFont() const override;
+#ifndef QT_NO_ACCESSIBILITY
+ QAccessible::Role accessibleRole() const override;
+ void accessibilityActiveChanged(bool active) override;
+#endif
+
private:
Q_DISABLE_COPY(QQuickGroupBox)
Q_DECLARE_PRIVATE(QQuickGroupBox)
diff --git a/src/quicktemplates2/qquickitemdelegate.cpp b/src/quicktemplates2/qquickitemdelegate.cpp
index 9b21eb30..411cb224 100644
--- a/src/quicktemplates2/qquickitemdelegate.cpp
+++ b/src/quicktemplates2/qquickitemdelegate.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\instantiates QQuickItemDelegate
\inqmlmodule QtQuick.Controls
\since 5.7
- \brief A standard view item that can be used in various views and controls.
+ \brief Basic item delegate that can be used in various views and controls.
\image qtquickcontrols2-itemdelegate.gif
diff --git a/src/quicktemplates2/qquicklabel.cpp b/src/quicktemplates2/qquicklabel.cpp
index b3596022..ebd1755a 100644
--- a/src/quicktemplates2/qquicklabel.cpp
+++ b/src/quicktemplates2/qquicklabel.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup text
- \brief A text label with inherited styling and font.
+ \brief Styled text label with inherited font.
Label extends \l Text with styling and \l {Control::font}{font}
inheritance. The default colors and font are style specific. Label
diff --git a/src/quicktemplates2/qquickmenu.cpp b/src/quicktemplates2/qquickmenu.cpp
index ed2cd7e0..ab5415d3 100644
--- a/src/quicktemplates2/qquickmenu.cpp
+++ b/src/quicktemplates2/qquickmenu.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
\since 5.7
\ingroup qtquickcontrols2-menus
\ingroup qtquickcontrols2-popups
- \brief A menu control that can be used as a context menu or popup menu.
+ \brief Menu popup that can be used as a context menu or popup menu.
\image qtquickcontrols2-menu.png
diff --git a/src/quicktemplates2/qquickmenuitem.cpp b/src/quicktemplates2/qquickmenuitem.cpp
index 902889b0..564d3f38 100644
--- a/src/quicktemplates2/qquickmenuitem.cpp
+++ b/src/quicktemplates2/qquickmenuitem.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-menus
- \brief A menu item within a Menu.
+ \brief Presents an item within a Menu.
MenuItem is a convenience type that implements the AbstractButton API,
providing a familiar way to respond to menu items being \l triggered, for
diff --git a/src/quicktemplates2/qquickpage.cpp b/src/quicktemplates2/qquickpage.cpp
index 432c8c63..ad1e4ebd 100644
--- a/src/quicktemplates2/qquickpage.cpp
+++ b/src/quicktemplates2/qquickpage.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-containers
- \brief A control that makes it convenient to add a header and footer to a page.
+ \brief Styled page control with support for a header and footer.
Page is a container control which makes it convenient to add
a \l header and \l footer item to a page.
@@ -169,6 +169,7 @@ void QQuickPage::setTitle(const QString &title)
return;
d->title = title;
+ setAccessibleName(title);
emit titleChanged();
}
@@ -361,6 +362,15 @@ QAccessible::Role QQuickPage::accessibleRole() const
{
return QAccessible::PageTab;
}
+
+void QQuickPage::accessibilityActiveChanged(bool active)
+{
+ Q_D(QQuickPage);
+ QQuickControl::accessibilityActiveChanged(active);
+
+ if (active)
+ setAccessibleName(d->title);
+}
#endif
QT_END_NAMESPACE
diff --git a/src/quicktemplates2/qquickpage_p.h b/src/quicktemplates2/qquickpage_p.h
index 36ba9fff..6493cee7 100644
--- a/src/quicktemplates2/qquickpage_p.h
+++ b/src/quicktemplates2/qquickpage_p.h
@@ -104,6 +104,7 @@ protected:
#ifndef QT_NO_ACCESSIBILITY
QAccessible::Role accessibleRole() const override;
+ void accessibilityActiveChanged(bool active) override;
#endif
private:
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index 660811bd..fd8d9b51 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -37,9 +37,12 @@
#include "qquickpopup_p.h"
#include "qquickpopup_p_p.h"
#include "qquickapplicationwindow_p.h"
+#include "qquickshortcutcontext_p_p.h"
#include "qquickoverlay_p_p.h"
#include "qquickcontrol_p_p.h"
+#include <QtGui/private/qshortcutmap_p.h>
+#include <QtGui/private/qguiapplication_p.h>
#include <QtQml/qqmlinfo.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/private/qquicktransition_p.h>
@@ -54,16 +57,16 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-popups
- \brief The base type of popup-like user interface controls.
+ \brief Base type of popup-like user interface controls.
Popup is the base type of popup-like user interface controls. It can be
- used with Window or ApplicationWindow.
+ used with \l Window or \l ApplicationWindow.
\qml
import QtQuick.Window 2.2
import QtQuick.Controls 2.1
- Window {
+ ApplicationWindow {
id: window
width: 400
height: 400
@@ -91,8 +94,79 @@ QT_BEGIN_NAMESPACE
scene, it is recommended to use ApplicationWindow. ApplicationWindow also
provides background dimming effects.
- Popup lays out its content in a similar fashion to \l Control. For more
- information, see the \l {Control Layout} section of the documentation.
+ Popup does not provide a layout of its own, but requires you to position
+ its contents, for instance by creating a \l RowLayout or a \l ColumnLayout.
+
+ Items declared as children of a Popup are automatically parented to the
+ Popups's \l contentItem. Items created dynamically need to be explicitly
+ parented to the contentItem.
+
+ \section1 Popup Layout
+
+ The following diagram illustrates the layout of a typical popup:
+
+ \image qtquickcontrols2-popup.png
+
+ The \l implicitWidth and \l implicitHeight of a popup are typically based
+ on the implicit sizes of the background and the content item plus any
+ \l padding. These properties determine how large the popup will be when no
+ explicit \l width or \l height is specified.
+
+ The \l background item fills the entire width and height of the popup,
+ unless an explicit size has been given for it.
+
+ The geometry of the \l contentItem is determined by the \l padding.
+
+ \section1 Popup Sizing
+
+ If only a single item is used within a Popup, it will resize to fit the
+ implicit size of its contained item. This makes it particularly suitable
+ for use together with layouts.
+
+ \code
+ Popup {
+ ColumnLayout {
+ anchors.fill: parent
+ CheckBox { text: qsTr("E-mail") }
+ CheckBox { text: qsTr("Calendar") }
+ CheckBox { text: qsTr("Contacts") }
+ }
+ }
+ \endcode
+
+ Sometimes there might be two items within the popup:
+
+ \code
+ Popup {
+ SwipeView {
+ // ...
+ }
+ PageIndicator {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ }
+ }
+ \endcode
+
+ In this case, Popup cannot calculate a sensible implicit size. Since we're
+ anchoring the \l PageIndicator over the \l SwipeView, we can simply set the
+ content size to the view's implicit size:
+
+ \code
+ Popup {
+ contentWidth: view.implicitWidth
+ contentHeight: view.implicitHeight
+
+ SwipeView {
+ id: view
+ // ...
+ }
+ PageIndicator {
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ }
+ }
+ \endcode
\sa {Popup Controls}, {Customizing Popup}, ApplicationWindow
*/
@@ -364,10 +438,15 @@ public:
QQuickItem *getContentItem() override;
+ int backId;
+ int escapeId;
QQuickPopup *popup;
};
-QQuickPopupItemPrivate::QQuickPopupItemPrivate(QQuickPopup *popup) : popup(popup)
+QQuickPopupItemPrivate::QQuickPopupItemPrivate(QQuickPopup *popup)
+ : backId(0),
+ escapeId(0),
+ popup(popup)
{
isTabFence = true;
}
@@ -418,6 +497,47 @@ void QQuickPopupItem::updatePolish()
return QQuickPopupPrivate::get(d->popup)->reposition();
}
+void QQuickPopupItem::grabShortcut()
+{
+#ifndef QT_NO_SHORTCUT
+ Q_D(QQuickPopupItem);
+ QGuiApplicationPrivate *pApp = QGuiApplicationPrivate::instance();
+ if (!d->backId)
+ d->backId = pApp->shortcutMap.addShortcut(this, Qt::Key_Back, Qt::WindowShortcut, QQuickShortcutContext::matcher);
+ if (!d->escapeId)
+ d->escapeId = pApp->shortcutMap.addShortcut(this, Qt::Key_Escape, Qt::WindowShortcut, QQuickShortcutContext::matcher);
+#endif // QT_NO_SHORTCUT
+}
+
+void QQuickPopupItem::ungrabShortcut()
+{
+#ifndef QT_NO_SHORTCUT
+ Q_D(QQuickPopupItem);
+ QGuiApplicationPrivate *pApp = QGuiApplicationPrivate::instance();
+ if (d->backId) {
+ pApp->shortcutMap.removeShortcut(d->backId, this);
+ d->backId = 0;
+ }
+ if (d->escapeId) {
+ pApp->shortcutMap.removeShortcut(d->escapeId, this);
+ d->escapeId = 0;
+ }
+#endif // QT_NO_SHORTCUT
+}
+
+bool QQuickPopupItem::event(QEvent *event)
+{
+ Q_D(QQuickPopupItem);
+ if (event->type() == QEvent::Shortcut) {
+ QShortcutEvent *se = static_cast<QShortcutEvent *>(event);
+ if (se->shortcutId() == d->escapeId || se->shortcutId() == d->backId) {
+ d->popup->close();
+ return true;
+ }
+ }
+ return QQuickItem::event(event);
+}
+
bool QQuickPopupItem::childMouseEventFilter(QQuickItem *child, QEvent *event)
{
Q_D(QQuickPopupItem);
@@ -545,6 +665,13 @@ QAccessible::Role QQuickPopupItem::accessibleRole() const
Q_D(const QQuickPopupItem);
return d->popup->accessibleRole();
}
+
+void QQuickPopupItem::accessibilityActiveChanged(bool active)
+{
+ Q_D(const QQuickPopupItem);
+ QQuickControl::accessibilityActiveChanged(active);
+ d->popup->accessibilityActiveChanged(active);
+}
#endif // QT_NO_ACCESSIBILITY
QQuickPopupPositioner::QQuickPopupPositioner(QQuickPopupPrivate *popup) :
@@ -858,6 +985,7 @@ QQuickPopup::~QQuickPopup()
{
Q_D(QQuickPopup);
setParentItem(nullptr);
+ d->popupItem->ungrabShortcut();
delete d->popupItem;
}
@@ -1077,8 +1205,9 @@ void QQuickPopup::setImplicitHeight(qreal height)
This property holds the content width. It is used for calculating the
total implicit width of the Popup.
- \note If only a single item is used within the Popup, the implicit width
- of its contained item is used as the content width.
+ For more information, see \l {Popup Sizing}.
+
+ \sa contentHeight
*/
qreal QQuickPopup::contentWidth() const
{
@@ -1102,8 +1231,9 @@ void QQuickPopup::setContentWidth(qreal width)
This property holds the content height. It is used for calculating the
total implicit height of the Popup.
- \note If only a single item is used within the Popup, the implicit height
- of its contained item is used as the content height.
+ For more information, see \l {Popup Sizing}.
+
+ \sa contentWidth
*/
qreal QQuickPopup::contentHeight() const
{
@@ -1505,6 +1635,28 @@ void QQuickPopup::resetLocale()
\qmlproperty font QtQuick.Controls::Popup::font
This property holds the font currently set for the popup.
+
+ Popup propagates explicit font properties to its children. If you change a specific
+ property on a popup's font, that property propagates to all of the popup's children,
+ overriding any system defaults for that property.
+
+ \code
+ Popup {
+ font.family: "Courier"
+
+ Column {
+ Label {
+ text: qsTr("This will use Courier...")
+ }
+
+ Switch {
+ text: qsTr("... and so will this")
+ }
+ }
+ }
+ \endcode
+
+ \sa Control::font, ApplicationWindow::font
*/
QFont QQuickPopup::font() const
{
@@ -1844,7 +1996,10 @@ void QQuickPopup::setVisible(bool visible)
/*!
\qmlproperty real QtQuick.Controls::Popup::opacity
- This property holds the opacity of the popup. The default value is \c 1.0.
+ This property holds the opacity of the popup. Opacity is specified as a number between
+ \c 0.0 (fully transparent) and \c 1.0 (fully opaque). The default value is \c 1.0.
+
+ \sa visible
*/
qreal QQuickPopup::opacity() const
{
@@ -1862,6 +2017,10 @@ void QQuickPopup::setOpacity(qreal opacity)
\qmlproperty real QtQuick.Controls::Popup::scale
This property holds the scale factor of the popup. The default value is \c 1.0.
+
+ A scale of less than \c 1.0 causes the popup to be rendered at a smaller size,
+ and a scale greater than \c 1.0 renders the popup at a larger size. A negative
+ scale causes the popup to be mirrored when rendered.
*/
qreal QQuickPopup::scale() const
{
@@ -1907,6 +2066,12 @@ void QQuickPopup::setClosePolicy(ClosePolicy policy)
if (d->closePolicy == policy)
return;
d->closePolicy = policy;
+ if (isVisible()) {
+ if (policy & QQuickPopup::CloseOnEscape)
+ d->popupItem->grabShortcut();
+ else
+ d->popupItem->ungrabShortcut();
+ }
emit closePolicyChanged();
}
@@ -1937,8 +2102,20 @@ void QQuickPopup::setTransformOrigin(TransformOrigin origin)
/*!
\qmlproperty Transition QtQuick.Controls::Popup::enter
- This property holds the transition that is applied to the content item
+ This property holds the transition that is applied to the popup item
when the popup is opened and enters the screen.
+
+ The following example animates the opacity of the popup when it enters
+ the screen:
+ \code
+ Popup {
+ enter: Transition {
+ NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 }
+ }
+ }
+ \endcode
+
+ \sa exit
*/
QQuickTransition *QQuickPopup::enter() const
{
@@ -1958,8 +2135,20 @@ void QQuickPopup::setEnter(QQuickTransition *transition)
/*!
\qmlproperty Transition QtQuick.Controls::Popup::exit
- This property holds the transition that is applied to the content item
+ This property holds the transition that is applied to the popup item
when the popup is closed and exits the screen.
+
+ The following example animates the opacity of the popup when it exits
+ the screen:
+ \code
+ Popup {
+ exit: Transition {
+ NumberAnimation { property: "opacity"; from: 1.0; to: 0.0 }
+ }
+ }
+ \endcode
+
+ \sa enter
*/
QQuickTransition *QQuickPopup::exit() const
{
@@ -2051,12 +2240,6 @@ void QQuickPopup::keyPressEvent(QKeyEvent *event)
if (hasActiveFocus() && (event->key() == Qt::Key_Tab || event->key() == Qt::Key_Backtab))
QQuickItemPrivate::focusNextPrev(d->popupItem, event->key() == Qt::Key_Tab);
-
- if (event->key() != Qt::Key_Escape && event->key() != Qt::Key_Back)
- return;
-
- if (d->closePolicy.testFlag(CloseOnEscape))
- close();
}
void QQuickPopup::keyReleaseEvent(QKeyEvent *event)
@@ -2153,7 +2336,7 @@ void QQuickPopup::geometryChanged(const QRectF &newGeometry, const QRectF &oldGe
void QQuickPopup::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data)
{
- Q_UNUSED(data);
+ Q_D(QQuickPopup);
switch (change) {
case QQuickItem::ItemActiveFocusHasChanged:
@@ -2162,6 +2345,13 @@ void QQuickPopup::itemChange(QQuickItem::ItemChange change, const QQuickItem::It
case QQuickItem::ItemOpacityHasChanged:
emit opacityChanged();
break;
+ case QQuickItem::ItemVisibleHasChanged:
+ if (isComponentComplete() && d->closePolicy & CloseOnEscape) {
+ if (data.boolValue)
+ d->popupItem->grabShortcut();
+ else
+ d->popupItem->ungrabShortcut();
+ }
default:
break;
}
@@ -2221,8 +2411,37 @@ QAccessible::Role QQuickPopup::accessibleRole() const
{
return QAccessible::LayeredPane;
}
+
+void QQuickPopup::accessibilityActiveChanged(bool active)
+{
+ Q_UNUSED(active);
+}
#endif // QT_NO_ACCESSIBILITY
+QString QQuickPopup::accessibleName() const
+{
+ Q_D(const QQuickPopup);
+ return d->popupItem->accessibleName();
+}
+
+void QQuickPopup::setAccessibleName(const QString &name)
+{
+ Q_D(QQuickPopup);
+ d->popupItem->setAccessibleName(name);
+}
+
+QVariant QQuickPopup::accessibleProperty(const char *propertyName)
+{
+ Q_D(const QQuickPopup);
+ return d->popupItem->accessibleProperty(propertyName);
+}
+
+bool QQuickPopup::setAccessibleProperty(const char *propertyName, const QVariant &value)
+{
+ Q_D(QQuickPopup);
+ return d->popupItem->setAccessibleProperty(propertyName, value);
+}
+
QT_END_NAMESPACE
#include "moc_qquickpopup_p.cpp"
diff --git a/src/quicktemplates2/qquickpopup_p.h b/src/quicktemplates2/qquickpopup_p.h
index de42b793..0cff8fd7 100644
--- a/src/quicktemplates2/qquickpopup_p.h
+++ b/src/quicktemplates2/qquickpopup_p.h
@@ -366,8 +366,15 @@ protected:
#ifndef QT_NO_ACCESSIBILITY
virtual QAccessible::Role accessibleRole() const;
+ virtual void accessibilityActiveChanged(bool active);
#endif
+ QString accessibleName() const;
+ void setAccessibleName(const QString &name);
+
+ QVariant accessibleProperty(const char *propertyName);
+ bool setAccessibleProperty(const char *propertyName, const QVariant &value);
+
private:
Q_DISABLE_COPY(QQuickPopup)
Q_DECLARE_PRIVATE(QQuickPopup)
diff --git a/src/quicktemplates2/qquickpopup_p_p.h b/src/quicktemplates2/qquickpopup_p_p.h
index d3239e91..ca02530e 100644
--- a/src/quicktemplates2/qquickpopup_p_p.h
+++ b/src/quicktemplates2/qquickpopup_p_p.h
@@ -86,9 +86,13 @@ class QQuickPopupItem : public QQuickControl
public:
explicit QQuickPopupItem(QQuickPopup *popup);
+ void grabShortcut();
+ void ungrabShortcut();
+
protected:
void updatePolish() override;
+ bool event(QEvent *event) override;
bool childMouseEventFilter(QQuickItem *child, QEvent *event) override;
void focusInEvent(QFocusEvent *event) override;
void focusOutEvent(QFocusEvent *event) override;
@@ -113,6 +117,7 @@ protected:
#ifndef QT_NO_ACCESSIBILITY
QAccessible::Role accessibleRole() const override;
+ void accessibilityActiveChanged(bool active) override;
#endif
private:
diff --git a/src/quicktemplates2/qquickprogressbar.cpp b/src/quicktemplates2/qquickprogressbar.cpp
index 7bf30318..5d5503e6 100644
--- a/src/quicktemplates2/qquickprogressbar.cpp
+++ b/src/quicktemplates2/qquickprogressbar.cpp
@@ -59,6 +59,30 @@ QT_BEGIN_NAMESPACE
}
\endcode
+ ProgressBar also supports a special \l indeterminate mode, which is useful,
+ for example, when unable to determine the size of the item being downloaded,
+ or if the download progress gets interrupted due to a network disconnection.
+
+ \image qtquickcontrols2-progressbar-indeterminate.gif
+
+ \code
+ ProgressBar {
+ indeterminate: true
+ }
+ \endcode
+
+ The indeterminate mode is similar to a \l BusyIndicator. Both can be used
+ to indicate background activity. The main difference is visual, and that
+ ProgressBar can also present a concrete amount of progress (when it can be
+ determined). Due to the visual difference, indeterminate progress bars and
+ busy indicators fit different places in user interfaces. Typical places for
+ an indeterminate progress bar:
+ \list
+ \li at the bottom of a \l ToolBar
+ \li inline within the content of a \l Page
+ \li in an \l ItemDelegate to show the progress of a particular item
+ \endlist
+
\sa {Customizing ProgressBar}, BusyIndicator, {Indicator Controls}
*/
diff --git a/src/quicktemplates2/qquickradiobutton.cpp b/src/quicktemplates2/qquickradiobutton.cpp
index a8d11377..acddb50d 100644
--- a/src/quicktemplates2/qquickradiobutton.cpp
+++ b/src/quicktemplates2/qquickradiobutton.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-buttons
- \brief An option button that can be toggled on or off.
+ \brief Exclusive radio button that can be toggled on or off.
\image qtquickcontrols2-radiobutton.gif
diff --git a/src/quicktemplates2/qquickradiodelegate.cpp b/src/quicktemplates2/qquickradiodelegate.cpp
index bf3557e8..4580dcf2 100644
--- a/src/quicktemplates2/qquickradiodelegate.cpp
+++ b/src/quicktemplates2/qquickradiodelegate.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-delegates
- \brief An item delegate that can be checked or unchecked.
+ \brief Exclusive item delegate with a radio indicator that can be toggled on or off.
\image qtquickcontrols2-radiodelegate.gif
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp
index 3caf5042..219292c8 100644
--- a/src/quicktemplates2/qquickrangeslider.cpp
+++ b/src/quicktemplates2/qquickrangeslider.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-input
- \brief A slider control used to select a range of values.
+ \brief Used to select a range of values by sliding two handles along a track.
\image qtquickcontrols2-rangeslider.gif
diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp
index 06cc8832..5df4c4fb 100644
--- a/src/quicktemplates2/qquickscrollbar.cpp
+++ b/src/quicktemplates2/qquickscrollbar.cpp
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-indicators
- \brief An interactive scroll bar control.
+ \brief Vertical or horizontal interactive scroll bar.
\image qtquickcontrols2-scrollbar.gif
diff --git a/src/quicktemplates2/qquickscrollindicator.cpp b/src/quicktemplates2/qquickscrollindicator.cpp
index 6145a5b3..d6370d2d 100644
--- a/src/quicktemplates2/qquickscrollindicator.cpp
+++ b/src/quicktemplates2/qquickscrollindicator.cpp
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-indicators
- \brief A non-interactive scroll indicator control.
+ \brief Vertical or horizontal non-interactive scroll indicator.
\image qtquickcontrols2-scrollindicator.gif
diff --git a/src/quicktemplates2/qquickshortcutcontext.cpp b/src/quicktemplates2/qquickshortcutcontext.cpp
new file mode 100644
index 00000000..04aa4f4d
--- /dev/null
+++ b/src/quicktemplates2/qquickshortcutcontext.cpp
@@ -0,0 +1,83 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Templates 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$
+**
+****************************************************************************/
+
+#include "qquickshortcutcontext_p_p.h"
+#include "qquickoverlay_p_p.h"
+#include "qquickpopup_p.h"
+
+#include <QtGui/qguiapplication.h>
+
+QT_BEGIN_NAMESPACE
+
+static bool isBlockedByPopup(QQuickItem *item)
+{
+ if (!item || !item->window())
+ return false;
+
+ QQuickOverlay *overlay = QQuickOverlay::overlay(item->window());
+ const auto popups = QQuickOverlayPrivate::get(overlay)->stackingOrderPopups();
+ for (QQuickPopup *popup : popups) {
+ if (popup->isModal() || popup->closePolicy() & QQuickPopup::CloseOnEscape)
+ return item != popup->popupItem() && !popup->popupItem()->isAncestorOf(item);
+ }
+
+ return false;
+}
+
+bool QQuickShortcutContext::matcher(QObject *obj, Qt::ShortcutContext context)
+{
+ QQuickItem *item = nullptr;
+ switch (context) {
+ case Qt::ApplicationShortcut:
+ return true;
+ case Qt::WindowShortcut:
+ while (obj && !obj->isWindowType()) {
+ obj = obj->parent();
+ item = qobject_cast<QQuickItem *>(obj);
+ if (item) {
+ obj = item->window();
+ } else if (QQuickPopup *popup = qobject_cast<QQuickPopup *>(obj)) {
+ obj = popup->window();
+ item = popup->popupItem();
+ }
+ }
+ return obj && obj == QGuiApplication::focusWindow() && !isBlockedByPopup(item);
+ default:
+ return false;
+ }
+}
+
+QT_END_NAMESPACE
diff --git a/src/quicktemplates2/qquickshortcutcontext_p_p.h b/src/quicktemplates2/qquickshortcutcontext_p_p.h
new file mode 100644
index 00000000..3866dfd8
--- /dev/null
+++ b/src/quicktemplates2/qquickshortcutcontext_p_p.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Templates 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$
+**
+****************************************************************************/
+
+#ifndef QQUICKSHORTCUTCONTEXT_P_P_H
+#define QQUICKSHORTCUTCONTEXT_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qnamespace.h>
+#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
+
+QT_BEGIN_NAMESPACE
+
+class QObject;
+
+struct Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickShortcutContext
+{
+ static bool matcher(QObject *object, Qt::ShortcutContext context);
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKSHORTCUTCONTEXT_P_P_H
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp
index 63fc50ac..30910906 100644
--- a/src/quicktemplates2/qquickslider.cpp
+++ b/src/quicktemplates2/qquickslider.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-input
- \brief Selects a value by sliding a handle along a track.
+ \brief Used to select a value by sliding a handle along a track.
\image qtquickcontrols2-slider.gif
diff --git a/src/quicktemplates2/qquickspinbox.cpp b/src/quicktemplates2/qquickspinbox.cpp
index ec801b1a..957200a4 100644
--- a/src/quicktemplates2/qquickspinbox.cpp
+++ b/src/quicktemplates2/qquickspinbox.cpp
@@ -57,7 +57,7 @@ static const int AUTO_REPEAT_INTERVAL = 100;
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup input
- \brief A spinbox control that allows the user to select from a set of preset values.
+ \brief Allows the user to select from a set of preset values.
\image qtquickcontrols2-spinbox.png
@@ -430,7 +430,16 @@ void QQuickSpinBox::setEditable(bool editable)
This property holds the input text validator for editable spinboxes. By
default, SpinBox uses \l IntValidator to accept input of integer numbers.
- \snippet SpinBox.qml validator
+ \code
+ SpinBox {
+ id: control
+ validator: IntValidator {
+ locale: control.locale.name
+ bottom: Math.min(control.from, control.to)
+ top: Math.max(control.from, control.to)
+ }
+ }
+ \endcode
\sa editable, textFromValue, valueFromText, {Control::locale}{locale}
*/
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp
index ef7f6ed5..fe678b80 100644
--- a/src/quicktemplates2/qquickswipedelegate.cpp
+++ b/src/quicktemplates2/qquickswipedelegate.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-delegates
- \brief A swipable item delegate.
+ \brief Swipable item delegate.
SwipeDelegate presents a view item that can be swiped left or right to
expose more options or information. It is used as a delegate in views such
@@ -818,13 +818,13 @@ QQuickSwipeDelegate::QQuickSwipeDelegate(QQuickItem *parent) :
\li Description
\row
\li position
- \li This property holds the position of the swipe relative to either
+ \li This read-only property holds the position of the swipe relative to either
side of the control. When this value reaches either
\c -1.0 (left side) or \c 1.0 (right side) and the mouse button is
released, \c complete will be \c true.
\row
\li complete
- \li This property holds whether the control is fully exposed after
+ \li This read-only property holds whether the control is fully exposed after
having been swiped to the left or right.
When complete is \c true, any interactive items declared in \c left,
@@ -860,19 +860,19 @@ QQuickSwipeDelegate::QQuickSwipeDelegate(QQuickItem *parent) :
\include qquickswipedelegate-interaction.qdocinc
\row
\li leftItem
- \li This property holds the item instantiated from the \c left component.
+ \li This read-only property holds the item instantiated from the \c left component.
If \c left has not been set, or the position hasn't changed since
creation of the SwipeDelegate, this property will be \c null.
\row
\li behindItem
- \li This property holds the item instantiated from the \c behind component.
+ \li This read-only property holds the item instantiated from the \c behind component.
If \c behind has not been set, or the position hasn't changed since
creation of the SwipeDelegate, this property will be \c null.
\row
\li rightItem
- \li This property holds the item instantiated from the \c right component.
+ \li This read-only property holds the item instantiated from the \c right component.
If \c right has not been set, or the position hasn't changed since
creation of the SwipeDelegate, this property will be \c null.
diff --git a/src/quicktemplates2/qquickswipeview.cpp b/src/quicktemplates2/qquickswipeview.cpp
index a3f52edd..a044169a 100644
--- a/src/quicktemplates2/qquickswipeview.cpp
+++ b/src/quicktemplates2/qquickswipeview.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
SwipeView provides a swipe-based navigation model.
- \image qtquickcontrols2-swipeview-wireframe.png
+ \image qtquickcontrols2-swipeview.gif
SwipeView is populated with a set of pages. One page is visible at a time.
The user can navigate between the pages by swiping sideways. Notice that
diff --git a/src/quicktemplates2/qquickswitch.cpp b/src/quicktemplates2/qquickswitch.cpp
index 8c3d9f0b..fa08a1d8 100644
--- a/src/quicktemplates2/qquickswitch.cpp
+++ b/src/quicktemplates2/qquickswitch.cpp
@@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-buttons
- \brief An option button that can be toggled on or off.
+ \brief Switch button that can be toggled on or off.
\image qtquickcontrols2-switch.gif
diff --git a/src/quicktemplates2/qquickswitchdelegate.cpp b/src/quicktemplates2/qquickswitchdelegate.cpp
index edfb15d5..81e282d9 100644
--- a/src/quicktemplates2/qquickswitchdelegate.cpp
+++ b/src/quicktemplates2/qquickswitchdelegate.cpp
@@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-delegates
- \brief An item delegate that can be toggled on or off.
+ \brief Item delegate with a switch indicator that can be toggled on or off.
\image qtquickcontrols2-switchdelegate.gif
diff --git a/src/quicktemplates2/qquicktabbar.cpp b/src/quicktemplates2/qquicktabbar.cpp
index ddcf7b12..9aead901 100644
--- a/src/quicktemplates2/qquicktabbar.cpp
+++ b/src/quicktemplates2/qquicktabbar.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\since 5.7
\ingroup qtquickcontrols2-navigation
\ingroup qtquickcontrols2-containers
- \brief A bar with icons allowing to switch between different views or subtasks.
+ \brief Allows the user to switch between different views or subtasks.
TabBar provides a tab-based navigation model.
@@ -60,6 +60,13 @@ QT_BEGIN_NAMESPACE
\snippet qtquickcontrols2-tabbar.qml 1
+ As shown above, TabBar is typically populated with a static set of tab buttons
+ that are defined inline as children of the tab bar. It is also possible to
+ \l {Container::addItem()}{add}, \l {Container::insertItem()}{insert},
+ \l {Container::moveItem()}{move}, and \l {Container::removeItem()}{remove}
+ items dynamically at run time. The items can be accessed using
+ \l {Container::}{itemAt()} or \l {Container::}{contentChildren}.
+
\section2 Resizing Tabs
By default, TabBar resizes its buttons to fit the width of the control.
@@ -176,8 +183,8 @@ QQuickTabBar::QQuickTabBar(QQuickItem *parent) :
This property holds the position of the tab bar.
- \note If the tab bar is assigned as a header or footer of ApplicationWindow
- or Page, the appropriate position is set automatically.
+ \note If the tab bar is assigned as a header or footer of \l ApplicationWindow
+ or \l Page, the appropriate position is set automatically.
Possible values:
\value TabBar.Header The tab bar is at the top, as a window or page header.
diff --git a/src/quicktemplates2/qquicktabbutton.cpp b/src/quicktemplates2/qquicktabbutton.cpp
index 3f097947..b5cbdd12 100644
--- a/src/quicktemplates2/qquicktabbutton.cpp
+++ b/src/quicktemplates2/qquicktabbutton.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-navigation
- \brief A tab button control that can be used in a TabBar.
+ \brief Button with a look suitable for a TabBar.
\image qtquickcontrols2-tabbutton.png
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp
index 7d15a428..56a538ee 100644
--- a/src/quicktemplates2/qquicktextarea.cpp
+++ b/src/quicktemplates2/qquicktextarea.cpp
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-input
- \brief A multi line text input control.
+ \brief Multi-line text input area.
TextArea is a multi-line text editor. TextArea extends TextEdit with
a \l {placeholderText}{placeholder text} functionality, and adds decoration.
diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp
index 85712865..2bb902a1 100644
--- a/src/quicktemplates2/qquicktextfield.cpp
+++ b/src/quicktemplates2/qquicktextfield.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-input
- \brief A single line text input control.
+ \brief Single-line text input field.
TextField is a single line text editor. TextField extends TextInput with
a \l {placeholderText}{placeholder text} functionality, and adds decoration.
diff --git a/src/quicktemplates2/qquicktoolbar.cpp b/src/quicktemplates2/qquicktoolbar.cpp
index 5a767c73..12ecb702 100644
--- a/src/quicktemplates2/qquicktoolbar.cpp
+++ b/src/quicktemplates2/qquicktoolbar.cpp
@@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-containers
- \brief A container for context-sensitive controls.
+ \brief Container for context-sensitive controls.
ToolBar is a container of application-wide and context sensitive
actions and controls, such as navigation buttons and search fields.
@@ -69,14 +69,19 @@ QT_BEGIN_NAMESPACE
RowLayout {
anchors.fill: parent
ToolButton {
- text: qsTr("\u25C0 %1").arg(Qt.application.name)
- enabled: stack.depth > 1
+ text: qsTr("‹")
onClicked: stack.pop()
}
- Item { Layout.fillWidth: true }
- Switch {
- checked: true
- text: qsTr("Notifications")
+ Label {
+ text: "Title"
+ elide: Label.ElideRight
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ Layout.fillWidth: true
+ }
+ ToolButton {
+ text: qsTr("⋮")
+ onClicked: menu.open()
}
}
}
diff --git a/src/quicktemplates2/qquicktoolbutton.cpp b/src/quicktemplates2/qquicktoolbutton.cpp
index c1f47b97..e8827b4c 100644
--- a/src/quicktemplates2/qquicktoolbutton.cpp
+++ b/src/quicktemplates2/qquicktoolbutton.cpp
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-buttons
- \brief A button with a layout suitable for a ToolBar.
+ \brief Button with a look suitable for a ToolBar.
ToolButton is functionally similar to \l Button, but provides a look that
is more suitable within a \l ToolBar.
@@ -57,6 +57,10 @@ QT_BEGIN_NAMESPACE
\snippet qtquickcontrols2-toolbar.qml 1
+ ToolButton inherits its API from AbstractButton. For instance, you can set
+ \l {AbstractButton::text}{text}, 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 c05f5a0b..b60dec22 100644
--- a/src/quicktemplates2/qquicktooltip.cpp
+++ b/src/quicktemplates2/qquicktooltip.cpp
@@ -62,6 +62,8 @@ QT_BEGIN_NAMESPACE
\image qtquickcontrols2-tooltip.png
+ \section2 Attached Tool Tips
+
The most straight-forward way to setup tool tips for controls is to
specify \l text and \l {visible}{visibility} via attached properties.
The following example illustrates this approach:
@@ -186,6 +188,7 @@ void QQuickToolTip::setText(const QString &text)
return;
d->text = text;
+ setAccessibleName(text);
emit textChanged();
}
@@ -305,6 +308,15 @@ QAccessible::Role QQuickToolTip::accessibleRole() const
{
return QAccessible::ToolTip;
}
+
+void QQuickToolTip::accessibilityActiveChanged(bool active)
+{
+ Q_D(QQuickToolTip);
+ QQuickPopup::accessibilityActiveChanged(active);
+
+ if (active)
+ setAccessibleName(d->text);
+}
#endif
class QQuickToolTipAttachedPrivate : public QObjectPrivate
@@ -358,6 +370,8 @@ QQuickToolTipAttached::QQuickToolTipAttached(QObject *parent) :
This attached property holds the text of the shared tool tip.
The property can be attached to any item.
+
+ \sa {Attached Tool Tips}
*/
QString QQuickToolTipAttached::text() const
{
@@ -384,7 +398,7 @@ void QQuickToolTipAttached::setText(const QString &text)
This attached property holds the delay (milliseconds) of the shared tool tip.
The property can be attached to any item.
- \sa {Delay and Timeout}
+ \sa {Attached Tool Tips}, {Delay and Timeout}
*/
int QQuickToolTipAttached::delay() const
{
@@ -411,7 +425,7 @@ void QQuickToolTipAttached::setDelay(int delay)
This attached property holds the timeout (milliseconds) of the shared tool tip.
The property can be attached to any item.
- \sa {Delay and Timeout}
+ \sa {Attached Tool Tips}, {Delay and Timeout}
*/
int QQuickToolTipAttached::timeout() const
{
@@ -437,6 +451,8 @@ void QQuickToolTipAttached::setTimeout(int timeout)
This attached property holds whether the shared tool tip is visible.
The property can be attached to any item.
+
+ \sa {Attached Tool Tips}
*/
bool QQuickToolTipAttached::isVisible() const
{
@@ -462,6 +478,8 @@ void QQuickToolTipAttached::setVisible(bool visible)
This attached property holds the shared tool tip instance. The property
can be attached to any item.
+
+ \sa {Attached Tool Tips}
*/
QQuickToolTip *QQuickToolTipAttached::toolTip() const
{
@@ -474,6 +492,8 @@ QQuickToolTip *QQuickToolTipAttached::toolTip() const
This attached method shows the shared tooltip with \a text and \a timeout (milliseconds).
The method can be attached to any item.
+
+ \sa {Attached Tool Tips}
*/
void QQuickToolTipAttached::show(const QString &text, int ms)
{
@@ -495,6 +515,8 @@ void QQuickToolTipAttached::show(const QString &text, int ms)
\qmlattachedmethod void QtQuick.Controls::ToolTip::hide()
This attached method hides the shared tooltip. The method can be attached to any item.
+
+ \sa {Attached Tool Tips}
*/
void QQuickToolTipAttached::hide()
{
diff --git a/src/quicktemplates2/qquicktooltip_p.h b/src/quicktemplates2/qquicktooltip_p.h
index d9f41f80..3be9214b 100644
--- a/src/quicktemplates2/qquicktooltip_p.h
+++ b/src/quicktemplates2/qquicktooltip_p.h
@@ -92,6 +92,7 @@ protected:
#ifndef QT_NO_ACCESSIBILITY
QAccessible::Role accessibleRole() const override;
+ void accessibilityActiveChanged(bool active) override;
#endif
private:
diff --git a/src/quicktemplates2/qquicktumbler.cpp b/src/quicktemplates2/qquicktumbler.cpp
index 49a9c087..cf5df27a 100644
--- a/src/quicktemplates2/qquicktumbler.cpp
+++ b/src/quicktemplates2/qquicktumbler.cpp
@@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE
\inqmlmodule QtQuick.Controls
\since 5.7
\ingroup qtquickcontrols2-input
- \brief A spinnable wheel of items that can be selected.
+ \brief Spinnable wheel of items that can be selected.
\image qtquickcontrols2-tumbler-wrap.gif
diff --git a/src/quicktemplates2/quicktemplates2.pri b/src/quicktemplates2/quicktemplates2.pri
index 0d6a0e5a..939d2f0e 100644
--- a/src/quicktemplates2/quicktemplates2.pri
+++ b/src/quicktemplates2/quicktemplates2.pri
@@ -50,6 +50,7 @@ HEADERS += \
$$PWD/qquickroundbutton_p.h \
$$PWD/qquickscrollbar_p.h \
$$PWD/qquickscrollindicator_p.h \
+ $$PWD/qquickshortcutcontext_p_p.h \
$$PWD/qquickslider_p.h \
$$PWD/qquickspinbox_p.h \
$$PWD/qquickstackview_p.h \
@@ -108,6 +109,7 @@ SOURCES += \
$$PWD/qquickroundbutton.cpp \
$$PWD/qquickscrollbar.cpp \
$$PWD/qquickscrollindicator.cpp \
+ $$PWD/qquickshortcutcontext.cpp \
$$PWD/qquickslider.cpp \
$$PWD/qquickspinbox.cpp \
$$PWD/qquickstackview.cpp \
diff --git a/tests/auto/accessibility/data/busyindicator.qml b/tests/auto/accessibility/data/busyindicator.qml
index 6806d64b..5a1cf54a 100644
--- a/tests/auto/accessibility/data/busyindicator.qml
+++ b/tests/auto/accessibility/data/busyindicator.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- BusyIndicator {
- id: busyindicator
- objectName: "busyindicator"
- }
-}
+BusyIndicator { }
diff --git a/tests/auto/accessibility/data/button.qml b/tests/auto/accessibility/data/button.qml
index 100da3d4..ecaba6cc 100644
--- a/tests/auto/accessibility/data/button.qml
+++ b/tests/auto/accessibility/data/button.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Button {
- id: button
- objectName: "button"
- text: "Button"
- }
+Button {
+ text: "Button"
}
diff --git a/tests/auto/accessibility/data/checkbox.qml b/tests/auto/accessibility/data/checkbox.qml
index fcd4628c..cb46c074 100644
--- a/tests/auto/accessibility/data/checkbox.qml
+++ b/tests/auto/accessibility/data/checkbox.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- CheckBox {
- id: checkbox
- objectName: "checkbox"
- text: "CheckBox"
- }
+CheckBox {
+ text: "CheckBox"
}
diff --git a/tests/auto/accessibility/data/checkdelegate.qml b/tests/auto/accessibility/data/checkdelegate.qml
new file mode 100644
index 00000000..f911caf0
--- /dev/null
+++ b/tests/auto/accessibility/data/checkdelegate.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+CheckDelegate {
+ text: "CheckDelegate"
+}
diff --git a/tests/auto/accessibility/data/combobox.qml b/tests/auto/accessibility/data/combobox.qml
new file mode 100644
index 00000000..52931968
--- /dev/null
+++ b/tests/auto/accessibility/data/combobox.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+ComboBox {
+ model: ["ComboBox"]
+}
diff --git a/tests/auto/accessibility/data/control.qml b/tests/auto/accessibility/data/control.qml
index d177e7e3..a8fd0613 100644
--- a/tests/auto/accessibility/data/control.qml
+++ b/tests/auto/accessibility/data/control.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Control {
- id: control
- objectName: "control"
- }
-}
+Control { }
diff --git a/tests/auto/accessibility/data/dayofweekrow-2.qml b/tests/auto/accessibility/data/dayofweekrow-2.qml
index 26569836..265f975a 100644
--- a/tests/auto/accessibility/data/dayofweekrow-2.qml
+++ b/tests/auto/accessibility/data/dayofweekrow-2.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import Qt.labs.calendar 1.0
-Window {
- visible: true
-
- DayOfWeekRow {
- id: dayofweekrow
- objectName: "dayofweekrow"
- }
-}
+DayOfWeekRow { }
diff --git a/tests/auto/accessibility/data/dayofweekrow.qml b/tests/auto/accessibility/data/dayofweekrow.qml
index c799aba1..a3ab92dd 100644
--- a/tests/auto/accessibility/data/dayofweekrow.qml
+++ b/tests/auto/accessibility/data/dayofweekrow.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import Qt.labs.calendar 1.0
-Window {
- visible: true
-
- DayOfWeekRow {
- id: dayofweekrow
- objectName: "dayofweekrow"
- Accessible.name: "DayOfWeekRow"
- }
+DayOfWeekRow {
+ Accessible.name: "DayOfWeekRow"
}
diff --git a/tests/auto/accessibility/data/dial.qml b/tests/auto/accessibility/data/dial.qml
index 4725d557..354ccdbd 100644
--- a/tests/auto/accessibility/data/dial.qml
+++ b/tests/auto/accessibility/data/dial.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Dial {
- id: dial
- objectName: "dial"
- }
-}
+Dial { }
diff --git a/tests/auto/accessibility/data/dialog.qml b/tests/auto/accessibility/data/dialog.qml
index df0257e8..46a96f2e 100644
--- a/tests/auto/accessibility/data/dialog.qml
+++ b/tests/auto/accessibility/data/dialog.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Dialog {
- id: dialog
- objectName: "dialog"
- }
-}
+Dialog { }
diff --git a/tests/auto/accessibility/data/frame.qml b/tests/auto/accessibility/data/frame.qml
new file mode 100644
index 00000000..6a2ec40e
--- /dev/null
+++ b/tests/auto/accessibility/data/frame.qml
@@ -0,0 +1,4 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+Frame { }
diff --git a/tests/auto/accessibility/data/groupbox.qml b/tests/auto/accessibility/data/groupbox.qml
new file mode 100644
index 00000000..ebb3cf7d
--- /dev/null
+++ b/tests/auto/accessibility/data/groupbox.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+GroupBox {
+ title: "GroupBox"
+}
diff --git a/tests/auto/accessibility/data/itemdelegate.qml b/tests/auto/accessibility/data/itemdelegate.qml
new file mode 100644
index 00000000..91e1d910
--- /dev/null
+++ b/tests/auto/accessibility/data/itemdelegate.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+ItemDelegate {
+ text: "ItemDelegate"
+}
diff --git a/tests/auto/accessibility/data/label.qml b/tests/auto/accessibility/data/label.qml
index 4904bb41..e799f8de 100644
--- a/tests/auto/accessibility/data/label.qml
+++ b/tests/auto/accessibility/data/label.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Label {
- id: label
- objectName: "label"
- text: "Label"
- }
+Label {
+ text: "Label"
}
diff --git a/tests/auto/accessibility/data/menu.qml b/tests/auto/accessibility/data/menu.qml
index 589f4aaf..b931644a 100644
--- a/tests/auto/accessibility/data/menu.qml
+++ b/tests/auto/accessibility/data/menu.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Menu {
- id: menu
- objectName: "menu"
- }
-}
+Menu { }
diff --git a/tests/auto/accessibility/data/menuitem.qml b/tests/auto/accessibility/data/menuitem.qml
new file mode 100644
index 00000000..308c1c2b
--- /dev/null
+++ b/tests/auto/accessibility/data/menuitem.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+MenuItem {
+ text: "MenuItem"
+}
diff --git a/tests/auto/accessibility/data/monthgrid-2.qml b/tests/auto/accessibility/data/monthgrid-2.qml
index 76af6646..603a208b 100644
--- a/tests/auto/accessibility/data/monthgrid-2.qml
+++ b/tests/auto/accessibility/data/monthgrid-2.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import Qt.labs.calendar 1.0
-Window {
- visible: true
-
- MonthGrid {
- id: monthgrid
- objectName: "monthgrid"
- title: "MonthGrid"
- }
+MonthGrid {
+ title: "MonthGrid"
}
diff --git a/tests/auto/accessibility/data/monthgrid.qml b/tests/auto/accessibility/data/monthgrid.qml
index 7c8d6451..92a45f0f 100644
--- a/tests/auto/accessibility/data/monthgrid.qml
+++ b/tests/auto/accessibility/data/monthgrid.qml
@@ -1,14 +1,7 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import Qt.labs.calendar 1.0
-Window {
- visible: true
-
- MonthGrid {
- id: monthgrid
- objectName: "monthgrid"
- title: "MonthGrid"
- Accessible.name: title
- }
+MonthGrid {
+ title: "MonthGrid"
+ Accessible.name: title
}
diff --git a/tests/auto/accessibility/data/page.qml b/tests/auto/accessibility/data/page.qml
new file mode 100644
index 00000000..cda7b80b
--- /dev/null
+++ b/tests/auto/accessibility/data/page.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+Page {
+ title: "Page"
+}
diff --git a/tests/auto/accessibility/data/pageindicator.qml b/tests/auto/accessibility/data/pageindicator.qml
index 666414e7..a882296e 100644
--- a/tests/auto/accessibility/data/pageindicator.qml
+++ b/tests/auto/accessibility/data/pageindicator.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- PageIndicator {
- id: pageindicator
- objectName: "pageindicator"
- }
-}
+PageIndicator { }
diff --git a/tests/auto/accessibility/data/pane.qml b/tests/auto/accessibility/data/pane.qml
new file mode 100644
index 00000000..24856e26
--- /dev/null
+++ b/tests/auto/accessibility/data/pane.qml
@@ -0,0 +1,4 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+Pane { }
diff --git a/tests/auto/accessibility/data/popup.qml b/tests/auto/accessibility/data/popup.qml
index 47e8a04a..e1d9f8ff 100644
--- a/tests/auto/accessibility/data/popup.qml
+++ b/tests/auto/accessibility/data/popup.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Popup {
- id: popup
- objectName: "popup"
- }
-}
+Popup { }
diff --git a/tests/auto/accessibility/data/progressbar.qml b/tests/auto/accessibility/data/progressbar.qml
index 23cb3731..c8733d5d 100644
--- a/tests/auto/accessibility/data/progressbar.qml
+++ b/tests/auto/accessibility/data/progressbar.qml
@@ -1,15 +1,8 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- ProgressBar {
- id: progressbar
- objectName: "progressbar"
- from: 0
- to: 100
- value: 50
- }
+ProgressBar {
+ from: 0
+ to: 100
+ value: 50
}
diff --git a/tests/auto/accessibility/data/radiobutton.qml b/tests/auto/accessibility/data/radiobutton.qml
index e36944cd..1ca431f5 100644
--- a/tests/auto/accessibility/data/radiobutton.qml
+++ b/tests/auto/accessibility/data/radiobutton.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- RadioButton {
- id: radiobutton
- objectName: "radiobutton"
- text: "RadioButton"
- }
+RadioButton {
+ text: "RadioButton"
}
diff --git a/tests/auto/accessibility/data/rangeslider.qml b/tests/auto/accessibility/data/rangeslider.qml
index ac173034..76736fb8 100644
--- a/tests/auto/accessibility/data/rangeslider.qml
+++ b/tests/auto/accessibility/data/rangeslider.qml
@@ -1,18 +1,11 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- RangeSlider {
- id: rangeSlider
- objectName: "rangeslider"
- from: 0
- to: 100
- first.value: 25
- second.value: 75
- stepSize: 1
- orientation: "Horizontal"
- }
+RangeSlider {
+ from: 0
+ to: 100
+ first.value: 25
+ second.value: 75
+ stepSize: 1
+ orientation: Qt.Horizontal
}
diff --git a/tests/auto/accessibility/data/scrollbar.qml b/tests/auto/accessibility/data/scrollbar.qml
index f20bca0a..1420ed19 100644
--- a/tests/auto/accessibility/data/scrollbar.qml
+++ b/tests/auto/accessibility/data/scrollbar.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- ScrollBar {
- id: scrollbar
- objectName: "scrollbar"
- }
-}
+ScrollBar { }
diff --git a/tests/auto/accessibility/data/scrollindicator.qml b/tests/auto/accessibility/data/scrollindicator.qml
index 7d2d5532..34e429ad 100644
--- a/tests/auto/accessibility/data/scrollindicator.qml
+++ b/tests/auto/accessibility/data/scrollindicator.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- ScrollIndicator {
- id: scrollindicator
- objectName: "scrollindicator"
- }
-}
+ScrollIndicator { }
diff --git a/tests/auto/accessibility/data/slider.qml b/tests/auto/accessibility/data/slider.qml
index 565d98a9..088bd23a 100644
--- a/tests/auto/accessibility/data/slider.qml
+++ b/tests/auto/accessibility/data/slider.qml
@@ -1,17 +1,10 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Slider {
- id: slider
- objectName: "slider"
- from: 0
- to: 100
- value: 50
- stepSize: 1
- orientation: "Horizontal"
- }
+Slider {
+ from: 0
+ to: 100
+ value: 50
+ stepSize: 1
+ orientation: Qt.Horizontal
}
diff --git a/tests/auto/accessibility/data/spinbox.qml b/tests/auto/accessibility/data/spinbox.qml
index 9a0ab5ef..07e2a54e 100644
--- a/tests/auto/accessibility/data/spinbox.qml
+++ b/tests/auto/accessibility/data/spinbox.qml
@@ -1,16 +1,9 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- SpinBox {
- id: spinbox
- objectName: "spinbox"
- from: 0
- to: 100
- value: 50
- stepSize: 1
- }
+SpinBox {
+ from: 0
+ to: 100
+ value: 50
+ stepSize: 1
}
diff --git a/tests/auto/accessibility/data/switch.qml b/tests/auto/accessibility/data/switch.qml
index 17315096..0678f113 100644
--- a/tests/auto/accessibility/data/switch.qml
+++ b/tests/auto/accessibility/data/switch.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- Switch {
- //id: switch
- objectName: "switch"
- text: "Switch"
- }
+Switch {
+ text: "Switch"
}
diff --git a/tests/auto/accessibility/data/switchdelegate.qml b/tests/auto/accessibility/data/switchdelegate.qml
new file mode 100644
index 00000000..fba0c321
--- /dev/null
+++ b/tests/auto/accessibility/data/switchdelegate.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+SwitchDelegate {
+ text: "SwitchDelegate"
+}
diff --git a/tests/auto/accessibility/data/tabbar.qml b/tests/auto/accessibility/data/tabbar.qml
index 692e6b2c..209a094f 100644
--- a/tests/auto/accessibility/data/tabbar.qml
+++ b/tests/auto/accessibility/data/tabbar.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- TabBar {
- id: tabbar
- objectName: "tabbar"
- }
-}
+TabBar { }
diff --git a/tests/auto/accessibility/data/tabbutton.qml b/tests/auto/accessibility/data/tabbutton.qml
index c5fe646f..c76e9048 100644
--- a/tests/auto/accessibility/data/tabbutton.qml
+++ b/tests/auto/accessibility/data/tabbutton.qml
@@ -1,17 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- TabBar {
- id: tabbar
- objectName: "TabBar"
- TabButton {
- id: tabbutton
- objectName: "tabbutton"
- text: "TabButton"
- }
- }
+TabButton {
+ text: "TabButton"
}
diff --git a/tests/auto/accessibility/data/textarea.qml b/tests/auto/accessibility/data/textarea.qml
index 7c4aa977..1ffe366f 100644
--- a/tests/auto/accessibility/data/textarea.qml
+++ b/tests/auto/accessibility/data/textarea.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- TextArea {
- id: textarea
- objectName: "textarea"
- text: "TextArea"
- }
+TextArea {
+ text: "TextArea"
}
diff --git a/tests/auto/accessibility/data/textfield.qml b/tests/auto/accessibility/data/textfield.qml
index 7c7cd009..f87957eb 100644
--- a/tests/auto/accessibility/data/textfield.qml
+++ b/tests/auto/accessibility/data/textfield.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- TextField {
- id: textfield
- objectName: "textfield"
- text: "TextField"
- }
+TextField {
+ text: "TextField"
}
diff --git a/tests/auto/accessibility/data/toolbar.qml b/tests/auto/accessibility/data/toolbar.qml
index 51ba454c..e1887de4 100644
--- a/tests/auto/accessibility/data/toolbar.qml
+++ b/tests/auto/accessibility/data/toolbar.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- ToolBar {
- id: toolbar
- objectName: "toolbar"
- }
-}
+ToolBar { }
diff --git a/tests/auto/accessibility/data/toolbutton.qml b/tests/auto/accessibility/data/toolbutton.qml
index ed44c8af..e088bb56 100644
--- a/tests/auto/accessibility/data/toolbutton.qml
+++ b/tests/auto/accessibility/data/toolbutton.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import QtQuick.Controls 2.1
-Window {
- visible: true
-
- ToolButton {
- id: toolbutton
- objectName: "toolbutton"
- text: "ToolButton"
- }
+ToolButton {
+ text: "ToolButton"
}
diff --git a/tests/auto/accessibility/data/tooltip.qml b/tests/auto/accessibility/data/tooltip.qml
new file mode 100644
index 00000000..dcb5b3b9
--- /dev/null
+++ b/tests/auto/accessibility/data/tooltip.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.5
+import QtQuick.Controls 2.1
+
+ToolTip {
+ text: "ToolTip"
+}
diff --git a/tests/auto/accessibility/data/weeknumbercolumn-2.qml b/tests/auto/accessibility/data/weeknumbercolumn-2.qml
index bc3b1739..7d682315 100644
--- a/tests/auto/accessibility/data/weeknumbercolumn-2.qml
+++ b/tests/auto/accessibility/data/weeknumbercolumn-2.qml
@@ -1,12 +1,4 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import Qt.labs.calendar 1.0
-Window {
- visible: true
-
- WeekNumberColumn {
- id: weeknumbercolumn
- objectName: "weeknumbercolumn"
- }
-}
+WeekNumberColumn { }
diff --git a/tests/auto/accessibility/data/weeknumbercolumn.qml b/tests/auto/accessibility/data/weeknumbercolumn.qml
index 7fadb5da..6b024872 100644
--- a/tests/auto/accessibility/data/weeknumbercolumn.qml
+++ b/tests/auto/accessibility/data/weeknumbercolumn.qml
@@ -1,13 +1,6 @@
import QtQuick 2.5
-import QtQuick.Window 2.2
import Qt.labs.calendar 1.0
-Window {
- visible: true
-
- WeekNumberColumn {
- id: weeknumbercolumn
- objectName: "weeknumbercolumn"
- Accessible.name: "WeekNumberColumn"
- }
+WeekNumberColumn {
+ Accessible.name: "WeekNumberColumn"
}
diff --git a/tests/auto/accessibility/tst_accessibility.cpp b/tests/auto/accessibility/tst_accessibility.cpp
index fc3be1cb..53cb6973 100644
--- a/tests/auto/accessibility/tst_accessibility.cpp
+++ b/tests/auto/accessibility/tst_accessibility.cpp
@@ -34,27 +34,21 @@
**
****************************************************************************/
-#include <qtest.h>
-#include <QtTest/QSignalSpy>
+#include <QtTest/qtest.h>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQml/qqmlcontext.h>
-#include <QtQuick/qquickview.h>
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuickTemplates2/private/qquickpopup_p.h>
#include "../shared/util.h"
-#include "../shared/visualtestutil.h"
#ifndef QT_NO_ACCESSIBILITY
#include <QtQuick/private/qquickaccessibleattached_p.h>
#endif
-using namespace QQuickVisualTestUtil;
-
class tst_accessibility : public QQmlDataTest
{
Q_OBJECT
-public:
private slots:
void a11y_data();
@@ -73,12 +67,18 @@ void tst_accessibility::a11y_data()
QTest::newRow("BusyIndicator") << "busyindicator" << 0x00000027 << ""; //QAccessible::Indicator
QTest::newRow("Button") << "button" << 0x0000002B << "Button"; //QAccessible::Button
QTest::newRow("CheckBox") << "checkbox" << 0x0000002C << "CheckBox"; //QAccessible::CheckBox
+ QTest::newRow("CheckDelegate") << "checkdelegate" << 0x0000002C << "CheckDelegate"; //QAccessible::CheckBox
+ QTest::newRow("ComboBox") << "combobox" << 0x0000002E << "ComboBox"; //QAccessible::ComboBox
QTest::newRow("Dialog") << "dialog" << 0x00000012 << ""; //QAccessible::Dialog
- // Frame
- // GroupBox
+ QTest::newRow("Frame") << "frame" << 0x00000013 << ""; //QAccessible::Border
+ QTest::newRow("GroupBox") << "groupbox" << 0x00000014 << "GroupBox"; //QAccessible::Grouping
+ QTest::newRow("ItemDelegate") << "itemdelegate" << 0x00000022 << "ItemDelegate"; //QAccessible::ListItem
QTest::newRow("Label") << "label" << 0x00000029 << "Label"; //QAccessible::StaticText
QTest::newRow("Menu") << "menu" << 0x0000000B << ""; //QAccessible::PopupMenu
+ QTest::newRow("MenuItem") << "menuitem" << 0x0000000C << "MenuItem"; //QAccessible::MenuItem
+ QTest::newRow("Page") << "page" << 0x00000025 << "Page"; //QAccessible::PageTab
QTest::newRow("PageIndicator") << "pageindicator" << 0x00000027 << ""; //QAccessible::Indicator
+ QTest::newRow("Pane") << "pane" << 0x00000010 << ""; //QAccessible::Pane
QTest::newRow("Popup") << "popup" << 0x00000080 << ""; //QAccessible::LayeredPane
QTest::newRow("ProgressBar") << "progressbar" << 0x00000030 << ""; //QAccessible::ProgressBar
QTest::newRow("RadioButton") << "radiobutton" << 0x0000002D << "RadioButton"; //QAccessible::RadioButton
@@ -89,12 +89,14 @@ void tst_accessibility::a11y_data()
QTest::newRow("SpinBox") << "spinbox" << 0x00000034 << ""; //QAccessible::SpinBox
// StackView
QTest::newRow("Switch") << "switch" << 0x0000002B << "Switch"; //QAccessible::Button
+ QTest::newRow("SwitchDelegate") << "switchdelegate" << 0x00000022 << "SwitchDelegate"; //QAccessible::ListItem
QTest::newRow("TabBar") << "tabbar" << 0x0000003C << ""; //QAccessible::PageTabList
QTest::newRow("TabButton") << "tabbutton" << 0x00000025 << "TabButton"; //QAccessible::PageTab
QTest::newRow("TextArea") << "textarea" << 0x0000002A << ""; //QAccessible::Accessible.EditableText
QTest::newRow("TextField") << "textfield" << 0x0000002A << ""; //QAccessible::Accessible.EditableText
QTest::newRow("ToolBar") << "toolbar" << 0x00000016 << ""; //QAccessible::ToolBar
QTest::newRow("ToolButton") << "toolbutton" << 0x0000002B << "ToolButton"; //QAccessible::Button
+ QTest::newRow("ToolTip") << "tooltip" << 0x0000000D << "ToolTip"; //QAccessible::ToolTip
QTest::newRow("Dial") << "dial" << 0x00000031 << ""; //QAccessible::Dial
// Drawer
@@ -120,7 +122,6 @@ void tst_accessibility::a11y()
QFETCH(int, role);
QFETCH(QString, text);
- QQmlComponent component(&engine);
QString fn = name;
#ifdef QT_NO_ACCESSIBILITY
if (name == QLatin1Literal("dayofweekrow")
@@ -128,20 +129,16 @@ void tst_accessibility::a11y()
|| name == QLatin1Literal("weeknumbercolumn"))
fn += QLatin1Literal("-2");
#endif
+
+ QQmlComponent component(&engine);
component.loadUrl(testFileUrl(fn + ".qml"));
- QObject* created = component.create();
- QVERIFY2(created, qPrintable(component.errorString()));
- QScopedPointer<QObject> cleanup(created);
- QVERIFY(!cleanup.isNull());
- QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
- QVERIFY(window);
- window->show();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
- QQuickItem *item = findItem<QQuickItem>(window->contentItem(), name);
+ QQuickItem *item = qobject_cast<QQuickItem *>(object.data());
if (!item) {
- QQuickPopup *popup = window->contentItem()->findChild<QQuickPopup *>(name);
+ QQuickPopup *popup = qobject_cast<QQuickPopup *>(object.data());
if (popup)
item = popup->popupItem();
}
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index b74911c7..cc0c4de3 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -468,7 +468,6 @@ TestCase {
// hide popup
keyPress(data.key2)
compare(control.pressed, data.hidePress)
- compare(control.popup.visible, data.showPopup)
keyRelease(data.key2)
compare(control.pressed, false)
tryCompare(control.popup, "visible", !data.hidePopup)
diff --git a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml
index 3054fe22..bb7efc5d 100644
--- a/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml
+++ b/tests/manual/gifs/data/qtquickcontrols2-busyindicator.qml
@@ -51,7 +51,7 @@ Window {
BusyIndicator {
id: busyIndicator
- running: false
+ running: true
anchors.centerIn: parent
}
}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-drawer.qml b/tests/manual/gifs/data/qtquickcontrols2-drawer.qml
new file mode 100644
index 00000000..49f2cf50
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-drawer.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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:BSD$
+** 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.6
+import QtQuick.Controls 2.0
+import QtQuick.Window 2.0
+
+ApplicationWindow {
+ id: window
+ width: 300
+ height: 300
+ visible: true
+
+ property alias drawer: drawer
+
+ Drawer {
+ id: drawer
+ width: window.width * 0.66
+ height: window.height
+ rightPadding: 0
+
+ Rectangle {
+ border.width: 1
+ anchors.fill: parent
+
+ Label {
+ text: "Drawer"
+ font.pixelSize: 32
+ anchors.centerIn: parent
+ }
+ }
+ }
+
+ Rectangle {
+ border.width: 1
+ anchors.fill: parent
+
+ Label {
+ text: "Content"
+ font.pixelSize: 32
+ anchors.centerIn: parent
+ }
+ }
+
+ Rectangle {
+ z: 1
+ color: "black"
+ width: 1
+ height: parent.height
+ parent: window.overlay
+ }
+}
diff --git a/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml b/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml
new file mode 100644
index 00000000..d721591a
--- /dev/null
+++ b/tests/manual/gifs/data/qtquickcontrols2-swipeview.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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:BSD$
+** 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.6
+import QtQuick.Window 2.0
+import QtQuick.Controls 2.0
+
+Window {
+ width: 300
+ height: 300
+ visible: true
+
+ property alias swipeView: view
+
+ Rectangle {
+ border.width: 1
+ anchors.fill: parent
+ }
+
+ SwipeView {
+ id: view
+ anchors.fill: parent
+
+ Label {
+ text: "First\nPage"
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ }
+
+ Label {
+ text: "Second\nPage"
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ }
+
+ Label {
+ text: "Third\nPage"
+ horizontalAlignment: Qt.AlignHCenter
+ verticalAlignment: Qt.AlignVCenter
+ }
+ }
+
+ PageIndicator {
+ id: indicator
+
+ count: view.count
+ currentIndex: view.currentIndex
+
+ anchors.bottom: view.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+}
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp
index 5e6de547..8849e593 100644
--- a/tests/manual/gifs/tst_gifs.cpp
+++ b/tests/manual/gifs/tst_gifs.cpp
@@ -60,6 +60,7 @@ private slots:
void button();
void tabBar();
void menu();
+ void swipeView();
void swipeDelegate_data();
void swipeDelegate();
void swipeDelegateBehind();
@@ -78,6 +79,7 @@ private slots:
void comboBox();
void stackView_data();
void stackView();
+ void drawer();
private:
void moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoint &to, int movements,
@@ -353,7 +355,7 @@ void tst_Gifs::busyIndicator()
GifRecorder gifRecorder;
gifRecorder.setDataDirPath(dataDirPath);
gifRecorder.setOutputDir(outputDir);
- gifRecorder.setRecordingDuration(3);
+ gifRecorder.setRecordingDuration(6);
gifRecorder.setHighQuality(true);
gifRecorder.setQmlFileName("qtquickcontrols2-busyindicator.qml");
@@ -361,17 +363,17 @@ void tst_Gifs::busyIndicator()
QQuickWindow *window = gifRecorder.window();
// Record nothing for a bit to make it smoother.
- QTest::qWait(400);
+ QTest::qWait(800 * 2);
QQuickItem *busyIndicator = window->property("busyIndicator").value<QQuickItem*>();
QVERIFY(busyIndicator);
- busyIndicator->setProperty("running", true);
+ busyIndicator->setProperty("running", false);
// 800 ms is the duration of one rotation animation cycle for BusyIndicator.
QTest::qWait(800 * 2);
- busyIndicator->setProperty("running", false);
+ busyIndicator->setProperty("running", true);
gifRecorder.waitForFinish();
}
@@ -483,6 +485,31 @@ void tst_Gifs::menu()
gifRecorder.waitForFinish();
}
+void tst_Gifs::swipeView()
+{
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(8);
+ gifRecorder.setQmlFileName(QStringLiteral("qtquickcontrols2-swipeview.qml"));
+ gifRecorder.setHighQuality(true);
+
+ gifRecorder.start();
+
+ QQuickWindow *window = gifRecorder.window();
+ QQuickItem *swipeView = window->property("swipeView").value<QQuickItem*>();
+ QVERIFY(swipeView);
+
+ QTest::qWait(1200);
+ swipeView->setProperty("currentIndex", 1);
+ QTest::qWait(2000);
+ swipeView->setProperty("currentIndex", 2);
+ QTest::qWait(2000);
+ swipeView->setProperty("currentIndex", 0);
+
+ gifRecorder.waitForFinish();
+}
+
void tst_Gifs::swipeDelegate_data()
{
QTest::addColumn<QString>("qmlFileName");
@@ -914,6 +941,31 @@ void tst_Gifs::stackView()
gifRecorder.waitForFinish();
}
+void tst_Gifs::drawer()
+{
+ GifRecorder gifRecorder;
+ gifRecorder.setDataDirPath(dataDirPath);
+ gifRecorder.setOutputDir(outputDir);
+ gifRecorder.setRecordingDuration(4);
+ gifRecorder.setHighQuality(true);
+ gifRecorder.setQmlFileName("qtquickcontrols2-drawer.qml");
+
+ gifRecorder.start();
+
+ QQuickWindow *window = gifRecorder.window();
+ QObject *drawer = window->property("drawer").value<QObject*>();
+ qreal width = drawer->property("width").toReal();
+
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, QPoint(1, 1), 100);
+ moveSmoothly(window, QPoint(1, 1), QPoint(width, 1), width, QEasingCurve::InOutBack, 1);
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, QPoint(width, 1), 30);
+
+ QTest::qWait(1000);
+ QMetaObject::invokeMethod(drawer, "close");
+
+ gifRecorder.waitForFinish();
+}
+
QTEST_MAIN(tst_Gifs)
#include "tst_gifs.moc"