From 871d8e8e2faca0be870930d83f755a2ad484d30b Mon Sep 17 00:00:00 2001 From: Antti Kokko Date: Thu, 21 Sep 2017 08:01:42 +0300 Subject: Add changes file for Qt 5.9.2 Change-Id: I976ebebb69e583963f9578fb007fb008311a22b4 Reviewed-by: Jani Heikkinen --- dist/changes-5.9.2 | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 dist/changes-5.9.2 diff --git a/dist/changes-5.9.2 b/dist/changes-5.9.2 new file mode 100644 index 00000000..370f77cb --- /dev/null +++ b/dist/changes-5.9.2 @@ -0,0 +1,79 @@ +Qt 5.9.2 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.9.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.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. + +**************************************************************************** +* Controls * +**************************************************************************** + + - BusyIndicator: + * [QTBUG-61785] Fixed busy indicators to not block touch events. + + - Control: + * [QTBUG-63119] Fixed font inheritance in item views. + + - Drawer: + * [QTBUG-61581] Fixed multi-touch leaking through modal overlay. + * [QTBUG-59652] Fixed non-modal drawer drag/swipe open and close. + + - Menu: + * [QTBUG-61608] Fixed press-and-hold support by removing OnReleaseOutside + from the default close policy, to avoid closing on release when opened + from an onPressAndHold signal handler. + + - Popup: + * [QTBUG-61698] Fixed multi-touch leaking through modal overlay + * Fixed focus handling for chained popups. When a popup is closed, focus + is now restored to the next popup in chain instead of transferring focus + to the window content. + * [QTBUG-62158] Fixed popups to take Window::contentOrientation into + account. + + - PageIndicator: + * Fixed interactive page indicators to work on touch. + * [QTBUG-61785] Fixed non-interactive page indicators to not block touch + events. + + - ScrollIndicator: + * [QTBUG-61785] Fixed scroll indicators to not block touch events. + + - SpinBox: + * [QTBUG-61426] Fixed to emit valueModified() on long press. + * [QTBUG-62508] Fixed initial value validation. + + - StackView: + * [QTBUG-62153] Fixed a crash that would occur when pushing new items + from a StackView.onRemoved signal handler. + * Fixed resolving of the initialItem URL. + + - TextArea: + - TextField: + * [QTBUG-62854] Improved the Default style. + + - ToolTip: + * [QTBUG-60492] Fixed tooltips to not block shortcuts. + + - Tumbler: + * [QTBUG-61374] Fixed a regression with currentIndex and currentItem. + +**************************************************************************** +* Calendar * +**************************************************************************** + + - MonthGrid: + * [QTBUG-61585] Fixed the clicked() signal to be emitted on touch. -- cgit v1.2.3 From 3f1229bb7bfd45fdc09ce8c2a16cc59e322d5d1c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 27 Sep 2017 17:41:40 +0200 Subject: QQuickButtonGroup: track the checked button with a QPointer A destroyed button removes itself from a group, but because of the workaround added for QTBUG-52358, there's a moment after clear() when a button is removed from a group and before it is added back to the group. If the button gets destroyed during that period, the group ends up with a dangling pointer. Task-number: QTBUG-62946 Task-number: QTBUG-63470 Change-Id: If994f87b221a7e77f56458866c4d132365c45d6f Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickbuttongroup.cpp | 4 +--- tests/auto/controls/data/tst_buttongroup.qml | 32 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/quicktemplates2/qquickbuttongroup.cpp b/src/quicktemplates2/qquickbuttongroup.cpp index f0813a17..355fcf6a 100644 --- a/src/quicktemplates2/qquickbuttongroup.cpp +++ b/src/quicktemplates2/qquickbuttongroup.cpp @@ -154,8 +154,6 @@ class QQuickButtonGroupPrivate : public QObjectPrivate Q_DECLARE_PUBLIC(QQuickButtonGroup) public: - QQuickButtonGroupPrivate() : checkedButton(nullptr) { } - void clear(); void buttonClicked(); void _q_updateCurrent(); @@ -165,7 +163,7 @@ public: static QQuickAbstractButton *buttons_at(QQmlListProperty *prop, int index); static void buttons_clear(QQmlListProperty *prop); - QQuickAbstractButton *checkedButton; + QPointer checkedButton; QVector buttons; }; diff --git a/tests/auto/controls/data/tst_buttongroup.qml b/tests/auto/controls/data/tst_buttongroup.qml index bde655da..6baff494 100644 --- a/tests/auto/controls/data/tst_buttongroup.qml +++ b/tests/auto/controls/data/tst_buttongroup.qml @@ -346,4 +346,36 @@ TestCase { verify(container.group.checkedButton) compare(container.group.checkedButton.objectName, "0") } + + Component { + id: checkedButtonColumn + Column { + id: column + ButtonGroup { buttons: column.children } + Repeater { + id: repeater + delegate: Button { + checkable: true + text: modelData + onClicked: listModel.remove(index) + } + model: ListModel { + id: listModel + Component.onCompleted: { + for (var i = 0; i < 10; ++i) + append({text: i}) + } + } + } + } + } + + function test_checkedButtonDestroyed() { + var column = createTemporaryObject(checkedButtonColumn, testCase) + verify(column) + + waitForRendering(column) + mouseClick(column.children[0]) + wait(0) // don't crash (QTBUG-62946, QTBUG-63470) + } } -- cgit v1.2.3 From ed9a677c3a27d1c2eeddb71b66f00bfc691df3fd Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 28 Sep 2017 15:05:46 +0200 Subject: Doc: remove stray semicolons from SwipeDelegate snippet Change-Id: I859b61880da16f6c58967700b179f35df656ed77 Reviewed-by: J-P Nurmi --- src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml index 9eb3d71c..7fa76f13 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml @@ -56,8 +56,8 @@ ListView { easing.type: Easing.InOutQuad } PropertyAction { - target: swipeDelegate; - property: "ListView.delayRemove"; + target: swipeDelegate + property: "ListView.delayRemove" value: false } } -- cgit v1.2.3 From c5050daa16860b800dbc9782e94e0bacffd6bbf2 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 28 Sep 2017 15:59:39 +0200 Subject: QQuickScrollView: fix binding loop with wrapping TextArea Start keeping track of the content size only after the component is complete, to avoid creation time ping pong with content size updates and content item resizing. Task-number: QTBUG-62325 Change-Id: I4b75dc398d0b746dd7e0b04291270f47f91bb7e6 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickscrollview.cpp | 12 +++++++++--- tests/auto/controls/data/tst_scrollview.qml | 25 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/quicktemplates2/qquickscrollview.cpp b/src/quicktemplates2/qquickscrollview.cpp index c05e4848..fa9a6c3b 100644 --- a/src/quicktemplates2/qquickscrollview.cpp +++ b/src/quicktemplates2/qquickscrollview.cpp @@ -205,7 +205,7 @@ bool QQuickScrollViewPrivate::setFlickable(QQuickFlickable *item, bool content) void QQuickScrollViewPrivate::updateContentWidth() { Q_Q(QQuickScrollView); - if (!flickable) + if (!flickable || !componentComplete) return; const qreal cw = flickable->contentWidth(); @@ -219,7 +219,7 @@ void QQuickScrollViewPrivate::updateContentWidth() void QQuickScrollViewPrivate::updateContentHeight() { Q_Q(QQuickScrollView); - if (!flickable) + if (!flickable || !componentComplete) return; const qreal ch = flickable->contentHeight(); @@ -551,8 +551,14 @@ void QQuickScrollView::componentComplete() { Q_D(QQuickScrollView); QQuickControl::componentComplete(); - if (!d->contentItem) + if (!d->contentItem) { d->ensureFlickable(true); + } else { + if (d->contentWidth <= 0) + d->updateContentWidth(); + if (d->contentHeight <= 0) + d->updateContentHeight(); + } } void QQuickScrollView::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) diff --git a/tests/auto/controls/data/tst_scrollview.qml b/tests/auto/controls/data/tst_scrollview.qml index c0b1a401..80110b5a 100644 --- a/tests/auto/controls/data/tst_scrollview.qml +++ b/tests/auto/controls/data/tst_scrollview.qml @@ -129,6 +129,16 @@ TestCase { } } + Component { + id: scrollableTextArea + ScrollView { + TextArea { + text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas id dignissim ipsum. Nam molestie nisl turpis." + wrapMode: TextArea.WordWrap + } + } + } + function test_scrollBars() { var control = createTemporaryObject(scrollView, testCase, {width: 200, height: 200}) verify(control) @@ -339,4 +349,19 @@ TestCase { } compare(horizontal.position, 0.0) } + + function test_textArea() { + // TODO: verify no binding loop warnings (QTBUG-62325) + var control = createTemporaryObject(scrollableTextArea, testCase) + verify(control) + + var flickable = control.contentItem + verify(flickable && flickable.hasOwnProperty("contentX")) + + var textArea = flickable.contentItem.children[0] + verify(textArea && textArea.hasOwnProperty("text")) + + compare(control.contentWidth, flickable.contentWidth) + compare(control.contentHeight, flickable.contentHeight) + } } -- cgit v1.2.3 From 7e8712d57526fb3b5aeed3033c10506897592ed9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 2 Oct 2017 14:52:31 +0200 Subject: tst_combobox: attempt to stabilize test_mouse() Disable hover to avoid unexpected changes. Task-number: QTBUG-60480 Change-Id: I22fab5c95daa42f3c84437072bce49cac5c705af Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_combobox.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index f231ebf8..abdfd51a 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -699,7 +699,7 @@ TestCase { } function test_mouse() { - var control = createTemporaryObject(comboBox, testCase, {model: 3}) + var control = createTemporaryObject(comboBox, testCase, {model: 3, hoverEnabled: false}) verify(control) var activatedSpy = signalSpy.createObject(control, {target: control, signalName: "activated"}) -- cgit v1.2.3 From 7254d2918a8fbffe49421b79b60d298292458091 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 6 Oct 2017 18:00:55 +0200 Subject: Bump version Change-Id: Ifaa644970cd8da55d02c1af76acd3ce8fbedb6da --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index f280a7ea..80630dec 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ DEFINES += QT_NO_FOREACH QQC2_SOURCE_TREE = $$PWD -MODULE_VERSION = 5.9.2 +MODULE_VERSION = 5.9.3 -- cgit v1.2.3 From 45c00f8065343ebcf89e14e97e4bb59dad48a7bd Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 6 Oct 2017 10:21:53 +0200 Subject: Doc: add missing title customization for GroupBox Task-number: QTBUG-63618 Change-Id: I6a32158726e4425dc24c24f4f9dc9cc80aa462bf Reviewed-by: J-P Nurmi --- .../doc/images/qtquickcontrols2-groupbox-custom.png | Bin 3885 -> 3551 bytes .../doc/snippets/qtquickcontrols2-groupbox-custom.qml | 8 ++++++++ 2 files changed, 8 insertions(+) diff --git a/src/imports/controls/doc/images/qtquickcontrols2-groupbox-custom.png b/src/imports/controls/doc/images/qtquickcontrols2-groupbox-custom.png index 29f0a60d..3a585d9f 100644 Binary files a/src/imports/controls/doc/images/qtquickcontrols2-groupbox-custom.png and b/src/imports/controls/doc/images/qtquickcontrols2-groupbox-custom.png differ diff --git a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml index feafe263..cdab3e62 100644 --- a/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml +++ b/src/imports/controls/doc/snippets/qtquickcontrols2-groupbox-custom.qml @@ -42,6 +42,14 @@ GroupBox { radius: 2 } + label: Label { + x: control.leftPadding + width: control.availableWidth + text: control.title + color: "#21be2b" + elide: Text.ElideRight + } + Label { text: qsTr("Content goes here!") } -- cgit v1.2.3 From 8625b79f606fc4e9cbfeed46d9c83bc691aa7464 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 10 Oct 2017 10:57:33 +0200 Subject: Fix the QML context of popup background dimmers We were accidentally passing QQuickOverlay as a QML context parent for dynamically created popup background dimmers. There is only one overlay per window, and the overlay is not destroyed when a popup is destroyed. QQuickOverlay is just a visual parent item for popup background dimmers, but the actual owner is QQuickPopup. Make sure to pass the popup instance as a QML context parent to ensure that the popup background dimmer's QML context is cleaned up when the popup is destroyed. Task-number: QTBUG-63672 Change-Id: I5cabbcef5035cef40af3c9edbcd8f7ae3157bd8a Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickoverlay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/quicktemplates2/qquickoverlay.cpp b/src/quicktemplates2/qquickoverlay.cpp index a1d82de0..f30f6a5e 100644 --- a/src/quicktemplates2/qquickoverlay.cpp +++ b/src/quicktemplates2/qquickoverlay.cpp @@ -79,8 +79,8 @@ static QQuickItem *createDimmer(QQmlComponent *component, QQuickPopup *popup, QQ if (component) { QQmlContext *creationContext = component->creationContext(); if (!creationContext) - creationContext = qmlContext(parent); - QQmlContext *context = new QQmlContext(creationContext, parent); + creationContext = qmlContext(popup); + QQmlContext *context = new QQmlContext(creationContext, popup); context->setContextObject(popup); item = qobject_cast(component->beginCreate(context)); } -- cgit v1.2.3 From 378da67208fe3d7f48ff3e494f5fe5984af407aa Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 10 Oct 2017 12:52:27 +0200 Subject: Doc: state which input devices cause certain signals Change-Id: Ib56041e69547e03d7db10974d4638748f99fd2bf Reviewed-by: J-P Nurmi --- src/quicktemplates2/qquickabstractbutton.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index e819f355..efd06bd0 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -69,13 +69,13 @@ static const int AUTO_REPEAT_INTERVAL = 100; /*! \qmlsignal QtQuick.Controls::AbstractButton::pressed() - This signal is emitted when the button is interactively pressed by the user. + This signal is emitted when the button is interactively pressed by the user via touch, mouse, or keyboard. */ /*! \qmlsignal QtQuick.Controls::AbstractButton::released() - This signal is emitted when the button is interactively released by the user. + This signal is emitted when the button is interactively released by the user via touch, mouse, or keyboard. */ /*! @@ -89,26 +89,26 @@ static const int AUTO_REPEAT_INTERVAL = 100; /*! \qmlsignal QtQuick.Controls::AbstractButton::clicked() - This signal is emitted when the button is interactively clicked by the user. + This signal is emitted when the button is interactively clicked by the user via touch, mouse, or keyboard. */ /*! \since QtQuick.Controls 2.2 (Qt 5.9) \qmlsignal QtQuick.Controls::AbstractButton::toggled() - This signal is emitted when a checkable button is interactively toggled by the user. + This signal is emitted when a checkable button is interactively toggled by the user via touch, mouse, or keyboard. */ /*! \qmlsignal QtQuick.Controls::AbstractButton::pressAndHold() - This signal is emitted when the button is interactively pressed and held down by the user. + This signal is emitted when the button is interactively pressed and held down by the user via touch or mouse. */ /*! \qmlsignal QtQuick.Controls::AbstractButton::doubleClicked() - This signal is emitted when the button is interactively double clicked by the user. + This signal is emitted when the button is interactively double clicked by the user via touch or mouse. */ QQuickAbstractButtonPrivate::QQuickAbstractButtonPrivate() -- cgit v1.2.3 From 9cbc5be241bcd8abb0cafc7a7e4b04746e9fe291 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 6 Oct 2017 11:14:48 +0200 Subject: Ensure that the last screenshot can be opened Ensure that lastSavePath (now lastSaveUrl) is converted to a URL correctly by constructing it from screenshotsDir rather than screenshotsDirStr. It was resolved as a qrc path previously. Change-Id: I5ccdad6166b3927a149875b6ff89ff53c2440c05 Reviewed-by: J-P Nurmi --- tests/manual/screenshots/screenshots.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/manual/screenshots/screenshots.qml b/tests/manual/screenshots/screenshots.qml index 126f02e3..2b031dce 100644 --- a/tests/manual/screenshots/screenshots.qml +++ b/tests/manual/screenshots/screenshots.qml @@ -61,7 +61,7 @@ ApplicationWindow { height: Math.max(600, loader.implicitHeight) property string currentFilePath - property string lastSavePath + property url lastSaveUrl Shortcut { sequence: "Ctrl+Q" @@ -139,8 +139,8 @@ ApplicationWindow { ToolButton { text: "Open Last Screenshot" focusPolicy: Qt.NoFocus - enabled: lastSavePath.length > 0 - onClicked: Qt.openUrlExternally(lastSavePath) + enabled: lastSaveUrl.toString().length > 0 + onClicked: Qt.openUrlExternally(lastSaveUrl) } Item { @@ -159,7 +159,7 @@ ApplicationWindow { var savePath = screenshotsDirStr + "/" + snippetsListView.currentItem.baseName + ".png"; if (result.saveToFile(savePath)) { saveResultToolTip.text = "Successfully saved screenshot to output folder"; - lastSavePath = savePath; + lastSaveUrl = screenshotsDir + "/" + snippetsListView.currentItem.baseName + ".png"; } else { saveResultToolTip.text = "Failed to save screenshot"; } -- cgit v1.2.3 From d72cafb2fcc35df22036843ac71054db8650f64d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 10 Oct 2017 16:03:24 +0200 Subject: Platform: fix clazy-range-loop findings Avoid accidental detach with C++11 range for loops. Change-Id: I2a105ef5a2505d26ee086974177f8f1e4040b522 Reviewed-by: Mitch Curtis --- src/imports/platform/qquickplatformmenu.cpp | 8 ++++---- src/imports/platform/qquickplatformmenubar.cpp | 6 +++--- src/imports/platform/qquickplatformmenuitemgroup.cpp | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/imports/platform/qquickplatformmenu.cpp b/src/imports/platform/qquickplatformmenu.cpp index fbef8b8d..82adb6c3 100644 --- a/src/imports/platform/qquickplatformmenu.cpp +++ b/src/imports/platform/qquickplatformmenu.cpp @@ -153,7 +153,7 @@ QQuickPlatformMenu::~QQuickPlatformMenu() m_menuBar->removeMenu(this); if (m_parentMenu) m_parentMenu->removeMenu(this); - for (QQuickPlatformMenuItem *item : m_items) { + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) { if (QQuickPlatformMenu *subMenu = item->subMenu()) subMenu->setParentMenu(nullptr); item->setMenu(nullptr); @@ -197,7 +197,7 @@ QPlatformMenu * QQuickPlatformMenu::create() connect(m_handle, &QPlatformMenu::aboutToShow, this, &QQuickPlatformMenu::aboutToShow); connect(m_handle, &QPlatformMenu::aboutToHide, this, &QQuickPlatformMenu::aboutToHide); - for (QQuickPlatformMenuItem *item : m_items) + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) m_handle->insertMenuItem(item->create(), nullptr); if (m_menuItem) { @@ -237,7 +237,7 @@ void QQuickPlatformMenu::sync() m_systemTrayIcon->handle()->updateMenu(m_handle); #endif - for (QQuickPlatformMenuItem *item : m_items) + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) item->sync(); } @@ -637,7 +637,7 @@ void QQuickPlatformMenu::clear() if (m_items.isEmpty()) return; - for (QQuickPlatformMenuItem *item : m_items) { + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) { m_data.removeOne(item); if (m_handle) m_handle->removeMenuItem(item->handle()); diff --git a/src/imports/platform/qquickplatformmenubar.cpp b/src/imports/platform/qquickplatformmenubar.cpp index 516bcc3e..4487b9a7 100644 --- a/src/imports/platform/qquickplatformmenubar.cpp +++ b/src/imports/platform/qquickplatformmenubar.cpp @@ -117,7 +117,7 @@ QQuickPlatformMenuBar::QQuickPlatformMenuBar(QObject *parent) QQuickPlatformMenuBar::~QQuickPlatformMenuBar() { - for (QQuickPlatformMenu *menu : m_menus) + for (QQuickPlatformMenu *menu : qAsConst(m_menus)) menu->setMenuBar(nullptr); delete m_handle; m_handle = nullptr; @@ -235,7 +235,7 @@ void QQuickPlatformMenuBar::clear() if (m_menus.isEmpty()) return; - for (QQuickPlatformMenu *menu : m_menus) { + for (QQuickPlatformMenu *menu : qAsConst(m_menus)) { m_data.removeOne(menu); if (m_handle) m_handle->removeMenu(menu->handle()); @@ -254,7 +254,7 @@ void QQuickPlatformMenuBar::classBegin() void QQuickPlatformMenuBar::componentComplete() { m_complete = true; - for (QQuickPlatformMenu *menu : m_menus) + for (QQuickPlatformMenu *menu : qAsConst(m_menus)) menu->sync(); if (!m_window) setWindow(findWindow()); diff --git a/src/imports/platform/qquickplatformmenuitemgroup.cpp b/src/imports/platform/qquickplatformmenuitemgroup.cpp index af901bb8..f07d0a1b 100644 --- a/src/imports/platform/qquickplatformmenuitemgroup.cpp +++ b/src/imports/platform/qquickplatformmenuitemgroup.cpp @@ -164,7 +164,7 @@ void QQuickPlatformMenuItemGroup::setEnabled(bool enabled) m_enabled = enabled; emit enabledChanged(); - for (QQuickPlatformMenuItem *item : m_items) { + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) { if (item->m_enabled) { item->sync(); emit item->enabledChanged(); @@ -193,7 +193,7 @@ void QQuickPlatformMenuItemGroup::setVisible(bool visible) m_visible = visible; emit visibleChanged(); - for (QQuickPlatformMenuItem *item : m_items) { + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) { if (item->m_visible) { item->sync(); emit item->visibleChanged(); @@ -222,7 +222,7 @@ void QQuickPlatformMenuItemGroup::setExclusive(bool exclusive) m_exclusive = exclusive; emit exclusiveChanged(); - for (QQuickPlatformMenuItem *item : m_items) + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) item->sync(); } @@ -317,7 +317,7 @@ void QQuickPlatformMenuItemGroup::clear() if (m_items.isEmpty()) return; - for (QQuickPlatformMenuItem *item : m_items) { + for (QQuickPlatformMenuItem *item : qAsConst(m_items)) { item->setGroup(nullptr); disconnect(item, &QQuickPlatformMenuItem::checkedChanged, this, &QQuickPlatformMenuItemGroup::updateCurrent); disconnect(item, &QQuickPlatformMenuItem::triggered, this, &QQuickPlatformMenuItemGroup::activateItem); -- cgit v1.2.3 From 0007db13236fcee4ca90b885a67cc7de0f40836d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 10 Oct 2017 16:13:21 +0200 Subject: QQuickPlatformDialog: fix clazy-qenums Change-Id: I6b9e31919502fb2f47e4b3657302a745c9f85b23 Reviewed-by: Mitch Curtis --- src/imports/platform/qquickplatformdialog_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imports/platform/qquickplatformdialog_p.h b/src/imports/platform/qquickplatformdialog_p.h index ba4c5d5f..55a54937 100644 --- a/src/imports/platform/qquickplatformdialog_p.h +++ b/src/imports/platform/qquickplatformdialog_p.h @@ -72,7 +72,6 @@ class QQuickPlatformDialog : public QObject, public QQmlParserStatus Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) Q_PROPERTY(int result READ result WRITE setResult NOTIFY resultChanged FINAL) Q_CLASSINFO("DefaultProperty", "data") - Q_ENUMS(StandardCode) public: explicit QQuickPlatformDialog(QPlatformTheme::DialogType type, QObject *parent = nullptr); @@ -98,6 +97,7 @@ public: void setVisible(bool visible); enum StandardCode { Rejected, Accepted }; + Q_ENUM(StandardCode) int result() const; void setResult(int result); -- cgit v1.2.3