diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-06 20:40:54 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-06 21:41:33 +0200 |
commit | 026353c74a6343281045d42e717cd67e52aaf24c (patch) | |
tree | 1ad36ce6a7e57d10df808715981bf07c9a6462d6 | |
parent | 0385c432962418431ec5fb4a80d57a5dd9926c6e (diff) | |
parent | 6b23b6b4507b42a96fb3fb7d2315523f54ce1ac0 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Fusion style ComboBox popup height was adjusted according to 90a0d402
to make tst_controls::ComboBox::test_emptyPopupAfterModelCleared pass
with the Fusion style.
Conflicts:
src/imports/controls/ComboBox.qml
src/imports/controls/material/ComboBox.qml
src/imports/controls/universal/ComboBox.qml
Change-Id: I2bad826dc56de9d8952ea2a9ace950c7cf3cbc58
65 files changed, 1107 insertions, 184 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 Binary files differnew file mode 100644 index 00000000..6f6b2e3c --- /dev/null +++ b/examples/quickcontrols2/wearable/images/back@2x.png diff --git a/examples/quickcontrols2/wearable/images/back@3x.png b/examples/quickcontrols2/wearable/images/back@3x.png Binary files differnew file mode 100644 index 00000000..f51847d0 --- /dev/null +++ b/examples/quickcontrols2/wearable/images/back@3x.png diff --git a/examples/quickcontrols2/wearable/images/back@4x.png b/examples/quickcontrols2/wearable/images/back@4x.png Binary files differnew file mode 100644 index 00000000..4060f8fa --- /dev/null +++ b/examples/quickcontrols2/wearable/images/back@4x.png diff --git a/examples/quickcontrols2/wearable/images/home@2x.png b/examples/quickcontrols2/wearable/images/home@2x.png Binary files differnew file mode 100644 index 00000000..dd9f4605 --- /dev/null +++ b/examples/quickcontrols2/wearable/images/home@2x.png diff --git a/examples/quickcontrols2/wearable/images/home@3x.png b/examples/quickcontrols2/wearable/images/home@3x.png Binary files differnew file mode 100644 index 00000000..9276ceb4 --- /dev/null +++ b/examples/quickcontrols2/wearable/images/home@3x.png diff --git a/examples/quickcontrols2/wearable/images/home@4x.png b/examples/quickcontrols2/wearable/images/home@4x.png Binary files differnew file mode 100644 index 00000000..bd1245d9 --- /dev/null +++ b/examples/quickcontrols2/wearable/images/home@4x.png diff --git a/examples/quickcontrols2/wearable/qml/Alarms/images/alarms@2x.png b/examples/quickcontrols2/wearable/qml/Alarms/images/alarms@2x.png Binary files differnew file mode 100644 index 00000000..ba68519a --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Alarms/images/alarms@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/fitness@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/fitness@2x.png Binary files differnew file mode 100644 index 00000000..088c15b8 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Fitness/images/fitness@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png Binary files differnew file mode 100644 index 00000000..2073d97f --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-running@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png Binary files differnew file mode 100644 index 00000000..037a8f03 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Fitness/images/man-walking@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/end@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/end@2x.png Binary files differnew file mode 100644 index 00000000..d5fbe17d --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/images/end@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png Binary files differnew file mode 100644 index 00000000..39e9be84 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/images/leftturn@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png Binary files differnew file mode 100644 index 00000000..8d133abc --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/images/navigation@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png Binary files differnew file mode 100644 index 00000000..258c4144 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/images/rightturn@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/start@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/start@2x.png Binary files differnew file mode 100644 index 00000000..2e577df4 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/images/start@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png Binary files differnew file mode 100644 index 00000000..ef71ab1b --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/images/straight@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Navigation/images/uturn@2x.png b/examples/quickcontrols2/wearable/qml/Navigation/images/uturn@2x.png Binary files differnew file mode 100644 index 00000000..8419b5e1 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Navigation/images/uturn@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png Binary files differnew file mode 100644 index 00000000..2c916b2c --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarf@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png Binary files differnew file mode 100644 index 00000000..d30eb2d2 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Notifications/images/avatarm@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png Binary files differnew file mode 100644 index 00000000..d28e62c5 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Notifications/images/missedcall@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Notifications/images/notifications@2x.png b/examples/quickcontrols2/wearable/qml/Notifications/images/notifications@2x.png Binary files differnew file mode 100644 index 00000000..c3b284ed --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Notifications/images/notifications@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png Binary files differnew file mode 100644 index 00000000..276d7337 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/bluetooth@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png Binary files differnew file mode 100644 index 00000000..94753ea6 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/brightness@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png Binary files differnew file mode 100644 index 00000000..92e112f9 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/contrast@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/settings@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/settings@2x.png Binary files differnew file mode 100644 index 00000000..a24a1df7 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/settings@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png b/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png Binary files differnew file mode 100644 index 00000000..8aa4c9a8 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Settings/images/wifi@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png Binary files differnew file mode 100644 index 00000000..5c367a3e --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/images/humidity@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png Binary files differnew file mode 100644 index 00000000..14c1cab3 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/images/pressure@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png Binary files differnew file mode 100644 index 00000000..3a7892eb --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunrise@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png Binary files differnew file mode 100644 index 00000000..39aeebe5 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/images/sunset@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png Binary files differnew file mode 100644 index 00000000..0b4340ce --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/images/temperature@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/weather@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/weather@2x.png Binary files differnew file mode 100644 index 00000000..6e4ce2f3 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/images/weather@2x.png diff --git a/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png b/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png Binary files differnew file mode 100644 index 00000000..bab49c04 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/Weather/images/wind@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/center@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/center@2x.png Binary files differnew file mode 100644 index 00000000..34ad1900 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/center@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/clock-night@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/clock-night@2x.png Binary files differnew file mode 100644 index 00000000..75456795 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/clock-night@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/second@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/second@2x.png Binary files differnew file mode 100644 index 00000000..689a01be --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/second@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdaydial@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdaydial@2x.png Binary files differnew file mode 100644 index 00000000..95cb75b6 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdaydial@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayhour@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayhour@2x.png Binary files differnew file mode 100644 index 00000000..2fb6feac --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayhour@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayminute@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayminute@2x.png Binary files differnew file mode 100644 index 00000000..a7c55d4e --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissdayminute@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightdial@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightdial@2x.png Binary files differnew file mode 100644 index 00000000..86ecf5ad --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightdial@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnighthour@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnighthour@2x.png Binary files differnew file mode 100644 index 00000000..a37e0d12 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnighthour@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightminute@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightminute@2x.png Binary files differnew file mode 100644 index 00000000..627cca9c --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/swissnightminute@2x.png diff --git a/examples/quickcontrols2/wearable/qml/WorldClock/images/worldclock@2x.png b/examples/quickcontrols2/wearable/qml/WorldClock/images/worldclock@2x.png Binary files differnew file mode 100644 index 00000000..03abe162 --- /dev/null +++ b/examples/quickcontrols2/wearable/qml/WorldClock/images/worldclock@2x.png 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/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 8442ec79..a3735880 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T @@ -111,7 +112,7 @@ T.ComboBox { popup: T.Popup { y: control.height width: control.width - implicitHeight: contentItem.implicitHeight + height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) topMargin: 6 bottomMargin: 6 diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.png b/src/imports/controls/doc/images/qtquickcontrols2-popup.png Binary files differindex 4514948d..a0bc3d8c 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-popup.png +++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.png diff --git a/src/imports/controls/doc/images/qtquickcontrols2-popup.svg b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg index 1d78addf..91bde0c5 100644 --- a/src/imports/controls/doc/images/qtquickcontrols2-popup.svg +++ b/src/imports/controls/doc/images/qtquickcontrols2-popup.svg @@ -9,12 +9,12 @@ 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" + width="817.22076" + height="605.42444" + viewBox="0 0 766.14443 567.58541" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r15371" sodipodi:docname="qtquickcontrols2-popup.svg" inkscape:export-xdpi="90" inkscape:export-ydpi="90"> @@ -30,9 +30,9 @@ 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)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -45,9 +45,9 @@ 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)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -60,8 +60,8 @@ 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" + d="M 0,0 5,-5 -12.5,0 5,5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" transform="matrix(0.4,0,0,0.4,4,0)" inkscape:connector-curvature="0" /> </marker> @@ -77,7 +77,7 @@ 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)" + transform="scale(-0.6)" inkscape:connector-curvature="0" /> </marker> <marker @@ -91,9 +91,9 @@ <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)" /> + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> </marker> <marker inkscape:stockid="TriangleOutL" @@ -106,9 +106,9 @@ <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)" /> + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> </marker> <marker inkscape:stockid="TriangleInL" @@ -120,9 +120,9 @@ 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)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -135,9 +135,9 @@ 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)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -150,9 +150,9 @@ 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)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" inkscape:connector-curvature="0" /> </marker> <marker @@ -165,11 +165,161 @@ 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)" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" inkscape:connector-curvature="0" /> </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-5" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-17" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-7-1" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-5-2" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-4-3" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-17-4" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-3" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-7-1-4" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4318-5-2-3" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-4-3-5" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path4327-17-4-6" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" + inkscape:connector-curvature="0" /> + </marker> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL-2-4-7" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4318-4-7-4" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL-9-3-6" + style="overflow:visible" + inkscape:isstock="true"> + <path + inkscape:connector-curvature="0" + id="path4327-1-1-5" + d="M 5.77,0 -2.88,5 V -5 Z" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" + transform="scale(0.8)" /> + </marker> </defs> <sodipodi:namedview id="base" @@ -178,21 +328,21 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.4" - inkscape:cx="359.69451" - inkscape:cy="143.84745" + inkscape:zoom="1" + inkscape:cx="433.56809" + inkscape:cy="282.4206" 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-height="1137" + inkscape:window-x="-8" + inkscape:window-y="-8" inkscape:window-maximized="1" - fit-margin-top="0" - fit-margin-left="0" - fit-margin-right="0" - fit-margin-bottom="0" + fit-margin-top="1" + fit-margin-left="1" + fit-margin-right="1" + fit-margin-bottom="1" units="px" /> <metadata id="metadata7"> @@ -202,7 +352,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -210,19 +360,19 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(91.482322,-255.11685)"> + transform="translate(117.89629,-192.1482)"> <rect - style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="fill:#cccccc;fill-opacity:1;stroke:#000000;stroke-width:1.21129668;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="rect4136" - width="564.41473" - height="248.82799" - x="-30.289024" - y="321.69858" /> + width="564.20264" + height="365.80341" + x="-21.075951" + y="321.69159" /> <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 + style="font-style:normal;font-weight:normal;line-height:0.01%;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,28.907253,-141.43255)"><flowRegion id="flowRegion4140"><rect id="rect4142" width="129.78784" @@ -230,55 +380,65 @@ 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="flowPara4146" + style="font-size:19.24691807px;line-height:1.25">Background</flowPara></flowRoot> <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:32.28859329;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.58381503" id="rect4148" - width="464.22452" - height="165.94499" - x="18.895706" - y="364.74274" /> + width="432.17508" + height="243.95665" + x="44.027798" + y="384.97104" /> <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 + style="font-style:normal;font-weight:normal;line-height:0.01%;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;font-size:37.45019655px;" + transform="matrix(0.6007979,0,0,0.6007979,156.36974,204.3766)"><flowRegion + id="flowRegion4140-6" + style="font-size:37.45019655px;"><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" /> + style="font-size:37.45019655px;fill:#000000;" /></flowRegion><flowPara + id="flowPara4146-6" + style="font-size:37.45019655px;line-height:1.25;">Content item</flowPara></flowRoot> <g + id="g8534" + transform="translate(3.75)"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179" + d="M 53.000835,594.60056 V 394.41764" + 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)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,35.985339,191.89348)" + style="font-style:normal;font-weight:normal;line-height:0.01%;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" + id="flowRoot4138-6-2" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6"><rect + style="font-size:20px;fill:#000000" + y="481.62601" + x="42.426407" + height="101.01524" + width="117.17769" + id="rect4142-6-1" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;fill:#000000" + id="flowPara9732">Available height</flowPara></flowRoot> </g> + <g + id="g8545"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-7" + d="M 56.564013,608.03247 H 464.47744" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.91225624;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)" /> + </g> <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 + style="font-style:normal;font-weight:normal;line-height:0.01%;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.5748758,0,0,0.59339159,197.89365,327.81679)"><flowRegion id="flowRegion4140-6-6-4"><rect id="rect4142-6-1-4" width="252.53812" @@ -286,60 +446,70 @@ 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" /> + style="font-size:17.5px;line-height:1.25;fill:#000000" + id="flowPara10048">Available width</flowPara></flowRoot> <g + id="g7654" + transform="translate(0,118.125)"> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,220.10057,300.85594)" + style="font-style:normal;font-weight:normal;line-height:0.01%;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" + id="flowRoot4138-6-1" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-9"><rect + style="font-size:25px;fill:#000000" + y="481.62601" + x="42.426407" + height="68.690361" + width="270.72089" + id="rect4142-6-0" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25" + id="flowPara4146-6-2">Width</flowPara></flowRoot> <path + inkscape:connector-curvature="0" + id="path4179-8" + d="M -17.415118,583.15841 H 539.87757" + 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)" /> + </g> + <g + id="g7868"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-9" + d="M -34.354631,681.50532 V 326.43762" + 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)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,-102.8965,207.92708)" + style="font-style:normal;font-weight:normal;line-height:0.01%;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" + id="flowRoot4138-6-1-7" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-9-7"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="68.690361" + width="270.72089" + id="rect4142-6-0-5" /></flowRegion><flowPara + style="font-size:17.5px;line-height:1.25;fill:#000000" + id="flowPara4146-6-2-9">Height</flowPara></flowRoot> </g> <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 + style="font-style:normal;font-weight:normal;font-size:54.09472656px;line-height:0.01%;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,189.12753,-15.52439)"><flowRegion + id="flowRegion4140-6-67" + style="font-size:54.09472656px"><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 + style="font-size:54.09472656px;fill:#000000" /></flowRegion><flowPara + id="flowPara4146-6-3" + style="font-size:54.09472656px;line-height:1.25">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 + style="font-style:normal;font-weight:normal;line-height:0.01%;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.38009,362.34499)"><flowRegion id="flowRegion4140-6-6-4-6"><rect id="rect4142-6-1-4-2" width="252.53812" @@ -347,12 +517,12 @@ x="42.426407" y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" + style="font-size:17.5px;line-height:1.25;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 + style="font-style:normal;font-weight:normal;line-height:0.01%;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,203.99672,59.935343)"><flowRegion id="flowRegion4140-6-6-4-6-2"><rect id="rect4142-6-1-4-2-7" width="252.53812" @@ -360,12 +530,12 @@ x="42.426407" y="481.62601" style="font-size:17.5px;fill:#000000" /></flowRegion><flowPara - style="font-size:17.5px;fill:#000000" + style="font-size:17.5px;line-height:1.25;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 + style="font-style:normal;font-weight:normal;line-height:0.01%;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,459.4147,204.33375)"><flowRegion id="flowRegion4140-6-6-4-6-3"><rect id="rect4142-6-1-4-2-6" width="81.109558" @@ -377,8 +547,8 @@ 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 + style="font-style:normal;font-weight:normal;line-height:0.01%;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,-38.128181,202.36202)"><flowRegion id="flowRegion4140-6-6-4-6-3-5"><rect id="rect4142-6-1-4-2-6-4" width="81.109558" @@ -387,5 +557,115 @@ 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> + id="flowPara4386-0">Left padding</flowPara></flowRoot> <rect + style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.09440184;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4757" + width="763.17505" + height="514.7428" + x="-116.41159" + y="243.5061" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-3-4" + style="font-style:normal;font-weight:normal;font-size:59.99999619px;line-height:0.01%;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,175.59116,-90.52439)"><flowRegion + id="flowRegion4140-6-67-2" + style="font-size:59.99999619px"><rect + id="rect4142-6-5-4" + width="334.36047" + height="80.812172" + x="42.426407" + y="481.62601" + style="font-size:59.99999619px;fill:#000000" /></flowRegion><flowPara + id="flowPara4146-6-3-0" + style="font-size:54.09472656px;line-height:1.25">Window</flowPara></flowRoot> <g + id="g5624" + transform="translate(0,116.25)"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-98" + d="M 562.38606,632.48202 V 575.7366" + 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-7);marker-end:url(#TriangleOutL-4)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,549.95467,303.47098)" + style="font-style:normal;font-weight:normal;line-height:0.01%;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" + id="flowRoot4138-6-2-7-5-9-1" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6-4-6-3-2"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="93.762154" + width="81.109558" + id="rect4142-6-1-4-2-6-9" /></flowRegion><flowPara + id="flowPara5598" + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Bottom margin</flowPara></flowRoot> </g> + <g + id="g5669" + transform="translate(-9.0164,-96.197039)"> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-98-8" + d="M 571.40246,409.73194 V 352.98652" + 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-7-1);marker-end:url(#TriangleOutL-4-3)" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,558.97106,80.720903)" + style="font-style:normal;font-weight:normal;line-height:0.01%;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" + id="flowRoot4138-6-2-7-5-9-1-8" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6-4-6-3-2-8"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="93.762154" + width="81.109558" + id="rect4142-6-1-4-2-6-9-2" /></flowRegion><flowPara + id="flowPara5598-6" + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Top margin</flowPara></flowRoot> </g> + <g + id="g7367" + transform="translate(32.877167,129.04286)"> + <path + transform="translate(-32.87717,-4.3906312)" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839908;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-4);marker-end:url(#TriangleOutL-9-3)" + d="m 558.40434,364.18736 h 70.4038" + id="path4179-7-5" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <flowRoot + transform="matrix(0.6007979,0,0,0.6007979,510.85405,81.658403)" + style="font-style:normal;font-weight:normal;line-height:0.01%;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" + id="flowRoot4138-6-2-7-5-9-1-8-0" + xml:space="preserve"><flowRegion + id="flowRegion4140-6-6-4-6-3-2-8-5"><rect + style="font-size:17.5px;fill:#000000" + y="481.62601" + x="42.426407" + height="93.762154" + width="81.109558" + id="rect4142-6-1-4-2-6-9-2-6" /></flowRegion><flowPara + id="flowPara5598-6-1" + style="font-size:17.5px;line-height:125%;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#000000">Right margin</flowPara></flowRoot> </g> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path4179-7-5-2" + d="m -96.90814,305.30865 h 70.4038" + style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.93839908;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-start:url(#TriangleInL-2-4-7);marker-end:url(#TriangleOutL-9-3-6)" /> + <flowRoot + xml:space="preserve" + id="flowRoot4138-6-2-7-5-9-1-8-0-4" + style="font-style:normal;font-weight:normal;line-height:0.01%;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,-111.58126,-21.57968)"><flowRegion + id="flowRegion4140-6-6-4-6-3-2-8-5-3"><rect + id="rect4142-6-1-4-2-6-9-2-6-0" + 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="flowPara5598-6-1-4">Left margin</flowPara></flowRoot> </g> </svg> diff --git a/src/imports/controls/fusion/ComboBox.qml b/src/imports/controls/fusion/ComboBox.qml index 6e02cbc3..3244678a 100644 --- a/src/imports/controls/fusion/ComboBox.qml +++ b/src/imports/controls/fusion/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Templates 2.3 as T import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 @@ -142,7 +143,7 @@ T.ComboBox { popup: T.Popup { id: popup width: control.width - implicitHeight: contentItem.implicitHeight + 2 + height: Math.min(contentItem.implicitHeight + 2, control.Window.height - topMargin - bottomMargin) topMargin: 6 bottomMargin: 6 palette: control.palette diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 55afdb3f..57d5a61b 100644 --- a/src/imports/controls/material/ComboBox.qml +++ b/src/imports/controls/material/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T @@ -136,7 +137,7 @@ T.ComboBox { popup: T.Popup { y: control.editable ? control.height - 5 : 0 width: control.width - implicitHeight: contentItem.implicitHeight + height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) transformOrigin: Item.Top topMargin: 12 bottomMargin: 12 diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index 35c4d815..1888f8d4 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -35,6 +35,7 @@ ****************************************************************************/ import QtQuick 2.9 +import QtQuick.Window 2.3 import QtQuick.Controls 2.3 import QtQuick.Controls.impl 2.3 import QtQuick.Templates 2.3 as T @@ -132,7 +133,7 @@ T.ComboBox { popup: T.Popup { width: control.width - implicitHeight: Math.min(396, contentItem.implicitHeight) + height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) topMargin: 8 bottomMargin: 8 diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp index 7ba68f81..a6f9f6ca 100644 --- a/src/quicktemplates2/qquickcombobox.cpp +++ b/src/quicktemplates2/qquickcombobox.cpp @@ -705,7 +705,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 de8539c9..38284332 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/qquickpage.cpp b/src/quicktemplates2/qquickpage.cpp index 6137a7e8..40d47cda 100644 --- a/src/quicktemplates2/qquickpage.cpp +++ b/src/quicktemplates2/qquickpage.cpp @@ -329,6 +329,13 @@ QQmlListProperty<QQuickItem> QQuickPage::contentChildren() QQuickItemPrivate::children_clear); } +void QQuickPage::componentComplete() +{ + Q_D(QQuickPage); + QQuickControl::componentComplete(); + d->layout->update(); +} + void QQuickPage::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) { QQuickControl::contentItemChange(newItem, oldItem); diff --git a/src/quicktemplates2/qquickpage_p.h b/src/quicktemplates2/qquickpage_p.h index 90d10e4a..1b14588a 100644 --- a/src/quicktemplates2/qquickpage_p.h +++ b/src/quicktemplates2/qquickpage_p.h @@ -97,6 +97,8 @@ Q_SIGNALS: void contentChildrenChanged(); protected: + void componentComplete() override; + void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override; void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override; diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 543a6f34..840b9f19 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE \section1 Popup Layout - The following diagram illustrates the layout of a typical popup: + The following diagram illustrates the layout of a popup within a window: \image qtquickcontrols2-popup.png @@ -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; } @@ -986,12 +986,13 @@ void QQuickPopup::resetSpacing() /*! \qmlproperty real QtQuick.Controls::Popup::margins - This property holds the default margins around the popup. + This property holds the distance between the edges of the popup and the + edges of its window. A popup with negative margins is not pushed within the bounds of the enclosing window. The default value is \c -1. - \sa topMargin, leftMargin, rightMargin, bottomMargin + \sa topMargin, leftMargin, rightMargin, bottomMargin, {Popup Layout} */ qreal QQuickPopup::margins() const { @@ -1027,12 +1028,13 @@ void QQuickPopup::resetMargins() /*! \qmlproperty real QtQuick.Controls::Popup::topMargin - This property holds the top margin around the popup. + This property holds the distance between the top edge of the popup and + the top edge of its window. A popup with a negative top margin is not pushed within the top edge of the enclosing window. The default value is \c -1. - \sa margins, bottomMargin + \sa margins, bottomMargin, {Popup Layout} */ qreal QQuickPopup::topMargin() const { @@ -1057,12 +1059,13 @@ void QQuickPopup::resetTopMargin() /*! \qmlproperty real QtQuick.Controls::Popup::leftMargin - This property holds the left margin around the popup. + This property holds the distance between the left edge of the popup and + the left edge of its window. A popup with a negative left margin is not pushed within the left edge of the enclosing window. The default value is \c -1. - \sa margins, rightMargin + \sa margins, rightMargin, {Popup Layout} */ qreal QQuickPopup::leftMargin() const { @@ -1087,12 +1090,13 @@ void QQuickPopup::resetLeftMargin() /*! \qmlproperty real QtQuick.Controls::Popup::rightMargin - This property holds the right margin around the popup. + This property holds the distance between the right edge of the popup and + the right edge of its window. A popup with a negative right margin is not pushed within the right edge of the enclosing window. The default value is \c -1. - \sa margins, leftMargin + \sa margins, leftMargin, {Popup Layout} */ qreal QQuickPopup::rightMargin() const { @@ -1117,12 +1121,13 @@ void QQuickPopup::resetRightMargin() /*! \qmlproperty real QtQuick.Controls::Popup::bottomMargin - This property holds the bottom margin around the popup. + This property holds the distance between the bottom edge of the popup and + the bottom edge of its window. A popup with a negative bottom margin is not pushed within the bottom edge of the enclosing window. The default value is \c -1. - \sa margins, topMargin + \sa margins, topMargin, {Popup Layout} */ qreal QQuickPopup::bottomMargin() const { diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 39a1d145..4f969106 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -80,6 +80,14 @@ TestCase { } } + function init() { + // QTBUG-61225: Move the mouse away to avoid QQuickWindowPrivate::flushFrameSynchronousEvents() + // delivering interfering hover events based on the last mouse position from earlier tests. For + // example, ComboBox::test_activation() kept receiving hover events for the last mouse position + // from CheckDelegate::test_checked(). + mouseMove(testCase, testCase.width - 1, testCase.height - 1) + } + function test_defaults() { var control = createTemporaryObject(comboBox, testCase) verify(control) @@ -1477,4 +1485,27 @@ TestCase { compare(control.currentIndex, 0) compare(control.currentText, "A") } + + function test_emptyPopupAfterModelCleared() { + var control = createTemporaryObject(comboBox, testCase, { model: 1 }) + verify(control) + compare(control.popup.implicitHeight, 0) + compare(control.popup.height, control.popup.topPadding + control.popup.bottomPadding) + + // Ensure that it's open so that the popup's implicitHeight changes when we increase the model count. + control.popup.open() + tryCompare(control.popup, "visible", true) + + // Add lots of items to the model. The popup should take up the entire height of the window. + control.model = 100 + compare(control.popup.height, control.Window.height - control.popup.topMargin - control.popup.bottomMargin) + + control.popup.close() + + // Clearing the model should result in a zero height. + control.model = 0 + control.popup.open() + tryCompare(control.popup, "visible", true) + compare(control.popup.height, control.popup.topPadding + control.popup.bottomPadding) + } } diff --git a/tests/auto/controls/data/tst_page.qml b/tests/auto/controls/data/tst_page.qml index 60eb02de..2eb11165 100644 --- a/tests/auto/controls/data/tst_page.qml +++ b/tests/auto/controls/data/tst_page.qml @@ -100,6 +100,18 @@ TestCase { } Component { + id: headerFooterPage + Page { + header: ToolBar { } + footer: ToolBar { } + contentItem: Item { + implicitWidth: 100 + implicitHeight: 30 + } + } + } + + Component { id: toolBar ToolBar { } } @@ -262,4 +274,29 @@ TestCase { - (data.header ? control.header.height + control.spacing : 0) - (data.footer ? control.footer.height + control.spacing : 0)) } + + function test_headerFooter() { + var control = createTemporaryObject(headerFooterPage, testCase, {width: 100, height: 100}) + verify(control) + + compare(control.width, 100) + compare(control.height, 100) + + verify(control.header) + compare(control.header.x, 0) + compare(control.header.y, 0) + compare(control.header.width, control.width) + verify(control.header.height > 0) + + verify(control.footer) + compare(control.footer.x, 0) + compare(control.footer.y, control.height - control.footer.height) + compare(control.footer.width, control.width) + verify(control.footer.height > 0) + + compare(control.contentItem.x, 0) + compare(control.contentItem.y, control.header.height) + compare(control.contentItem.width, control.width) + compare(control.contentItem.height, control.height - control.header.height - control.footer.height) + } } 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" |