aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-05-31 08:13:14 +0200
committerLiang Qi <liang.qi@qt.io>2017-05-31 08:13:14 +0200
commit1e472c6c1aafd893eebf29929b36b77c42c0e199 (patch)
tree5d63cff70bc21e0ead4135347cc87e65e864f824
parent44dd55be23138f0a6495b08818acaaa0ff68b086 (diff)
parentef6b8d3081f0bf93d6d59e67c8e3f82c63c511c3 (diff)
Merge remote-tracking branch 'origin/5.9.0' into 5.9
-rw-r--r--dist/changes-5.9.0208
-rw-r--r--examples/quickcontrols2/wearable/images/back@2x.pngbin0 -> 1105 bytes
-rw-r--r--examples/quickcontrols2/wearable/images/back@3x.pngbin0 -> 1679 bytes
-rw-r--r--examples/quickcontrols2/wearable/images/back@4x.pngbin0 -> 2184 bytes
-rw-r--r--examples/quickcontrols2/wearable/images/home@2x.pngbin0 -> 1142 bytes
-rw-r--r--examples/quickcontrols2/wearable/images/home@3x.pngbin0 -> 1710 bytes
-rw-r--r--examples/quickcontrols2/wearable/images/home@4x.pngbin0 -> 2277 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Alarms/images/alarms@2x.pngbin0 -> 1208 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/fitness@2x.pngbin0 -> 958 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.pngbin0 -> 2795 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.pngbin0 -> 2668 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/end@2x.pngbin0 -> 2833 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.pngbin0 -> 2148 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.pngbin0 -> 1063 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.pngbin0 -> 1613 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/start@2x.pngbin0 -> 2803 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.pngbin0 -> 790 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Navigation/images/uturn@2x.pngbin0 -> 6946 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.pngbin0 -> 2183 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.pngbin0 -> 2011 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.pngbin0 -> 2685 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Notifications/images/notifications@2x.pngbin0 -> 1316 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.pngbin0 -> 4123 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.pngbin0 -> 2320 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.pngbin0 -> 1930 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/settings@2x.pngbin0 -> 1233 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.pngbin0 -> 2151 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.pngbin0 -> 3076 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.pngbin0 -> 3256 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.pngbin0 -> 2427 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.pngbin0 -> 2489 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.pngbin0 -> 1977 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/weather@2x.pngbin0 -> 1061 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.pngbin0 -> 2309 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/center@2x.pngbin0 -> 2655 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/clock-night@2x.pngbin0 -> 67554 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/second@2x.pngbin0 -> 1000 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/swissdaydial@2x.pngbin0 -> 17696 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayhour@2x.pngbin0 -> 1234 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayminute@2x.pngbin0 -> 1325 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightdial@2x.pngbin0 -> 18135 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/swissnighthour@2x.pngbin0 -> 1353 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightminute@2x.pngbin0 -> 1337 bytes
-rw-r--r--examples/quickcontrols2/wearable/qml/WorldClock/images/worldclock@2x.pngbin0 -> 1101 bytes
-rw-r--r--examples/quickcontrols2/wearable/wearable.cpp1
-rw-r--r--examples/quickcontrols2/wearable/wearable.qrc39
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp10
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp7
-rw-r--r--src/quicktemplates2/qquickoverlay.cpp29
-rw-r--r--src/quicktemplates2/qquickoverlay_p_p.h2
-rw-r--r--src/quicktemplates2/qquickpopup.cpp2
-rw-r--r--tests/auto/drawer/data/applicationwindow-button.qml70
-rw-r--r--tests/auto/drawer/data/dragOverModalShadow.qml87
-rw-r--r--tests/auto/drawer/data/window-button.qml71
-rw-r--r--tests/auto/drawer/tst_drawer.cpp89
55 files changed, 586 insertions, 29 deletions
diff --git a/dist/changes-5.9.0 b/dist/changes-5.9.0
new file mode 100644
index 00000000..39b064fb
--- /dev/null
+++ b/dist/changes-5.9.0
@@ -0,0 +1,208 @@
+Qt 5.9 introduces many new features and improvements as well as bugfixes
+over the 5.8.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.9 series is binary compatible with the 5.8.x series.
+Applications compiled for 5.8 will continue to run with 5.9.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - Added multi-touch support for buttons and sliders. It is now possible to
+ touch-interact with multiple sliders and buttons at the same time.
+ - By popular demand, Slider, RangeSlider, and Dial have been changed to
+ report live value updates by default. This can be disabled by setting the
+ "live" property to false.
+ - [QTBUG-59920] Sliders and Dials now react immediately when using a
+ mouse. Now the initial drag threshold applies only on touch, to avoid
+ conflicting with flickables.
+ - [QTBUG-58667] ScrollBar now reacts immediately when using a mouse.
+ - [QTBUG-59629] Set explicit cursors on all interactive controls.
+
+****************************************************************************
+* Controls *
+****************************************************************************
+
+ - AbstractButton:
+ * Added support for multi-touch.
+ * [QTBUG-57203] Added a toggled() signal that is emitted whenever a
+ checkable button is interactively toggled by the user by using either
+ touch, mouse, or keys.
+
+ - ApplicationWindow:
+ * [QTBUG-58932] The "data" property has been renamed to contentData, as it
+ was documented. Notice that a "data" property still exists in QML
+ Window, but is no longer overshadowed in ApplicationWindow.
+
+ - Control:
+ * [QTBUG-50992] Resolved the "Object destroyed during incubation" issue
+ that occurred randomly when customizing built-in delegates.
+
+ - ComboBox:
+ * [QTBUG-53876] Added "editable" property.
+ * Added "down" property.
+
+ - DelayButton:
+ * Added DelayButton that incorporates a delay before the button becomes
+ activated, to prevent accidental triggers.
+
+ - Dial:
+ * Added a "live" property that determines whether the dial provides live
+ updates for the "value" property while the handle is dragged.
+ * Added support for wheel handling when wheelEnabled is set to true.
+ * [QTBUG-57203] Added a moved() signal that is emitted whenever the dial
+ is interactively moved by the user by using either touch, mouse, or
+ keys.
+ * Fixed handling of inverted wheel events (natural touchpad scrolling
+ direction on macOS).
+
+ - Drawer:
+ * [QTBUG-53169] Added "interactive" property that specifies whether the
+ drawer reacts to swipes. This can be used to make drawer a
+ non-closable persistent side-bar.
+
+ - Menu:
+ * Fixed populating Menus with a Repeater.
+
+ - Popup:
+ * Allowed passing a Window as a parent when creating dynamic Popup
+ instances using eg. Component.createObject(). Previously, Popup
+ assumed the parent to be an Item, and would complain "cannot find
+ any window to open popup in" if a Window was passed.
+ * [QTBUG-58196] Allowed dynamic window changes after construction.
+ * Fixed the CloseOnRelease close policy for non-modal popups.
+
+ - RangeSlider:
+ * Added a "live" property that determines whether the range slider
+ provides live updates for the first.value and second.value properties
+ while the respective handle is dragged.
+
+ - ScrollBar:
+ * [QTBUG-56569] Added snapMode property for incremental or discrete
+ scrolling.
+ * Added an "interactive "property. A non-interactive ScrollBar is visually
+ and behaviorally similar to ScrollIndicator. This property is useful
+ for switching between typical mouse- and touch-orientated UIs with
+ interactive and non- interactive scroll bars, respectively.
+ * Added a "policy" property, which holds whether the scroll bar is shown
+ always/never/as needed (default).
+
+ - ScrollView:
+ * Added ScrollView. On touch, ScrollView enables flicking and makes
+ the scroll bars non-interactive. When interacted with a mouse device,
+ flicking is disabled and the scroll bars are interactive.
+
+ - Slider:
+ * Added support for multi-touch.
+ * Added a "live" property that determines whether the slider provides live
+ updates for the "value" property while the handle is dragged.
+ * [QTBUG-57203] Added a moved() signal that is emitted whenever the
+ slider is interactively moved by the user by using either touch,
+ mouse, wheel, or keys.
+ * Fixed handling of inverted wheel events (natural touchpad scrolling
+ direction on macOS).
+
+ - SpinBox:
+ * [QTBUG-56837] Added inputMethodHints and inputMethodComposing
+ properties for controlling the input method when using editable spin
+ boxes.
+ * [QTBUG-57203] Added a valueModified() signal that is emitted whenever
+ the value of a spin box has been interactively modified by the user by
+ using either touch, mouse, wheel, or keys.
+ * [QTBUG-60356] Forwarded focus to the internal editor of an editable
+ spin box.
+
+ - StackView:
+ * [QTBUG-56801] Added attached "StackView.visible" property that can be
+ used to control whether items below the top- most item are kept
+ visible.
+ * [QTBUG-57266] Prevented pushing duplicate items.
+ * [QTBUG-59034] Fixed pop/replace exit transition leak, sometimes leading
+ to random crashes since a transition could have been left running in the
+ background at destruction time.
+ * [QTBUG-59098] Prevented StackView filtering mouse ungrab events to avoid
+ MouseAreas being stuck in the pressed state.
+ * [QTBUG-59634] Improved component creation errors by using the standard
+ QML warning system that gives a context/location for the error.
+
+ - SwipeDelegate:
+ * [QTBUG-57192] Added "swipe.enabled" property to allow disabling of
+ swiping.
+ * Added swipe.open(side) method that can be used to programmatically
+ open the side item on the specified side, which can be either
+ SwipeDelegate.Left or SwipeDelegate.Right.
+ * Added swipe.opened() and swipe.closed() signals, which are emitted
+ when the delegate has been opened or closed by swipe, and the
+ respective transition has finished.
+ * Added a swipe.transition property that holds the transition that is
+ applied when a swipe is released, or swipe.open() or swipe.close() is
+ called.
+
+ - SwipeView:
+ * [QTBUG-56031] Added "orientation" property.
+
+ - TabBar:
+ * [QTBUG-57858] Added contentWidth and contentHeight properties that are
+ automatically calculated based on the total size of the tab items, but
+ can be manually overridden if desired. This fixes an issue that TabBar
+ was not able to reliably calculate an implicit size, and could in
+ certain scenarios enter an infinite loop due to a circular dependency
+ between the items' sizes and the tabbar's size.
+
+ - TextArea:
+ * [QTBUG-55999] Fixed the horizontal alignment of the placeholder text
+ in right-to-left UIs.
+ * TextArea has been made to work inside ScrollView, providing necessary
+ scroll bars out of the box.
+
+ - TextField:
+ * [QTBUG-55999] Fixed the horizontal alignment of the placeholder text
+ in right-to-left UIs.
+
+ - Tumbler:
+ * Added a "moving" property that describes whether the tumbler is
+ currently moving, due to the user either dragging or flicking the
+ tumbler.
+
+****************************************************************************
+* Styles *
+****************************************************************************
+
+ - Added support for a QT_QUICK_CONTROLS_STYLE_PATH environment variable,
+ which can be used to specify lookup paths for Qt Quick Controls 2
+ styles. This allows device manufacturers and Linux distributions to
+ specify a system-wide style installation folder that may be located
+ outside the Qt installation tree.
+ - Added support for a QT_QUICK_CONTROLS_STYLE_CONF environment variable,
+ which can be used to override the default location of the Qt Quick
+ 2 Controls configuration file (:/qtquickcontrols2.conf).
+ - QQuickStyle:
+ * Added availableStyles() method that returns the list of available
+ built-in styles.
+
+Default
+--------
+ - Visualized RangeSliders's range.
+
+Material
+--------
+ - [QTBUG-58797] Fixed cursor visibility for read-only editors.
+
+****************************************************************************
+* Platform *
+****************************************************************************
+
+ - Menu:
+ * Fixed sub-menu handling when using the Qt Widgets fallbacks on
+ platforms that do not support native menus (Windows, for example).
diff --git a/examples/quickcontrols2/wearable/images/back@2x.png b/examples/quickcontrols2/wearable/images/back@2x.png
new file mode 100644
index 00000000..6f6b2e3c
--- /dev/null
+++ b/examples/quickcontrols2/wearable/images/back@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/images/back@3x.png b/examples/quickcontrols2/wearable/images/back@3x.png
new file mode 100644
index 00000000..f51847d0
--- /dev/null
+++ b/examples/quickcontrols2/wearable/images/back@3x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/images/back@4x.png b/examples/quickcontrols2/wearable/images/back@4x.png
new file mode 100644
index 00000000..4060f8fa
--- /dev/null
+++ b/examples/quickcontrols2/wearable/images/back@4x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/images/home@2x.png b/examples/quickcontrols2/wearable/images/home@2x.png
new file mode 100644
index 00000000..dd9f4605
--- /dev/null
+++ b/examples/quickcontrols2/wearable/images/home@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/images/home@3x.png b/examples/quickcontrols2/wearable/images/home@3x.png
new file mode 100644
index 00000000..9276ceb4
--- /dev/null
+++ b/examples/quickcontrols2/wearable/images/home@3x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/images/home@4x.png b/examples/quickcontrols2/wearable/images/home@4x.png
new file mode 100644
index 00000000..bd1245d9
--- /dev/null
+++ b/examples/quickcontrols2/wearable/images/home@4x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Alarms/images/alarms@2x.png b/examples/quickcontrols2/wearable/qml/Alarms/images/alarms@2x.png
new file mode 100644
index 00000000..ba68519a
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Alarms/images/alarms@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/fitness@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/fitness@2x.png
new file mode 100644
index 00000000..088c15b8
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/fitness@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png
new file mode 100644
index 00000000..2073d97f
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png
new file mode 100644
index 00000000..037a8f03
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/end@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/end@2x.png
new file mode 100644
index 00000000..d5fbe17d
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/end@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png
new file mode 100644
index 00000000..39e9be84
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png
new file mode 100644
index 00000000..8d133abc
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png
new file mode 100644
index 00000000..258c4144
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/start@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/start@2x.png
new file mode 100644
index 00000000..2e577df4
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/start@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png
new file mode 100644
index 00000000..ef71ab1b
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/uturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/uturn@2x.png
new file mode 100644
index 00000000..8419b5e1
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Navigation/images/uturn@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png
new file mode 100644
index 00000000..2c916b2c
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png
new file mode 100644
index 00000000..d30eb2d2
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png
new file mode 100644
index 00000000..d28e62c5
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/notifications@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/notifications@2x.png
new file mode 100644
index 00000000..c3b284ed
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Notifications/images/notifications@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png
new file mode 100644
index 00000000..276d7337
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png
new file mode 100644
index 00000000..94753ea6
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png
new file mode 100644
index 00000000..92e112f9
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/settings@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/settings@2x.png
new file mode 100644
index 00000000..a24a1df7
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/settings@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png
new file mode 100644
index 00000000..8aa4c9a8
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png
new file mode 100644
index 00000000..5c367a3e
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png
new file mode 100644
index 00000000..14c1cab3
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png
new file mode 100644
index 00000000..3a7892eb
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png
new file mode 100644
index 00000000..39aeebe5
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png
new file mode 100644
index 00000000..0b4340ce
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/weather@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/weather@2x.png
new file mode 100644
index 00000000..6e4ce2f3
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/weather@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png
new file mode 100644
index 00000000..bab49c04
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/center@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/center@2x.png
new file mode 100644
index 00000000..34ad1900
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/center@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/clock-night@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/clock-night@2x.png
new file mode 100644
index 00000000..75456795
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/clock-night@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/second@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/second@2x.png
new file mode 100644
index 00000000..689a01be
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/second@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdaydial@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdaydial@2x.png
new file mode 100644
index 00000000..95cb75b6
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdaydial@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayhour@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayhour@2x.png
new file mode 100644
index 00000000..2fb6feac
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayhour@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayminute@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayminute@2x.png
new file mode 100644
index 00000000..a7c55d4e
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayminute@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightdial@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightdial@2x.png
new file mode 100644
index 00000000..86ecf5ad
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightdial@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnighthour@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnighthour@2x.png
new file mode 100644
index 00000000..a37e0d12
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnighthour@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightminute@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightminute@2x.png
new file mode 100644
index 00000000..627cca9c
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightminute@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/worldclock@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/worldclock@2x.png
new file mode 100644
index 00000000..03abe162
--- /dev/null
+++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/worldclock@2x.png
Binary files differ
diff --git a/examples/quickcontrols2/wearable/wearable.cpp b/examples/quickcontrols2/wearable/wearable.cpp
index c50c95c4..e6fdad74 100644
--- a/examples/quickcontrols2/wearable/wearable.cpp
+++ b/examples/quickcontrols2/wearable/wearable.cpp
@@ -54,6 +54,7 @@
int main(int argc, char *argv[])
{
+ QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
//! [style]
diff --git a/examples/quickcontrols2/wearable/wearable.qrc b/examples/quickcontrols2/wearable/wearable.qrc
index 6df0aa93..c8143a18 100644
--- a/examples/quickcontrols2/wearable/wearable.qrc
+++ b/examples/quickcontrols2/wearable/wearable.qrc
@@ -5,38 +5,59 @@
<file>qml/NaviButton.qml</file>
<file>images/background.png</file>
<file>images/back.png</file>
+ <file>images/back@2x.png</file>
<file>images/home.png</file>
+ <file>images/home@2x.png</file>
<file>qml/Alarms/AlarmsPage.qml</file>
<file>qml/Alarms/images/alarms.png</file>
+ <file>qml/Alarms/images/alarms@2x.png</file>
<file>qml/Fitness/fitness.js</file>
<file>qml/Fitness/FitnessPage.qml</file>
<file>qml/Fitness/images/fitness.png</file>
+ <file>qml/Fitness/images/fitness@2x.png</file>
<file>qml/Fitness/images/man-running.png</file>
+ <file>qml/Fitness/images/man-running@2x.png</file>
<file>qml/Fitness/images/man-walking.png</file>
+ <file>qml/Fitness/images/man-walking@2x.png</file>
<file>qml/Navigation/navigation.js</file>
<file>qml/Navigation/NavigationPage.qml</file>
<file>qml/Navigation/RouteElement.qml</file>
<file>qml/Navigation/walk_route.json</file>
<file>qml/Navigation/images/end.png</file>
+ <file>qml/Navigation/images/end@2x.png</file>
<file>qml/Navigation/images/leftturn.png</file>
- <file>qml/Navigation/images/marker.png</file>
+ <file>qml/Navigation/images/leftturn@2x.png</file>
<file>qml/Navigation/images/navigation.png</file>
+ <file>qml/Navigation/images/navigation@2x.png</file>
<file>qml/Navigation/images/rightturn.png</file>
+ <file>qml/Navigation/images/rightturn@2x.png</file>
<file>qml/Navigation/images/start.png</file>
+ <file>qml/Navigation/images/start@2x.png</file>
<file>qml/Navigation/images/straight.png</file>
+ <file>qml/Navigation/images/straight@2x.png</file>
<file>qml/Navigation/images/uturn.png</file>
+ <file>qml/Navigation/images/uturn@2x.png</file>
<file>qml/Notifications/notifications.js</file>
<file>qml/Notifications/NotificationsPage.qml</file>
<file>qml/Notifications/images/avatarf.png</file>
+ <file>qml/Notifications/images/avatarf@2x.png</file>
<file>qml/Notifications/images/avatarm.png</file>
+ <file>qml/Notifications/images/avatarm@2x.png</file>
<file>qml/Notifications/images/missedcall.png</file>
+ <file>qml/Notifications/images/missedcall@2x.png</file>
<file>qml/Notifications/images/notifications.png</file>
+ <file>qml/Notifications/images/notifications@2x.png</file>
<file>qml/Settings/SettingsPage.qml</file>
<file>qml/Settings/images/bluetooth.png</file>
+ <file>qml/Settings/images/bluetooth@2x.png</file>
<file>qml/Settings/images/brightness.png</file>
+ <file>qml/Settings/images/brightness@2x.png</file>
<file>qml/Settings/images/contrast.png</file>
+ <file>qml/Settings/images/contrast@2x.png</file>
<file>qml/Settings/images/settings.png</file>
+ <file>qml/Settings/images/settings@2x.png</file>
<file>qml/Settings/images/wifi.png</file>
+ <file>qml/Settings/images/wifi@2x.png</file>
<file>qml/Style/qmldir</file>
<file>qml/Style/PageIndicator.qml</file>
<file>qml/Style/Slider.qml</file>
@@ -46,22 +67,38 @@
<file>qml/Weather/weather.json</file>
<file>qml/Weather/WeatherPage.qml</file>
<file>qml/Weather/images/humidity.png</file>
+ <file>qml/Weather/images/humidity@2x.png</file>
<file>qml/Weather/images/pressure.png</file>
+ <file>qml/Weather/images/pressure@2x.png</file>
<file>qml/Weather/images/sunrise.png</file>
+ <file>qml/Weather/images/sunrise@2x.png</file>
<file>qml/Weather/images/sunset.png</file>
+ <file>qml/Weather/images/sunset@2x.png</file>
<file>qml/Weather/images/temperature.png</file>
+ <file>qml/Weather/images/temperature@2x.png</file>
<file>qml/Weather/images/weather.png</file>
+ <file>qml/Weather/images/weather@2x.png</file>
<file>qml/Weather/images/wind.png</file>
+ <file>qml/Weather/images/wind@2x.png</file>
<file>qml/WorldClock/Clock.qml</file>
<file>qml/WorldClock/WorldClockPage.qml</file>
<file>qml/WorldClock/images/center.png</file>
+ <file>qml/WorldClock/images/center@2x.png</file>
<file>qml/WorldClock/images/second.png</file>
+ <file>qml/WorldClock/images/second@2x.png</file>
<file>qml/WorldClock/images/swissdaydial.png</file>
+ <file>qml/WorldClock/images/swissdaydial@2x.png</file>
<file>qml/WorldClock/images/swissdayhour.png</file>
+ <file>qml/WorldClock/images/swissdayhour@2x.png</file>
<file>qml/WorldClock/images/swissdayminute.png</file>
+ <file>qml/WorldClock/images/swissdayminute@2x.png</file>
<file>qml/WorldClock/images/swissnightdial.png</file>
+ <file>qml/WorldClock/images/swissnightdial@2x.png</file>
<file>qml/WorldClock/images/swissnighthour.png</file>
+ <file>qml/WorldClock/images/swissnighthour@2x.png</file>
<file>qml/WorldClock/images/swissnightminute.png</file>
+ <file>qml/WorldClock/images/swissnightminute@2x.png</file>
<file>qml/WorldClock/images/worldclock.png</file>
+ <file>qml/WorldClock/images/worldclock@2x.png</file>
</qresource>
</RCC>
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index 04ab559f..d987182c 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -672,7 +672,15 @@ QQuickComboBox::QQuickComboBox(QQuickItem *parent)
QQuickComboBox::~QQuickComboBox()
{
- setPopup(nullptr);
+ Q_D(QQuickComboBox);
+ // Disconnect visibleChanged() to avoid a spurious highlightedIndexChanged() signal
+ // emission during the destruction of the (visible) popup. (QTBUG-57650)
+ QObjectPrivate::disconnect(d->popup, &QQuickPopup::visibleChanged, d, &QQuickComboBoxPrivate::popupVisibleChanged);
+
+ // Delete the popup directly instead of calling setPopup(nullptr) to avoid calling
+ // destroyDelegate(popup) and potentially accessing a destroyed QML context. (QTBUG-50992)
+ delete d->popup;
+ d->popup = nullptr;
}
/*!
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index 030fc98e..8159f05e 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -301,7 +301,7 @@ bool QQuickDrawerPrivate::grabMouse(QQuickItem *item, QMouseEvent *event)
Q_Q(QQuickDrawer);
handleMouseEvent(item, event);
- if (!window || !interactive || popupItem->keepMouseGrab())
+ if (!window || !interactive || popupItem->keepMouseGrab() || popupItem->keepTouchGrab())
return false;
const QPointF movePoint = event->windowPos();
@@ -377,6 +377,7 @@ bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event)
}
if (overThreshold) {
+ popupItem->grabTouchPoints(QVector<int>() << touchId);
popupItem->setKeepTouchGrab(true);
offset = offsetAt(movePoint);
}
@@ -422,7 +423,6 @@ bool QQuickDrawerPrivate::handleRelease(QQuickItem *item, const QPointF &point,
return QQuickPopupPrivate::handleRelease(item, point, timestamp);
}
- pressPoint = QPointF();
velocityCalculator.stopMeasuring(point, timestamp);
qreal velocity = 0;
@@ -479,6 +479,9 @@ bool QQuickDrawerPrivate::handleRelease(QQuickItem *item, const QPointF &point,
popupItem->setKeepMouseGrab(false);
popupItem->setKeepTouchGrab(false);
+ pressPoint = QPointF();
+ touchId = -1;
+
return wasGrabbed;
}
diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp
index 0f7edc77..15104808 100644
--- a/src/quicktemplates2/qquickoverlay.cpp
+++ b/src/quicktemplates2/qquickoverlay.cpp
@@ -181,11 +181,23 @@ QQuickOverlayPrivate::QQuickOverlayPrivate()
{
}
-bool QQuickOverlayPrivate::startDrag(QEvent *event)
+bool QQuickOverlayPrivate::startDrag(QEvent *event, const QPointF &pos)
{
+ Q_Q(QQuickOverlay);
if (allDrawers.isEmpty())
return false;
+ // don't start dragging a drawer if a modal popup overlay is blocking (QTBUG-60602)
+ QQuickItem *item = q->childAt(pos.x(), pos.y());
+ if (item) {
+ const auto popups = stackingOrderPopups();
+ for (QQuickPopup *popup : popups) {
+ QQuickPopupPrivate *p = QQuickPopupPrivate::get(popup);
+ if (p->dimmer == item && popup->isVisible() && popup->isModal())
+ return false;
+ }
+ }
+
const QVector<QQuickDrawer *> drawers = stackingOrderDrawers();
for (QQuickDrawer *drawer : drawers) {
QQuickDrawerPrivate *p = QQuickDrawerPrivate::get(drawer);
@@ -251,7 +263,7 @@ bool QQuickOverlayPrivate::handleMouseEvent(QQuickItem *source, QMouseEvent *eve
{
switch (event->type()) {
case QEvent::MouseButtonPress:
- if (!target && startDrag(event))
+ if (!target && startDrag(event, event->windowPos()))
return true;
return handlePress(source, event, target);
case QEvent::MouseMove:
@@ -269,17 +281,12 @@ bool QQuickOverlayPrivate::handleTouchEvent(QQuickItem *source, QTouchEvent *eve
bool handled = false;
switch (event->type()) {
case QEvent::TouchBegin:
- if (!target && startDrag(event))
- handled = true;
- else
- handled = handlePress(source, event, target);
- break;
-
case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
for (const QTouchEvent::TouchPoint &point : event->touchPoints()) {
switch (point.state()) {
case Qt::TouchPointPressed:
- if (!target && startDrag(event))
+ if (!target && startDrag(event, point.scenePos()))
handled = true;
else
handled |= handlePress(source, event, target);
@@ -296,10 +303,6 @@ bool QQuickOverlayPrivate::handleTouchEvent(QQuickItem *source, QTouchEvent *eve
}
break;
- case QEvent::TouchEnd:
- handled = handleRelease(source, event, target ? target : mouseGrabberPopup.data());
- break;
-
default:
break;
}
diff --git a/src/quicktemplates2/qquickoverlay_p_p.h b/src/quicktemplates2/qquickoverlay_p_p.h
index fa53d52b..5553bda8 100644
--- a/src/quicktemplates2/qquickoverlay_p_p.h
+++ b/src/quicktemplates2/qquickoverlay_p_p.h
@@ -70,7 +70,7 @@ public:
return overlay->d_func();
}
- bool startDrag(QEvent *event);
+ bool startDrag(QEvent *event, const QPointF &pos);
bool handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target);
bool handleMove(QQuickItem *source, QEvent *event, QQuickPopup *target);
bool handleRelease(QQuickItem *source, QEvent *event, QQuickPopup *target);
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp
index 406c513f..59a9a6dc 100644
--- a/src/quicktemplates2/qquickpopup.cpp
+++ b/src/quicktemplates2/qquickpopup.cpp
@@ -304,7 +304,7 @@ bool QQuickPopupPrivate::acceptTouch(const QTouchEvent::TouchPoint &point)
if (point.id() == touchId)
return true;
- if (touchId == -1 && point.state() == Qt::TouchPointPressed) {
+ if (touchId == -1 && point.state() != Qt::TouchPointReleased) {
touchId = point.id();
return true;
}
diff --git a/tests/auto/drawer/data/applicationwindow-button.qml b/tests/auto/drawer/data/applicationwindow-button.qml
new file mode 100644
index 00000000..9641351e
--- /dev/null
+++ b/tests/auto/drawer/data/applicationwindow-button.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Controls 2.1
+
+ApplicationWindow {
+ width: 400
+ height: 400
+
+ property alias drawer: drawer
+
+ Drawer {
+ id: drawer
+ width: 200
+ height: 200
+
+ Button {
+ text: "Button"
+ anchors.fill: parent
+ }
+ }
+}
diff --git a/tests/auto/drawer/data/dragOverModalShadow.qml b/tests/auto/drawer/data/dragOverModalShadow.qml
new file mode 100644
index 00000000..66eb2f4b
--- /dev/null
+++ b/tests/auto/drawer/data/dragOverModalShadow.qml
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Controls 2.0
+
+ApplicationWindow {
+ width: 400
+ height: 400
+
+ property alias drawer: drawer
+ property alias popup: popup
+
+ Drawer {
+ id: drawer
+ width: 200
+ height: parent.height
+ dragMargin: parent.width
+ }
+
+ Popup {
+ id: popup
+ modal: true
+ x: (parent.width - width) / 2
+ y: (parent.height - height) / 2
+ width: parent.width / 2
+ height: parent.height / 2
+
+ Rectangle {
+ objectName: "shadow"
+ parent: popup.background
+ anchors.fill: parent
+ anchors.margins: -20
+
+ z: -1
+ opacity: 0.5
+ color: "silver"
+ }
+ }
+}
diff --git a/tests/auto/drawer/data/window-button.qml b/tests/auto/drawer/data/window-button.qml
new file mode 100644
index 00000000..1b8ac7d5
--- /dev/null
+++ b/tests/auto/drawer/data/window-button.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+import QtQuick.Window 2.2
+import QtQuick.Controls 2.0
+
+Window {
+ width: 400
+ height: 400
+
+ property alias drawer: drawer
+
+ Drawer {
+ id: drawer
+ width: 200
+ height: 200
+
+ Button {
+ text: "Button"
+ anchors.fill: parent
+ }
+ }
+}
diff --git a/tests/auto/drawer/tst_drawer.cpp b/tests/auto/drawer/tst_drawer.cpp
index a7ebaa9e..9c30f8cf 100644
--- a/tests/auto/drawer/tst_drawer.cpp
+++ b/tests/auto/drawer/tst_drawer.cpp
@@ -94,6 +94,9 @@ private slots:
void flickable_data();
void flickable();
+ void dragOverModalShadow_data();
+ void dragOverModalShadow();
+
private:
struct TouchDeviceDeleter
{
@@ -758,13 +761,26 @@ void tst_Drawer::multiple()
void tst_Drawer::touch_data()
{
QTest::addColumn<QString>("source");
- QTest::newRow("Window") << "window.qml";
- QTest::newRow("ApplicationWindow") << "applicationwindow.qml";
+ QTest::addColumn<QPoint>("from");
+ QTest::addColumn<QPoint>("to");
+
+ QTest::newRow("Window:inside") << "window.qml" << QPoint(150, 100) << QPoint(50, 100);
+ QTest::newRow("Window:outside") << "window.qml" << QPoint(300, 100) << QPoint(100, 100);
+ QTest::newRow("ApplicationWindow:inside") << "applicationwindow.qml" << QPoint(150, 100) << QPoint(50, 100);
+ QTest::newRow("ApplicationWindow:outside") << "applicationwindow.qml" << QPoint(300, 100) << QPoint(100, 100);
+
+ QTest::newRow("Window+Button:inside") << "window-button.qml" << QPoint(150, 100) << QPoint(50, 100);
+ QTest::newRow("Window+Button:outside") << "window-button.qml" << QPoint(300, 100) << QPoint(100, 100);
+ QTest::newRow("ApplicationWindow+Button:inside") << "applicationwindow-button.qml" << QPoint(150, 100) << QPoint(50, 100);
+ QTest::newRow("ApplicationWindow+Button:outside") << "applicationwindow-button.qml" << QPoint(300, 100) << QPoint(100, 100);
}
void tst_Drawer::touch()
{
QFETCH(QString, source);
+ QFETCH(QPoint, from);
+ QFETCH(QPoint, to);
+
QQuickApplicationHelper helper(this, source);
QQuickWindow *window = helper.window;
@@ -783,19 +799,16 @@ void tst_Drawer::touch()
QTest::touchEvent(window, touchDevice.data()).press(0, QPoint(0, 100));
QTest::touchEvent(window, touchDevice.data()).move(0, QPoint(50, 100));
QTest::touchEvent(window, touchDevice.data()).move(0, QPoint(150, 100));
- QTRY_COMPARE(drawer->position(), 0.5);
QTest::touchEvent(window, touchDevice.data()).release(0, QPoint(150, 100));
QVERIFY(drawerOpenedSpy.wait());
QCOMPARE(drawer->position(), 1.0);
// drag to close
- QTest::touchEvent(window, touchDevice.data()).press(0, QPoint(300, 100));
- QTest::touchEvent(window, touchDevice.data()).move(0, QPoint(300 - drawer->dragMargin(), 100));
- for (int x = 300; x > 100; x -= 10)
- QTest::touchEvent(window, touchDevice.data()).move(0, QPoint(x, 100));
- QTest::touchEvent(window, touchDevice.data()).move(0, QPoint(100, 100));
- QTRY_COMPARE(drawer->position(), 0.5);
- QTest::touchEvent(window, touchDevice.data()).release(0, QPoint(100, 100));
+ QTest::touchEvent(window, touchDevice.data()).press(0, from);
+ for (int x = from.x(); x > to.x(); x -= 10)
+ QTest::touchEvent(window, touchDevice.data()).move(0, QPoint(x, to.y()));
+ QTest::touchEvent(window, touchDevice.data()).move(0, to);
+ QTest::touchEvent(window, touchDevice.data()).release(0, to);
QVERIFY(drawerClosedSpy.wait());
QCOMPARE(drawer->position(), 0.0);
}
@@ -952,6 +965,62 @@ void tst_Drawer::flickable()
QVERIFY(!flickable->isDragging());
}
+void tst_Drawer::dragOverModalShadow_data()
+{
+ QTest::addColumn<bool>("mouse");
+ QTest::newRow("mouse") << true;
+ QTest::newRow("touch") << false;
+}
+
+// QTBUG-60602
+void tst_Drawer::dragOverModalShadow()
+{
+ QFETCH(bool, mouse);
+
+ QQuickApplicationHelper helper(this, QStringLiteral("dragOverModalShadow.qml"));
+ QQuickWindow *window = helper.window;
+ window->show();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+
+ QQuickDrawer *drawer = window->property("drawer").value<QQuickDrawer *>();
+ QVERIFY(drawer);
+
+ QQuickPopup *popup = window->property("popup").value<QQuickPopup *>();
+ QVERIFY(popup);
+
+ popup->open();
+ QVERIFY(popup->isVisible());
+ QVERIFY(!drawer->isVisible());
+
+ const QPoint from(popup->x(), popup->y() + popup->height() + 5);
+ const QPoint to(popup->x() + popup->width(), popup->y() + popup->height() + 5);
+
+ if (mouse)
+ QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, from);
+ else
+ QTest::touchEvent(window, touchDevice.data()).press(0, from);
+ QVERIFY(!drawer->isVisible());
+
+ static const int steps = 10;
+ for (int i = 0; i < steps; ++i) {
+ int x = from.x() + i * qAbs(from.x() - to.x()) / steps;
+ int y = from.y() + i * qAbs(from.y() - to.y()) / steps;
+
+ if (mouse)
+ QTest::mouseMove(window, QPoint(x, y));
+ else
+ QTest::touchEvent(window, touchDevice.data()).move(0, QPoint(x, y));
+ QTest::qWait(1); // avoid infinite velocity
+ QVERIFY(!drawer->isVisible());
+ }
+
+ if (mouse)
+ QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, to);
+ else
+ QTest::touchEvent(window, touchDevice.data()).release(0, to);
+ QVERIFY(!drawer->isVisible());
+}
+
QTEST_MAIN(tst_Drawer)
#include "tst_drawer.moc"