From 6f076d71e45ffc318169454035297b2882d2a63b Mon Sep 17 00:00:00 2001 From: Jani Heikkinen Date: Thu, 20 Oct 2016 12:46:19 +0300 Subject: Add changes file for 5.7.1 Change-Id: I713bb793a0c4fe423bc8d27d15e0802e9de5a622 Reviewed-by: Mitch Curtis --- dist/changes-5.7.1 | 196 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 dist/changes-5.7.1 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. -- cgit v1.2.3 From 6f6e073815d5b05aba553b83809fb701541260c6 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 24 Oct 2016 13:41:17 +0200 Subject: Fix popups to close on click outside When a popup closes itself on press outside, it accepts the press event so that it doesn't propagate to other popups or the content below. We must make sure that such closing popup does not become the mouse grabber, because it doesn't make sense to route the subsequent mouse events to the popup that was just closed. Change-Id: I80c6e26a1d94aa1526a61862f00af2fd0778aa82 Task-number: QTBUG-56697 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickoverlay.cpp | 17 +++++--- src/quicktemplates2/qquickoverlay_p_p.h | 1 + tests/auto/popup/data/grabber.qml | 70 +++++++++++++++++++++++++++++++++ tests/auto/popup/tst_popup.cpp | 52 ++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 tests/auto/popup/data/grabber.qml 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(); + QVERIFY(menu); + + QQuickPopup *popup = window->property("popup").value(); + QVERIFY(popup); + + QQuickPopup *combo = window->property("combo").value(); + 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" -- cgit v1.2.3 From 6fd334e59cab4ae0cd0c587fe2f64cf302ba1f21 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 Nov 2016 18:23:08 +0100 Subject: remove dependencies from sync.profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the CI obtains them from the qt5 super repo nowadays. Change-Id: Icdcaa7ad856eb493448398f9180ecc4b642262d9 Reviewed-by: Jędrzej Nowacki --- sync.profile | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/sync.profile b/sync.profile index ae91c340..4797a9e3 100644 --- a/sync.profile +++ b/sync.profile @@ -4,17 +4,3 @@ ); %moduleheaders = ( # restrict the module headers to those found in relative path ); -# Module dependencies. -# Every module that is required to build this module should have one entry. -# Each of the module version specifiers can take one of the following values: -# - A specific Git revision. -# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) -# - an empty string to use the same branch under test (dependencies will become "refs/heads/master" if we are in the master branch) -# -%dependencies = ( - "qtbase" => "", - "qtxmlpatterns" => "", - "qtdeclarative" => "", - "qtquickcontrols" => "", - "qtgraphicaleffects" => "" -); -- cgit v1.2.3 From 6472d2541c83c1259a99b40216beaf48b56e94b4 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 23 Nov 2016 16:33:33 +0100 Subject: Doc: clarify the feature comparison table Changing styles at runtime is not possible in QQC2. Add also footnotes that QQC1 may not provide optimal performance on embedded and mobile. Change-Id: Iea691116eacdcf73482ecd52fd1e9c945a788f9a Reviewed-by: Mitch Curtis --- .../doc/src/qtquickcontrols2-differences.qdoc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc index 45ea7db7..a85890f5 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc @@ -109,20 +109,20 @@ \li Yes \li No \row - \li Runtime style changes - \li Yes - \li Yes + \li Runtime style/theme changes + \li Yes \sup 1 + \li Yes \sup 2 \row \li Can be used on Desktop \li Yes - \li Yes \b * + \li Yes \sup 3 \row \li Can be used on Mobile - \li Yes + \li Yes \sup 4 \li Yes \row \li Can be used on Embedded - \li Yes + \li Yes \sup 4 \li Yes \row \li Internal event handling @@ -130,7 +130,12 @@ \li C++ \endtable - \b {* No hover effects} + \list 1 + \li Not officially supported, but technically possible via private APIs + \li Only themes for specific styles can be changed at runtime, styles are fixed + \li No hover effects + \li Performance may not be optimal + \endlist \section2 Porting Qt Quick Controls Code -- cgit v1.2.3 From 52d042e8a0324dbb05fb4f46fb9ea774ec168697 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 24 Nov 2016 15:22:55 +0100 Subject: Doc: refactor the type comparison table Change-Id: I2267dcd15bcbcbdee8708208dc5f92eb69b745d6 Reviewed-by: Mitch Curtis --- .../doc/src/qtquickcontrols2-differences.qdoc | 478 +++++++++++++++++---- 1 file changed, 388 insertions(+), 90 deletions(-) diff --git a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc index 5cb7a9a5..330bee89 100644 --- a/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc +++ b/src/imports/controls/doc/src/qtquickcontrols2-differences.qdoc @@ -179,191 +179,487 @@ This works with both modules, and will reduce the amount of work needed when the migration begins. - \section3 Type Comparison Table + \section2 Type Comparison Table + + The first column lists all types available in \l {Qt Quick Controls} + {Qt Quick Controls 1}, \l {Qt Quick Dialogs}, and \l {Qt Quick Extras}. + The second column documents the respective type in Qt Quick Controls 2. + When a direct alternative is not available, the third column contains + an alternative that provides related functionality. The last column + contains some remarks about the differences between the types in the + different modules. \table \header - \li Qt Quick Controls 1, Qt Quick Extras - \li Qt Quick Controls 2, Qt Labs Calendar - \row - \li \mdash - \li \l [QML QtQuickControls2] {AbstractButton} + \li Qt Quick Controls 1 + \li Qt Quick Controls 2 + \li Alternatives + \li Remarks \row \li \l [QML QtQuickControls] {Action} - \li \span {} {\mdash \nbsp \sub {(see \l [QML QtQuick] {Shortcut} instead)}} + \li \mdash + \li \l [QML QtQuick] {Shortcut} \br\sup {(Qt Quick)} + \li \list + \li \b {Qt Quick Controls 1}: \c Action is an abstract user interface + action that is bound to buttons and menu items, and can provide + shortcuts. + \li \b {Qt Quick}: \c Shortcut provides the shortcut functionality that + was previously only provided by \c Action. + \endlist \row \li \l [QML QtQuickControls] {ApplicationWindow} \li \l [QML QtQuickControls2] {ApplicationWindow} + \li + \li \row \li \l [QML QtQuickControls] {BusyIndicator} \li \l [QML QtQuickControls2] {BusyIndicator} + \li + \li \row \li \l [QML QtQuickControls] {Button} \li \l [QML QtQuickControls2] {Button} + \li + \li \row - \li \l [QML QtQuickExtras] {CircularGauge} + \li \l [QML QtQuickControls] {Calendar} \li \mdash + \li \l [QML QtLabsCalendar] {MonthGrid},\br + \l [QML QtLabsCalendar] {DayOfWeekRow},\br + \l [QML QtLabsCalendar] {WeekNumberColumn} \br\sup {(Qt Labs Calendar)} + \li \list + \li \b {Qt Labs Calendar}: \c MonthGrid, \c DayOfWeek, and \c WeekNumberColumn + are \e experimental unstyled building blocks for calendar views. + \endlist + \row + \li \l [QML QtQuickControls] {CheckBox} + \li \l [QML QtQuickControls2] {CheckBox} + \li + \li \row + \li \l [QML QtQuickControls] {ComboBox} + \li \l [QML QtQuickControls2] {ComboBox} + \li + \li \list + \li \b {Qt Quick Controls 2}: \c ComboBox is not editable. + \endlist + \row + \li \l [QML QtQuickControls] {ExclusiveGroup} \li \mdash - \li \l [QML QtQuickControls2] {Control} + \li \l [QML QtQuickControls2] {ButtonGroup} \br\sup {(Qt Quick Controls 2)} + \li \list + \li \b {Qt Quick Controls 2}: \c ButtonGroup offers similar functionality. + \endlist \row + \li \l [QML QtQuickControls] {GroupBox} + \li \l [QML QtQuickControls2] {GroupBox} + \li + \li + \row + \li \l [QML QtQuickControls] {Label} + \li \l [QML QtQuickControls2] {Label} + \li + \li + \row + \li \l [QML QtQuickControls] {Menu} + \li \l [QML QtQuickControls2] {Menu} + \li \l [QML QtLabsPlatform] {Menu} \br\sup {(Qt Labs Platform)} + \li \list + \li \b {Qt Quick Controls 1}: \c Menu is native on platforms where an + implementation is available in the Qt Platform Abstraction Layer. + Other platforms use a QML-based top-level menu popup window. \c Menu + supports traditional desktop style cascading submenus, but does not + work on Embedded Linux because \l EGLFS does not support multiple + top-level windows. + \li \b {Qt Quick Controls 2}: \c Menu is a non-native \c Item-based popup + that is stacked above the application content. Due to this, menu popups + are restricted within window boundaries. \c Menu is fully customizable + using QML and Qt Quick, and allows adding any \c Items. Traditional + desktop oriented features, such as cascading submenus and visualizing + keyboard shortcuts are missing. + \li \b {Qt Labs Platform}: \c Menu is an \e experimental native menu that + uses Qt Widgets as a fallback on platforms where a native implementation + is not available in the Qt Platform Abstraction Layer. + \endlist + \row + \li \l [QML QtQuickControls] {MenuBar} \li \mdash - \li \l [QML QtQuickControls2] {Container} + \li \l [QML QtLabsPlatform] {MenuBar} \br\sup {(Qt Labs Platform)} + \li \list + \li \b {Qt Quick Controls 1}: \c MenuBar is native on platforms where an + implementation is available in the Qt Platform Abstraction Layer. Other + platforms use a QML-based menubar item stacked at the top of the window. + \li \b {Qt Labs Platform}: \c MenuBar is an \e experimental native menubar. + It is only available on platforms where a native implementation is available + in the Qt Platform Abstraction Layer. + \endlist + \row + \li \l [QML QtQuickControls] {MenuItem},\br + \l [QML QtQuickControls] {MenuSeparator} + \li \l [QML QtQuickControls2] {MenuItem},\br + \l [QML QtQuickControls2] {MenuSeparator} + \li \l [QML QtLabsPlatform] {MenuItem},\br + \l [QML QtLabsPlatform] {MenuSeparator} \br\sup {(Qt Labs Platform)} + \li \list + \li \b {Qt Quick Controls 1}: \c MenuItem and \c MenuSeparator are native + on platforms where an implementation is available in the Qt Platform + Abstraction Layer. Other platforms use QML-based menu items and separators. + \li \b {Qt Quick Controls 2}: \c MenuItem and \c MenuSeparator are a non-native + QML-based menu items and separators that can be fully customized using QML + and Qt Quick. + \li \b {Qt Labs Platform}: \c MenuItem and \c MenuSeparator are \e experimental + native menu items and separators. + \endlist \row - \li \l [QML QtQuickControls] {Calendar} - \li \l [QML QtLabsCalendar] {MonthGrid}, - \l [QML QtLabsCalendar] {DayOfWeekRow}, - \l [QML QtLabsCalendar] {WeekNumberColumn} + \li \l [QML QtQuickControls] {ProgressBar} + \li \l [QML QtQuickControls2] {ProgressBar} + \li + \li \row - \li \l [QML QtQuickControls] {CheckBox} - \li \l [QML QtQuickControls2] {CheckBox} + \li \l [QML QtQuickControls] {RadioButton} + \li \l [QML QtQuickControls2] {RadioButton} + \li + \li \row + \li \l [QML QtQuickControls] {ScrollView} \li \mdash - \li \l [QML QtQuickControls2] {CheckDelegate} + \li \l [QML QtQuickControls2] {ScrollBar},\br + \l [QML QtQuickControls2] {ScrollIndicator} \br\sup {(Qt Quick Controls 2)} + \li \list + \li \b {Qt Quick Controls 2}: \c ScrollBar and \c ScrollIndicator offer + similar functionality. They can be attached to any \c Flickable to + build scrollable views. + \endlist \row - \li \l [QML QtQuickControls] {ComboBox} - \li \l [QML QtQuickControls2] {ComboBox} + \li \l [QML QtQuickControls] {Slider} + \li \l [QML QtQuickControls2] {Slider} + \li + \li \row - \li \l [QML QtQuickExtras] {DelayButton} + \li \l [QML QtQuickControls] {SpinBox} + \li \l [QML QtQuickControls2] {SpinBox} + \li + \li + \row + \li \l [QML QtQuickControls] {SplitView} \li \mdash + \li + \li \row - \li \l [QML QtQuickExtras] {Dial} - \li \l [QML QtQuickControls2] {Dial} + \li \l [QML QtQuickControls] {StackView},\br + \l [QML QtQuickControls] {StackViewDelegate},\br + \l [QML QtQuickControls] {Stack} + \li \l [QML QtQuickControls2] {StackView} + \li + \li \list + \li \b {Qt Quick Controls 2}: \c StackView provides customizable transitions + and attached properties via a single \c StackView type. + \endlist \row + \li \l [QML QtQuickControls] {StatusBar} \li \mdash - \li \l [QML QtQuickControls2] {Drawer} + \li \l [QML QtQuickControls2] {ToolBar} \br\sup {(Qt Quick Controls 2)} + \li \list + \li \b {Qt Quick Controls 2}: \c ApplicationWindow allows assigning any + item or control, such as \c ToolBar, as a header or footer. + \endlist \row - \li \l [QML QtQuickControls] {ExclusiveGroup} - \li \l [QML QtQuickControls2] {ButtonGroup} + \li \l [QML QtQuickControls] {Switch} + \li \l [QML QtQuickControls2] {Switch} + \li + \li \row + \li \l [QML QtQuickControls] {TabView},\br + \l [QML QtQuickControls] {Tab} \li \mdash - \li \l [QML QtQuickControls2] {Frame} + \li \l [QML QtQuickControls2] {TabBar},\br + \l [QML QtQuickControls2] {TabButton} \br\sup {(Qt Quick Controls 2)} + \li \list + \li \b {Qt Quick Controls 2}: \c TabBar and \c TabButton offer similar + functionality, and can be used to build tabbed views. + \endlist \row - \li \l [QML QtQuickExtras] {Gauge} + \li \l [QML QtQuickControls] {TableView} \li \mdash + \li + \li \row - \li \l [QML QtQuickControls] {GroupBox} - \li \l [QML QtQuickControls2] {GroupBox} + \li \l [QML QtQuickControls] {TextArea} + \li \l [QML QtQuickControls2] {TextArea} + \li + \li \list + \li \b {Qt Quick Controls 1}: \c TextArea inherits \c ScrollView and is therefore + always a scrollable editor. + \li \b {Qt Quick Controls 2}: \c TextArea is a simpler multi-line editor that can + be optionally attached to a \c Flickable to provide scrolling functionality. + This allows using \c TextArea in a scrollable page without having two nested + scrollable areas, which can be problematic and cause usability issues. + \endlist \row - \li \mdash - \li \l [QML QtQuickControls2] {ItemDelegate} + \li \l [QML QtQuickControls] {TextField} + \li \l [QML QtQuickControls2] {TextField} + \li + \li \row - \li \l [QML QtQuickControls] {Label} - \li \l [QML QtQuickControls2] {Label} + \li \l [QML QtQuickControls] {ToolBar} + \li \l [QML QtQuickControls2] {ToolBar} + \li + \li \row - \li \l [QML QtQuickControls] {Menu} - \li \l [QML QtQuickControls2] {Menu} + \li \l [QML QtQuickControls] {ToolButton} + \li \l [QML QtQuickControls2] {ToolButton} + \li + \li \row - \li \l [QML QtQuickControls] {MenuBar} + \li \l [QML QtQuickControls] {TreeView} \li \mdash + \li + \li + + \header + \li Qt Quick Dialogs + \li Qt Quick Controls 2 + \li Alternatives + \li Remarks \row - \li \l [QML QtQuickControls] {MenuItem} - \li \l [QML QtQuickControls2] {MenuItem} - \row - \li \l [QML QtQuickControls] {MenuSeparator} - \li \l [QML QtQuickControls2] {MenuSeparator} + \li \l [QML QtQuickDialogs] {Dialog} + \li \mdash + \li \l [QML QtQuickControls2] {Dialog} + \li \list + \li \b {Qt Quick Dialogs}: \c Dialog is either a top-level window or an \c Item-based popup + depending on whether the underlying platform supports multiple top-level windows. + \li \b {Qt Quick Controls 2}: \c Dialog is not a top-level window, but an \c Item-based + popup that is stacked above the application content. Due to this, dialogs are restricted + within window boundaries. + \endlist + \row + \li \l [QML QtQuickDialogs] {ColorDialog},\br + \l [QML QtQuickDialogs] {FileDialog},\br + \l [QML QtQuickDialogs] {FontDialog},\br + \l [QML QtQuickDialogs] {MessageDialog} + \li \mdash + \li \l [QML QtLabsPlatform] {ColorDialog},\br + \l [QML QtLabsPlatform] {FileDialog},\br + \l [QML QtLabsPlatform] {FolderDialog},\br + \l [QML QtLabsPlatform] {FontDialog},\br + \l [QML QtLabsPlatform] {MessageDialog} \br\sup {(Qt Labs Platform)} + \li \list + \li \b {Qt Quick Dialogs}: Dialogs are native on platforms where an implementation + is available in the Qt Platform Abstraction Layer. Other platforms use either + Qt Widgets or QML-based dialogs depending on whether the underlying platform + supports multiple top-level windows. + \li \b {Qt Labs Platform}: \e Experimental native dialogs that use Qt Widgets as + a fallback on platforms where a native implementation is not available in the + Qt Platform Abstraction Layer. + \endlist + + \header + \li Qt Quick Extras + \li Qt Quick Controls 2 + \li Alternatives + \li Remarks \row + \li \l [QML QtQuickExtras] {CircularGauge} \li \mdash - \li \l [QML QtQuickControls2] {Page} + \li + \li \row + \li \l [QML QtQuickExtras] {DelayButton} \li \mdash - \li \l [QML QtQuickControls2] {PageIndicator} + \li + \li + \row + \li \l [QML QtQuickExtras] {Dial} + \li \l [QML QtQuickControls2] {Dial} + \li + \li \row + \li \l [QML QtQuickExtras] {Gauge} \li \mdash - \li \l [QML QtQuickControls2] {Pane} + \li + \li \row \li \l [QML QtQuickExtras] {Picture} \li \mdash + \li + \li \row \li \l [QML QtQuickExtras] {PieMenu} \li \mdash + \li + \li \row + \li \l [QML QtQuickExtras] {StatusIndicator} \li \mdash - \li \l [QML QtQuickControls2] {Popup} + \li + \li \row - \li \l [QML QtQuickControls] {ProgressBar} - \li \l [QML QtQuickControls2] {ProgressBar} + \li \l [QML QtQuickExtras] {ToggleButton} + \li \mdash + \li + \li \row - \li \l [QML QtQuickControls] {RadioButton} - \li \l [QML QtQuickControls2] {RadioButton} + \li \l [QML QtQuickExtras] {Tumbler},\br + \l [QML QtQuickExtras] {TumblerColumn} + \li \l [QML QtQuickControls2] {Tumbler} + \li + \li \list + \li \b {Qt Quick Extras}: \c Tumbler can consist of multiple columns. + \li \b {Qt Quick Controls 2}: \c Tumbler presents a single spinnable wheel. + Multiple columns can be created by placing multiple \c Tumblers next + to each other. + \endlist + + \header + \li No Predecessor + \li Qt Quick Controls 2 + \li Alternatives + \li Remarks \row \li \mdash - \li \l [QML QtQuickControls2] {RadioDelegate} + \li \l [QML QtQuickControls2] {AbstractButton} + \li + \li \row \li \mdash - \li \l [QML QtQuickControls2] {RangeSlider} + \li \l [QML QtQuickControls2] {ButtonGroup} + \li \l [QML QtQuickControls] {ExclusiveGroup} \br\sup {(Qt Quick Controls 1)} + \li \list + \li \b {Qt Quick Controls 1}: \c ExclusiveGroup offers similar functionality. + \endlist \row - \li \l [QML QtQuickControls] {ScrollView} - \li \l [QML QtQuickControls2] {ScrollBar}, - \l [QML QtQuickControls2] {ScrollIndicator} + \li \mdash + \li \l [QML QtQuickControls2] {CheckDelegate} + \li + \li \row - \li \l [QML QtQuickControls] {Slider} - \li \l [QML QtQuickControls2] {Slider} + \li \mdash + \li \l [QML QtQuickControls2] {Container} + \li + \li \row - \li \l [QML QtQuickControls] {SplitView} \li \mdash + \li \l [QML QtQuickControls2] {Control} + \li + \li \row - \li \l [QML QtQuickControls] {SpinBox} - \li \l [QML QtQuickControls2] {SpinBox} + \li \mdash + \li \l [QML QtQuickControls2] {Drawer} + \li + \li \row - \li \l [QML QtQuickControls] {StackView}, - \l [QML QtQuickControls] {StackViewDelegate}, - \l [QML QtQuickControls] {Stack} - \li \l [QML QtQuickControls2] {StackView} + \li \mdash + \li \l [QML QtQuickControls2] {Frame} + \li + \li \row - \li \l [QML QtQuickControls] {StatusBar} \li \mdash + \li \l [QML QtQuickControls2] {ItemDelegate} + \li + \li \row - \li \l [QML QtQuickExtras] {StatusIndicator} \li \mdash + \li \l [QML QtQuickControls2] {Page} + \li + \li \row \li \mdash - \li \l [QML QtQuickControls2] {SwipeDelegate} + \li \l [QML QtQuickControls2] {PageIndicator} + \li + \li \row \li \mdash - \li \l [QML QtQuickControls2] {SwipeView} + \li \l [QML QtQuickControls2] {Pane} + \li + \li \row - \li \l [QML QtQuickControls] {Switch} - \li \l [QML QtQuickControls2] {Switch} + \li \mdash + \li \l [QML QtQuickControls2] {Popup} + \li + \li \row \li \mdash - \li \l [QML QtQuickControls2] {SwitchDelegate} + \li \l [QML QtQuickControls2] {RadioDelegate} + \li + \li \row - \li \l [QML QtQuickControls] {TabView}, - \l [QML QtQuickControls] {Tab} - \li \l [QML QtQuickControls2] {TabBar}, - \l [QML QtQuickControls2] {TabButton} + \li \mdash + \li \l [QML QtQuickControls2] {RangeSlider} + \li + \li \row - \li \l [QML QtQuickControls] {TableView} \li \mdash + \li \l [QML QtQuickControls2] {RoundButton} + \li + \li \row - \li \l [QML QtQuickControls] {TextArea} - \li \l [QML QtQuickControls2] {TextArea} + \li \mdash + \li \l [QML QtQuickControls2] {ScrollBar},\br + \l [QML QtQuickControls2] {ScrollIndicator} + \li \l [QML QtQuickControls] {ScrollView} \br\sup {(Qt Quick Controls 1)} + \li \list + \li \b {Qt Quick Controls 1}: \c ScrollView offers similar functionality. + It combines horizontal and vertical scrollbars, and the background and + frame around the scrollable view. + \endlist \row - \li \l [QML QtQuickControls] {TextField} - \li \l [QML QtQuickControls2] {TextField} + \li \mdash + \li \mdash + \li \l [QML QtLabsPlatform] {StandardPaths} \br\sup {(Qt Labs Platform)} + \li \list + \li \b {Qt Quick Dialogs}: \c FileDialog offers a shortcut property that can be used + to access the most common standard paths. + \li \b {Qt Labs Platform}: \c StandardPaths offers a separate type to give full access + to the standard paths. + \endlist \row - \li \l [QML QtQuickExtras] {ToggleButton} \li \mdash + \li \l [QML QtQuickControls2] {SwipeDelegate} + \li + \li \row - \li \l [QML QtQuickControls] {ToolBar} - \li \l [QML QtQuickControls2] {ToolBar} + \li \mdash + \li \l [QML QtQuickControls2] {SwipeView} + \li + \li \row - \li \l [QML QtQuickControls] {ToolButton} - \li \l [QML QtQuickControls2] {ToolButton} + \li \mdash + \li \l [QML QtQuickControls2] {SwitchDelegate} + \li + \li \row \li \mdash - \li \l [QML QtQuickControls2] {ToolSeparator} + \li \mdash + \li \l [QML QtLabsPlatform] {SystemTrayIcon} \br\sup {(Qt Labs Platform)} + \li \list + \li \b {Qt Labs Platform}: \c SystemTrayIcon is an \e experimental native + system tray icon that uses Qt Widgets as a fallback on platforms where + a native implementation is not available in the Qt Platform Abstraction + Layer. + \endlist \row \li \mdash - \li \l [QML QtQuickControls2] {ToolTip} + \li \l [QML QtQuickControls2] {TabBar},\br + \l [QML QtQuickControls2] {TabButton} + \li \l [QML QtQuickControls] {TabView} \br\sup {(Qt Quick Controls 1)} + \li \list + \li \b {Qt Quick Controls 1}: \c TabView offers similar functionality. + It combines the tab bar, background and frame around the tabs. + \endlist \row - \li \l [QML QtQuickControls] {TreeView} \li \mdash + \li \l [QML QtQuickControls2] {ToolSeparator} + \li + \li \row - \li \l [QML QtQuickExtras] {Tumbler}, - \l [QML QtQuickExtras] {TumblerColumn} - \li \l [QML QtQuickControls2] {Tumbler} + \li \mdash + \li \l [QML QtQuickControls2] {ToolTip} + \li + \li \list + \li \b {Qt Quick Controls 1}: \c Button and \c Action have built-in + Qt Widgets-based tooltips. + \li \b {Qt Quick Controls 2}: \c ToolTip can be attached to any \c Item. + \endlist \endtable \section1 Related Information @@ -373,5 +669,7 @@ \li \l{Qt Quick Controls 2 QML Types} \li \l{Qt Quick Controls QML Types} \li \l{Qt Quick Extras QML Types} + \li \l{Qt Labs Calendar QML Types} + \li \l{Qt Labs Platform QML Types} \endlist */ -- cgit v1.2.3 From da0570d1ddf6c786b4bfdd0a1172b36ecc66f2a2 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 29 Nov 2016 13:04:10 +0100 Subject: Dial: add missing wheel handling [ChangeLog][Controls][Dial] Added support for wheel handling when wheelEnabled is set to true. Change-Id: If0bc2f0ea9d7cde7726739cdfdbd795c908981f0 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickdial.cpp | 14 +++++++++++ src/quicktemplates2/qquickdial_p.h | 2 ++ tests/auto/controls/data/tst_dial.qml | 47 +++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp index 79aff781..2b9f83a4 100644 --- a/src/quicktemplates2/qquickdial.cpp +++ b/src/quicktemplates2/qquickdial.cpp @@ -606,6 +606,20 @@ void QQuickDial::mouseUngrabEvent() setPressed(false); } +void QQuickDial::wheelEvent(QWheelEvent *event) +{ + Q_D(QQuickDial); + QQuickControl::wheelEvent(event); + if (d->wheelEnabled) { + const qreal oldValue = d->value; + const QPointF angle = event->angleDelta(); + const qreal delta = (qFuzzyIsNull(angle.y()) ? angle.x() : angle.y()) / QWheelEvent::DefaultDeltasPerStep; + const qreal step = qFuzzyIsNull(d->stepSize) ? 0.1 : d->stepSize; + setValue(oldValue + step * delta); + event->setAccepted(!qFuzzyCompare(d->value, oldValue)); + } +} + void QQuickDial::mirrorChange() { QQuickControl::mirrorChange(); diff --git a/src/quicktemplates2/qquickdial_p.h b/src/quicktemplates2/qquickdial_p.h index 2d87d6d9..291a6ac2 100644 --- a/src/quicktemplates2/qquickdial_p.h +++ b/src/quicktemplates2/qquickdial_p.h @@ -132,6 +132,8 @@ protected: void mouseMoveEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void mouseUngrabEvent() override; + void wheelEvent(QWheelEvent *event) override; + void mirrorChange() override; void componentComplete() override; diff --git a/tests/auto/controls/data/tst_dial.qml b/tests/auto/controls/data/tst_dial.qml index e6446d3e..d0129755 100644 --- a/tests/auto/controls/data/tst_dial.qml +++ b/tests/auto/controls/data/tst_dial.qml @@ -356,4 +356,51 @@ TestCase { fuzzyCompare(dial.value, data.values[2], fuzz); fuzzyCompare(dial.position, data.positions[2], fuzz); } + + function test_wheel_data() { + return [ + { tag: "horizontal", orientation: Qt.Horizontal, dx: 120, dy: 0 }, + { tag: "vertical", orientation: Qt.Vertical, dx: 0, dy: 120 } + ] + } + + function test_wheel(data) { + var control = dialComponent.createObject(testCase, {wheelEnabled: true, orientation: data.orientation}) + verify(control) + + compare(control.value, 0.0) + + mouseWheel(control, control.width / 2, control.height / 2, data.dx, data.dy) + compare(control.value, 0.1) + compare(control.position, 0.1) + + control.stepSize = 0.2 + + mouseWheel(control, control.width / 2, control.height / 2, data.dx, data.dy) + compare(control.value, 0.3) + compare(control.position, 0.3) + + control.stepSize = 10.0 + + mouseWheel(control, control.width / 2, control.height / 2, -data.dx, -data.dy) + compare(control.value, 0.0) + compare(control.position, 0.0) + + control.to = 10.0 + control.stepSize = 5.0 + + mouseWheel(control, control.width / 2, control.height / 2, data.dx, data.dy) + compare(control.value, 5.0) + compare(control.position, 0.5) + + mouseWheel(control, control.width / 2, control.height / 2, 0.5 * data.dx, 0.5 * data.dy) + compare(control.value, 7.5) + compare(control.position, 0.75) + + mouseWheel(control, control.width / 2, control.height / 2, -data.dx, -data.dy) + compare(control.value, 2.5) + compare(control.position, 0.25) + + control.destroy() + } } -- cgit v1.2.3 From f574ad46bccbe70b0fd36a556f1cafbdcb489504 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 29 Nov 2016 13:09:34 +0100 Subject: SpinBox: fix input method hints to get the appropriate VKB SpinBox operates on integers. Task-number: QTBUG-56837 Change-Id: Ib77cded8c4483fa78816d004692cacb3532deedd Reviewed-by: Mitch Curtis --- src/imports/controls/SpinBox.qml | 2 +- src/imports/controls/material/SpinBox.qml | 2 +- src/imports/controls/universal/SpinBox.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/imports/controls/SpinBox.qml b/src/imports/controls/SpinBox.qml index 6a564d6e..fd81337d 100644 --- a/src/imports/controls/SpinBox.qml +++ b/src/imports/controls/SpinBox.qml @@ -76,7 +76,7 @@ T.SpinBox { readOnly: !control.editable validator: control.validator - inputMethodHints: Qt.ImhFormattedNumbersOnly + inputMethodHints: Qt.ImhDigitsOnly Rectangle { x: -6 - (down.indicator ? 1 : 0) diff --git a/src/imports/controls/material/SpinBox.qml b/src/imports/controls/material/SpinBox.qml index 6881fc23..110032be 100644 --- a/src/imports/controls/material/SpinBox.qml +++ b/src/imports/controls/material/SpinBox.qml @@ -101,7 +101,7 @@ T.SpinBox { readOnly: !control.editable validator: control.validator - inputMethodHints: Qt.ImhFormattedNumbersOnly + inputMethodHints: Qt.ImhDigitsOnly } up.indicator: Item { diff --git a/src/imports/controls/universal/SpinBox.qml b/src/imports/controls/universal/SpinBox.qml index 57120a7b..40060038 100644 --- a/src/imports/controls/universal/SpinBox.qml +++ b/src/imports/controls/universal/SpinBox.qml @@ -79,7 +79,7 @@ T.SpinBox { readOnly: !control.editable validator: control.validator - inputMethodHints: Qt.ImhFormattedNumbersOnly + inputMethodHints: Qt.ImhDigitsOnly } up.indicator: Item { -- cgit v1.2.3 From f6d2a9dd20b3661bea13b73e09c4f0285c1cd67a Mon Sep 17 00:00:00 2001 From: "Marco A. Piccolino-Boniforti" Date: Tue, 29 Nov 2016 18:59:37 +0100 Subject: Fix typo in description of qquickcalendar.cpp Change-Id: I7e21c1aeaa205c1dd4e7985837897899e7a39b11 Reviewed-by: Sami Makkonen Reviewed-by: J-P Nurmi --- src/imports/calendar/qquickcalendar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/calendar/qquickcalendar.cpp b/src/imports/calendar/qquickcalendar.cpp index b64759f2..cb543012 100644 --- a/src/imports/calendar/qquickcalendar.cpp +++ b/src/imports/calendar/qquickcalendar.cpp @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE The Qt Labs Calendar module uses 0-based month numbers to be consistent with the JavaScript Date type, that is used by the QML language. This means that \c Date::getMonth() can be assigned to MonthGrid::month and - WeekNumberColumn::month as is. When dealing with dealing with month numbers + WeekNumberColumn::month as is. When dealing with month numbers directly, it is highly recommended to use the following enumeration values to avoid confusion. -- cgit v1.2.3 From 838fd79152957f457a47cd30970961a27f086848 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 29 Nov 2016 10:28:33 +0100 Subject: SwipeDelegate: fix animations when releasing from a drag 9812a9c changed the order in which the pressed and position state is set. Before, when releasing after swiping, it would be: set pressed to false => set position After 9812a9c, it became: set position => set pressed to false The original order is necessary to ensure that animations can rely on being enabled *before* position changes, as their enabled expression typically looks something like this: enabled: !control.down This patch duplicates the contents of QQuickAbstractButton::mouseUngrabEvent() for now, with a TODO comment to ensure that it's moved into a private helper that we can call later on. Task-number: QTBUG-57350 Change-Id: I31af7a665fb2d0e37548df31560ed7bbb0c3cadb Reviewed-by: Mitch Curtis Reviewed-by: J-P Nurmi --- src/quicktemplates2/qquickswipedelegate.cpp | 15 ++++++++ tests/auto/controls/data/tst_swipedelegate.qml | 50 ++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index 0eac7fe1..f07b107e 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -698,6 +698,21 @@ bool QQuickSwipeDelegatePrivate::handleMouseReleaseEvent(QQuickItem *, QMouseEve const bool hadGrabbedMouse = q->keepMouseGrab(); q->setKeepMouseGrab(false); + // Animations for the background and contentItem delegates are typically + // only enabled when !control.down, so that the animations aren't running + // when the user is swiping. To ensure that the animations are enabled + // *before* the positions of these delegates change (via the swipe.setPosition() calls below), + // we must cancel the press. QQuickAbstractButton::mouseUngrabEvent() does this + // for us, but by then it's too late. + if (hadGrabbedMouse) { + // TODO: this is copied from QQuickAbstractButton::mouseUngrabEvent(). + // Eventually it should be moved into a private helper so that we don't have to duplicate it. + q->setPressed(false); + stopPressRepeat(); + stopPressAndHold(); + emit q->canceled(); + } + // The control can be exposed by either swiping past the halfway mark, or swiping fast enough. const qreal swipeVelocity = swipePrivate->velocityCalculator.velocity().x(); if (swipePrivate->position > 0.5 || diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml index 0404fd86..6d017dc8 100644 --- a/tests/auto/controls/data/tst_swipedelegate.qml +++ b/tests/auto/controls/data/tst_swipedelegate.qml @@ -1073,4 +1073,54 @@ TestCase { mouseRelease(control, control.width + 10, control.height / 2, Qt.LeftButton); verify(mouseSignalSequenceSpy.success); } + + + Component { + id: animationSwipeDelegateComponent + + SwipeDelegate { + id: control + text: "SwipeDelegate" + width: 150 + swipe.left: greenLeftComponent + swipe.right: redRightComponent + + property alias behavior: xBehavior + property alias animation: numberAnimation + + background: Rectangle { + color: control.down ? "#ccc" : "#fff" + + Behavior on x { + id: xBehavior + enabled: !control.down + + NumberAnimation { + id: numberAnimation + easing.type: Easing.InOutCubic + duration: 400 + } + } + } + } + } + + function test_animations() { + // Test that animations are run when releasing from a drag. + var control = animationSwipeDelegateComponent.createObject(testCase); + verify(control); + + mousePress(control, control.width / 2, control.height / 2, Qt.LeftButton); + mouseMove(control, control.width - 1, control.height / 2, Qt.LeftButton); + verify(control.down); + verify(!control.behavior.enabled); + verify(!control.animation.running); + + mouseRelease(control, control.width - 1, control.height / 2, Qt.LeftButton); + verify(!control.down); + verify(control.behavior.enabled); + verify(control.animation.running); + + control.destroy(); + } } -- cgit v1.2.3 From 5efd4b6a61498f0668d7367d620275367894140e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 28 Nov 2016 16:00:04 +0100 Subject: Allow specifying a relative style path in qtquickcontrols2.conf The style path is resolved relative to the location of config file. Even though qtquickcontrols2.conf is normally located in the root of resources, Quick Designer uses QT_QUICK_CONTROLS_CONF to set a custom location for the preview, where the standard config location is not feasible. This patch extends the config and style lookup further by allowing to specify a relative path to a custom style for the Quick Designer preview. Change-Id: Iad9c459421eefbf7a5bcbedfea59f5f16a1d3a39 Reviewed-by: Thomas Hartmann --- src/quickcontrols2/qquickstyle.cpp | 29 +++++++++++++++++++++++++++++ src/quickcontrols2/qquickstyle_p.h | 1 + src/quickcontrols2/qquickstyleattached.cpp | 15 ++------------- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp index d7143be7..3ad7c074 100644 --- a/src/quickcontrols2/qquickstyle.cpp +++ b/src/quickcontrols2/qquickstyle.cpp @@ -183,6 +183,15 @@ struct QQuickStyleSpec setFallbackStyle(settings->value(QStringLiteral("FallbackStyle")).toString(), ":/qtquickcontrols2.conf"); } } + + // resolve a path relative to the config + QString configPath = QFileInfo(resolveConfigFilePath()).path(); + QString stylePath = findStyle(configPath, style); + if (!stylePath.isEmpty()) { + style = stylePath; + resolved = true; + } + custom = style.contains(QLatin1Char('/')); if (baseUrl.isValid()) { @@ -221,11 +230,26 @@ struct QQuickStyleSpec fallbackMethod.clear(); } + QString resolveConfigFilePath() + { + if (configFilePath.isEmpty()) { + configFilePath = QFile::decodeName(qgetenv("QT_QUICK_CONTROLS_CONF")); + if (!QFile::exists(configFilePath)) { + if (!configFilePath.isEmpty()) + qWarning("QT_QUICK_CONTROLS_CONF=%s: No such file", qPrintable(configFilePath)); + + configFilePath = QStringLiteral(":/qtquickcontrols2.conf"); + } + } + return configFilePath; + } + bool custom; bool resolved; QString style; QString fallbackStyle; QByteArray fallbackMethod; + QString configFilePath; }; Q_GLOBAL_STATIC(QQuickStyleSpec, styleSpec) @@ -262,6 +286,11 @@ void QQuickStylePrivate::reset() styleSpec()->reset(); } +QString QQuickStylePrivate::configFilePath() +{ + return styleSpec()->resolveConfigFilePath(); +} + /*! Returns the name of the application style. diff --git a/src/quickcontrols2/qquickstyle_p.h b/src/quickcontrols2/qquickstyle_p.h index cfe87fbb..65f48d95 100644 --- a/src/quickcontrols2/qquickstyle_p.h +++ b/src/quickcontrols2/qquickstyle_p.h @@ -60,6 +60,7 @@ public: static bool isCustomStyle(); static void init(const QUrl &baseUrl); static void reset(); + static QString configFilePath(); }; QT_END_NAMESPACE diff --git a/src/quickcontrols2/qquickstyleattached.cpp b/src/quickcontrols2/qquickstyleattached.cpp index 2ef07fd6..d1f27ff3 100644 --- a/src/quickcontrols2/qquickstyleattached.cpp +++ b/src/quickcontrols2/qquickstyleattached.cpp @@ -35,6 +35,7 @@ ****************************************************************************/ #include "qquickstyleattached_p.h" +#include "qquickstyle_p.h" #include #include @@ -167,18 +168,6 @@ static QList findChildStyles(const QMetaObject *type, QOb return children; } -static QString resolveConfigFile() -{ - QString filePath = QFile::decodeName(qgetenv("QT_QUICK_CONTROLS_CONF")); - if (!QFile::exists(filePath)) { - if (!filePath.isEmpty()) - qWarning("QT_QUICK_CONTROLS_CONF=%s: No such file", qPrintable(filePath)); - - filePath = QStringLiteral(":/qtquickcontrols2.conf"); - } - return filePath; -} - QQuickStyleAttached::QQuickStyleAttached(QObject *parent) : QObject(parent) { QQuickItem *item = qobject_cast(parent); @@ -208,7 +197,7 @@ QQuickStyleAttached::~QQuickStyleAttached() QSharedPointer QQuickStyleAttached::settings(const QString &group) { #ifndef QT_NO_SETTINGS - static const QString filePath = resolveConfigFile(); + const QString filePath = QQuickStylePrivate::configFilePath(); if (QFile::exists(filePath)) { QFileSelector selector; QSettings *settings = new QSettings(selector.select(filePath), QSettings::IniFormat); -- cgit v1.2.3