diff options
author | Liang Qi <liang.qi@qt.io> | 2016-11-24 11:49:15 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-11-24 11:49:15 +0100 |
commit | 225c4a724e058851c9a2b4ffe6032b6f84cfd90c (patch) | |
tree | 8a28a9f8ef4d98d9e5536033b911d33c03f8b8c3 | |
parent | 6472d2541c83c1259a99b40216beaf48b56e94b4 (diff) | |
parent | 6f6e073815d5b05aba553b83809fb701541260c6 (diff) |
Merge remote-tracking branch 'origin/5.7.1' into 5.7
Change-Id: I74c00c0b5c36cc96db8bdbd7c1c2a77d6e37d6e7
-rw-r--r-- | dist/changes-5.7.1 | 196 | ||||
-rw-r--r-- | src/quicktemplates2/qquickoverlay.cpp | 17 | ||||
-rw-r--r-- | src/quicktemplates2/qquickoverlay_p_p.h | 1 | ||||
-rw-r--r-- | tests/auto/popup/data/grabber.qml | 70 | ||||
-rw-r--r-- | tests/auto/popup/tst_popup.cpp | 52 |
5 files changed, 331 insertions, 5 deletions
diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1 new file mode 100644 index 00000000..a206118e --- /dev/null +++ b/dist/changes-5.7.1 @@ -0,0 +1,196 @@ +Qt 5.7.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.7.0. + +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.7 series is binary compatible with the 5.6.x series. +Applications compiled for 5.6 will continue to run with 5.7. + +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 * +**************************************************************************** + + - AbstractButton, Control, and Container now calculate their implicit size + based on the implicit size of the content item plus paddings, and the + implicit size of the background item. This makes it convenient to implement + custom controls and buttons, because the implicit size calculation for + these abstract/non-visual base types works as expected out of the box, but + may cause surprises if an application relies on the old behavior that a + custom control does not have any implicit size by default. + + - Drawers have been changed to follow the same visibility rules than all + other types of popups do. This means that drawers no longer stay visible + at the window edge in order to intercept input events, because that caused + severe conflicts in input handling and stacking order between multiple + drawers and other popups. + + - Popups have been fixed to respect explicitly set width and height. + Previously, explicitly set size was accidentally ignored when a popup had + implicit size set. + +**************************************************************************** +* Controls * +**************************************************************************** + + - ApplicationWindow: + * [QTBUG-55143] Fixed the content layout to take header and footer + visibility into account. + + - ComboBox: + * [QTBUG-54573] Fixed a bug which caused ghost items, from outside the + popup's visible area, to appear in the popup. + * [QTBUG-55118] Fixed the display text to be properly updated on model + changes. + * [QTBUG-55050] Fixed the default delegates to respect the popup width. + * [QTBUG-55030] Fixed the highlighted item to be visible in the popup when + it is opened. + + - Control: + * [QTBUG-56007] Fixed the hovered state to get cleared when hidden. + + - Dial: + * [QTBUG-55228] Fixed step size and snap mode handling with ranges starting + from a non-zero value. + + - Drawer: + * [QTBUG-54578] Fixed a closed drawer to not peek out from the window edge + while resizing the window. + * [QTBUG-54629] Fixed a bug in drag margin handling that allowed the user + to sometimes drag out the drawer even if dragging was disabled. + * Fixed a bug in the calculation of swipe velocity. + * [QTBUG-54800] Fixed conflicts between multiple drawers. + * [QTBUG-54794][QTBUG-55022] Fixed conflicts between drawers and other + popups. + * [QTBUG-55703] Fixed the stacking order of multiple drawers and popups. + * [QTBUG-55995] Fixed flickering on touch release. + * [QTBUG-55360] Made it possible to control the vertical position of + a horizontal drawer, and vice versa. This allows placing a drawer below + a header/toolbar, for instance. + + - Page: + * [QTBUG-55143] Fixed the content layout to take header and footer + visibility into account. + + - RangeSlider: + * [QTBUG-55015] Fixed step size and snap mode handling with ranges starting + from a non-zero value. + + - Slider: + * [QTBUG-54140] Fixed step size and snap mode handling with ranges starting + from a non-zero value. + + - Popup: + * [QTBUG-56025] Fixed to respect explicitly set width and height. + * [QTBUG-53419] Fixed hover events to not leak through popups or modal + background dimming. + * [QTBUG-55004] Fixed popups to appear above the QML-based dialogs from + QtQuick.Dialogs 1.x. + * [QTBUG-55347] Fixed a crash on dynamic parent item changes. + * [QTBUG-54797] Fixed the background dimming to update accordingly on + dynamic changes to the dim and modal properties. + * [QTBUG-55729] Fixed popups to close on touch events when using a plain + Window instead of ApplicationWindow. + * [QTBUG-54913] Fixed hover event delivery with plain Window. + * [QTBUG-55769] Fixed wheel events to not leak through modal background + dimming. + + - ScrollIndicator: + * [QTBUG-55620] Fixed to respect the paddings when overshooting, so that + the indicator doesn't move outside the bounds of the attached flickable. + + - SpinBox: + * [QTBUG-56215] Fixed valueFromText() to not get called for non-editable + spinboxes. + + - StackView: + * Fixed the "unknown argument" warning when popping down to the current + item. + * [QTBUG-54552] Fixed to claim ownership of dynamically created items. + * [QTBUG-56158] Fixed a crash in pop() when attempting to pop an item that + is still activating from a previous popup. + * [QTBUG-55749] Allowed loading remote URLs. + + - SwipeDelegate: + * [QTBUG-54648] Fixed the use of buttons or other interactive controls at + the sides or behind the delegate. + * [QTBUG-54660][QTBUG-54780] Fixed content re-layouting issues. + * [QTBUG-55040] Added a warning for conflicting anchors. + + - Switch: + * [QTBUG-55647] Fixed focus on tap/click over the handle. + * Fixed missing pressed() and released() signals. + * Fixed dragging of the handle on touch. + + - SwitchDelegate: + * Made the handle draggable. + + - TabBar: + * [QTBUG-55129] Fixed a bug which caused ghost items, from outside the + tabbar's visible area, to appear in the tabbar. + * [QTBUG-55129] Improved the behavior of flickable tabs. + * [QTBUG-56265] Fixed mixing of fixed and implicitly resized tabs. + * Fixed to re-layout as appropriate when tabs are resized at run-time. + + - TabButton: + * [QTBUG-55129] Fixed implicit width calculation. + + - TextArea: + * [QTBUG-54615] Fixed mouse double click to select a word. + * [QTBUG-54897] Fixed to not intercept input events outside the visual + bounds when attached to a Flickable. + * Set a caret or ibeam mouse cursor, indicating that the control can accept + and display text input. + + - TextField: + * [QTBUG-54615] Fixed mouse double click to select a word. + * Set a caret or ibeam mouse cursor, indicating that the control can accept + and display text input. + * [QTBUG-55684] Improved the implicit size calculation. + + - ToolTip: + * Fixed the shared tooltip instance to get destructed when the associated + QML engine is destructed. + * [QTBUG-55347] Fixed attached properties to apply to the shared tooltip + instance only when the shared tooltip is visible for the respective item + that the property is attached to. + * [QTBUG-54206] Fixed a bug that caused the shared tooltip to sometimes + fade out when it should stay visible. + * [QTBUG-55572] Fixed delay and visibility handling for standlone tooltips. + +Material +-------- + + - Fixed (optional) elevation effects for Frame, GroupBox, Pane, and TabBar. + - Fixed SpinBox text color in disabled state. + - [QTBUG-54269] Added documentation for Material.Shade and the related + parameter of Material.color(). + - [QTBUG-54935] Fixed white text on white background in ComboBox that is + placed in a ToolBar. + - [QTBUG-54472] Fixed rendering issues with multiple BusyIndicators. + - [QTBUG-55366] Fixed the default foreground and background colors read from + :/qtquickcontrols2.conf or environment variables. + - [QTBUG-55687] Fixed several issues with accent and background inheritance. + - Fixed the accent color, where the shade depends on the theme, to update as + appropriate on run-time theme changes. + - [QTBUG-52631] Fixed style inheritance issues with popups. + - [QTBUG-53266] Fixed the background color of dialogs in the dark theme. + - Fixed text cursor blink period. + +Universal +--------- + + - Fixed Dial press effect. + - [QTBUG-52738] Fixed editor colors in the dark theme. + - [QTBUG-55366] Fixed the default foreground and background colors read from + :/qtquickcontrols2.conf or environment variables. diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index ba0dfc46..4a95244f 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -193,6 +193,13 @@ void QQuickOverlayPrivate::removePopup(QQuickPopup *popup) q->setVisible(!allDrawers.isEmpty() || !q->childItems().isEmpty()); } +void QQuickOverlayPrivate::setMouseGrabberPopup(QQuickPopup *popup) +{ + if (popup && !popup->isVisible()) + popup = nullptr; + mouseGrabberPopup = popup; +} + QQuickOverlay::QQuickOverlay(QQuickItem *parent) : QQuickItem(*(new QQuickOverlayPrivate), parent) { @@ -326,7 +333,7 @@ void QQuickOverlay::mousePressEvent(QMouseEvent *event) for (QQuickDrawer *drawer : drawers) { QQuickDrawerPrivate *p = QQuickDrawerPrivate::get(drawer); if (p->startDrag(window(), event)) { - d->mouseGrabberPopup = drawer; + d->setMouseGrabberPopup(drawer); return; } } @@ -336,7 +343,7 @@ void QQuickOverlay::mousePressEvent(QMouseEvent *event) const auto popups = d->stackingOrderPopups(); for (QQuickPopup *popup : popups) { if (popup->overlayEvent(this, event)) { - d->mouseGrabberPopup = popup; + d->setMouseGrabberPopup(popup); return; } } @@ -359,7 +366,7 @@ void QQuickOverlay::mouseReleaseEvent(QMouseEvent *event) if (d->mouseGrabberPopup) { d->mouseGrabberPopup->overlayEvent(this, event); - d->mouseGrabberPopup = nullptr; + d->setMouseGrabberPopup(nullptr); } else { const auto popups = d->stackingOrderPopups(); for (QQuickPopup *popup : popups) { @@ -405,7 +412,7 @@ bool QQuickOverlay::childMouseEventFilter(QQuickItem *item, QEvent *event) case QEvent::MouseButtonPress: emit pressed(); if (popup->overlayEvent(item, event)) { - d->mouseGrabberPopup = popup; + d->setMouseGrabberPopup(popup); return true; } break; @@ -413,7 +420,7 @@ bool QQuickOverlay::childMouseEventFilter(QQuickItem *item, QEvent *event) return popup->overlayEvent(item, event); case QEvent::MouseButtonRelease: emit released(); - d->mouseGrabberPopup = nullptr; + d->setMouseGrabberPopup(nullptr); return popup->overlayEvent(item, event); default: break; diff --git a/src/quicktemplates2/qquickoverlay_p_p.h b/src/quicktemplates2/qquickoverlay_p_p.h index 6201908e..6e72b39a 100644 --- a/src/quicktemplates2/qquickoverlay_p_p.h +++ b/src/quicktemplates2/qquickoverlay_p_p.h @@ -72,6 +72,7 @@ public: void addPopup(QQuickPopup *popup); void removePopup(QQuickPopup *popup); + void setMouseGrabberPopup(QQuickPopup *popup); void popupAboutToShow(); void popupAboutToHide(); diff --git a/tests/auto/popup/data/grabber.qml b/tests/auto/popup/data/grabber.qml new file mode 100644 index 00000000..6cd5f765 --- /dev/null +++ b/tests/auto/popup/data/grabber.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.6 +import QtQuick.Controls 2.0 + +ApplicationWindow { + width: 400 + height: 400 + + property alias menu: menu + property alias popup: popup + property alias combo: combo.popup + + Menu { + id: menu + MenuItem { + onTriggered: popup.open() + } + } + + Popup { + id: popup + modal: true + width: 200 + height: 200 + + ComboBox { + id: combo + model: 3 + } + } +} diff --git a/tests/auto/popup/tst_popup.cpp b/tests/auto/popup/tst_popup.cpp index af6ccf34..fbd0605b 100644 --- a/tests/auto/popup/tst_popup.cpp +++ b/tests/auto/popup/tst_popup.cpp @@ -71,6 +71,7 @@ private slots: void wheel(); void parentDestroyed(); void nested(); + void grabber(); }; void tst_popup::visible_data() @@ -669,6 +670,57 @@ void tst_popup::nested() QCOMPARE(modalPopup->isVisible(), true); } +// QTBUG-56697 +void tst_popup::grabber() +{ + QQuickApplicationHelper helper(this, QStringLiteral("grabber.qml")); + QQuickWindow *window = helper.window; + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + QQuickPopup *menu = window->property("menu").value<QQuickPopup *>(); + QVERIFY(menu); + + QQuickPopup *popup = window->property("popup").value<QQuickPopup *>(); + QVERIFY(popup); + + QQuickPopup *combo = window->property("combo").value<QQuickPopup *>(); + QVERIFY(combo); + + menu->open(); + QCOMPARE(menu->isVisible(), true); + QCOMPARE(popup->isVisible(), false); + QCOMPARE(combo->isVisible(), false); + + // click a menu item to open the popup + QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, QPoint(menu->width() / 2, menu->height() / 2)); + QCOMPARE(menu->isVisible(), false); + QCOMPARE(popup->isVisible(), true); + QCOMPARE(combo->isVisible(), false); + + combo->open(); + QCOMPARE(menu->isVisible(), false); + QCOMPARE(popup->isVisible(), true); + QCOMPARE(combo->isVisible(), true); + + // click outside to close both the combo popup and the parent popup + QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, QPoint(window->width() - 1, window->height() - 1)); + QCOMPARE(menu->isVisible(), false); + QCOMPARE(popup->isVisible(), false); + QCOMPARE(combo->isVisible(), false); + + menu->open(); + QCOMPARE(menu->isVisible(), true); + QCOMPARE(popup->isVisible(), false); + QCOMPARE(combo->isVisible(), false); + + // click outside the menu to close it (QTBUG-56697) + QTest::mouseClick(window, Qt::LeftButton, Qt::NoModifier, QPoint(window->width() - 1, window->height() - 1)); + QCOMPARE(menu->isVisible(), false); + QCOMPARE(popup->isVisible(), false); + QCOMPARE(combo->isVisible(), false); +} + QTEST_MAIN(tst_popup) #include "tst_popup.moc" |