From 7a09033636846253f07737431162858ba968cb31 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 11 Jul 2017 12:53:28 +0200 Subject: QQuickPageIndicatorPrivate: add missing override Somehow this passed the 5.9 CI, but the dev branch throws an error: qquickpageindicator.cpp:110:10: error: 'itemChildAdded' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] Change-Id: I2effeb908552fa2759057cf0953ea65737be3f9a Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickpageindicator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickpageindicator.cpp b/src/quicktemplates2/qquickpageindicator.cpp index 8f9c8525..df720c91 100644 --- a/src/quicktemplates2/qquickpageindicator.cpp +++ b/src/quicktemplates2/qquickpageindicator.cpp @@ -107,7 +107,7 @@ public: void updatePressed(bool pressed, const QPointF &pos = QPointF()); void setContextProperty(QQuickItem *item, const QString &name, const QVariant &value); - void itemChildAdded(QQuickItem *, QQuickItem *child); + void itemChildAdded(QQuickItem *, QQuickItem *child) override; int count; int currentIndex; -- cgit v1.2.3 From e841c0a252099778fcaa01593592a6b92844e04d Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 14 Jul 2017 09:59:23 +0200 Subject: QQuickDrawer: fix multi-touch leaking through modal overlay The first touch point was blocked as appropriate, but the consequent touch points were leaking through to other popups below Drawers' modal overlay. Task-number: QTBUG-61581 Change-Id: I1c3e28e3d25b7489c4a9b684107fd1b5158e1674 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickdrawer.cpp | 4 ++-- src/quicktemplates2/qquickpopup.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index 20279b03..45c9a3fe 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -347,10 +347,10 @@ bool QQuickDrawerPrivate::grabMouse(QQuickItem *item, QMouseEvent *event) bool QQuickDrawerPrivate::grabTouch(QQuickItem *item, QTouchEvent *event) { Q_Q(QQuickDrawer); - handleTouchEvent(item, event); + bool handled = handleTouchEvent(item, event); if (!window || !interactive || popupItem->keepTouchGrab() || !event->touchPointStates().testFlag(Qt::TouchPointMoved)) - return false; + return handled; bool overThreshold = false; for (const QTouchEvent::TouchPoint &point : event->touchPoints()) { diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 33b2ac1a..c457b347 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -383,8 +383,8 @@ bool QQuickPopupPrivate::handleTouchEvent(QQuickItem *item, QTouchEvent *event) case QEvent::TouchUpdate: case QEvent::TouchEnd: for (const QTouchEvent::TouchPoint &point : event->touchPoints()) { - if (!acceptTouch(point) && !blockInput(item, point.pos())) - continue; + if (!acceptTouch(point)) + return blockInput(item, point.pos()); switch (point.state()) { case Qt::TouchPointPressed: -- cgit v1.2.3 From f7250ca1822f08963f4d9cef6d79a9cfaaddef0d Mon Sep 17 00:00:00 2001 From: Jason Erb Date: Thu, 13 Jul 2017 15:21:36 -0400 Subject: Fix unused parameter errors in qwidgetplatform_p.h Task-number: QTBUG-61950 Change-Id: Idbc6bcc8f08dcccc50b409a055ab6c35e1f9aef8 Reviewed-by: Mitch Curtis Reviewed-by: J-P Nurmi --- src/imports/platform/widgets/qwidgetplatform_p.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/imports/platform/widgets/qwidgetplatform_p.h b/src/imports/platform/widgets/qwidgetplatform_p.h index 5a983a33..c203406c 100644 --- a/src/imports/platform/widgets/qwidgetplatform_p.h +++ b/src/imports/platform/widgets/qwidgetplatform_p.h @@ -121,6 +121,7 @@ namespace QWidgetPlatform #if defined(QT_WIDGETS_LIB) && QT_CONFIG(menu) return createWidget("Menu", parent); #else + Q_UNUSED(parent); return nullptr; #endif } @@ -128,6 +129,7 @@ namespace QWidgetPlatform #if defined(QT_WIDGETS_LIB) && QT_CONFIG(menu) return createWidget("MenuItem", parent); #else + Q_UNUSED(parent); return nullptr; #endif } @@ -135,11 +137,15 @@ namespace QWidgetPlatform #ifndef QT_NO_SYSTEMTRAYICON return createWidget("SystemTrayIcon", parent); #else + Q_UNUSED(parent); return nullptr; #endif } static inline QPlatformDialogHelper *createDialog(QPlatformTheme::DialogType type, QObject *parent = nullptr) { +#if !defined(QT_WIDGETS_LIB) || !(QT_CONFIG(colordialog) || QT_CONFIG(filedialog) || QT_CONFIG(fontdialog) || QT_CONFIG(messagebox)) + Q_UNUSED(parent); +#endif switch (type) { #if defined(QT_WIDGETS_LIB) && QT_CONFIG(colordialog) case QPlatformTheme::ColorDialog: return createWidget("ColorDialog", parent); -- cgit v1.2.3 From d6c8721476607f22896785baa547a7551015f164 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 14 Jul 2017 13:18:42 +0200 Subject: Fix QQuickControlPrivate::getContentItem() overrides When no content item is explicitly assigned, container type of controls (Page, Pane, Popup...) create a default content item on demand. Notice that the content item is created from within the contentItem() getter, so it must not emit contentItemChanged() to avoid binding loops. QQuickControl::setContentItem_helper() was introduced in 1eaebd0 to mitigate basically the same problem with QQuickScrollView, which has its own special lazy creation of a Flickable content item. Now, the problem is that the other container controls are not executing setContentItem_helper(), because they have already assigned contentItem and therefore it returns right away. Fix the issue by returning the new content item without assigning it to let setContentItem_helper() do its job. The issue was spotted while debugging QTBUG-61434. Change-Id: Id6f84748ec08bbdfd3bd934dda627e2619af7d2a Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickpage.cpp | 8 +++----- src/quicktemplates2/qquickpane.cpp | 8 +++----- src/quicktemplates2/qquickpopup.cpp | 2 +- src/quicktemplates2/qquickpopupitem.cpp | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/quicktemplates2/qquickpage.cpp b/src/quicktemplates2/qquickpage.cpp index 40d47cda..ecc5a9c9 100644 --- a/src/quicktemplates2/qquickpage.cpp +++ b/src/quicktemplates2/qquickpage.cpp @@ -107,7 +107,7 @@ QQuickItem *QQuickPagePrivate::getContentItem() { Q_Q(QQuickPage); if (!contentItem) - contentItem = new QQuickItem(q); + return new QQuickItem(q); return contentItem; } @@ -298,8 +298,7 @@ void QQuickPage::setContentHeight(qreal height) */ QQmlListProperty QQuickPage::contentData() { - Q_D(QQuickPage); - return QQmlListProperty(d->getContentItem(), nullptr, + return QQmlListProperty(contentItem(), nullptr, QQuickItemPrivate::data_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, @@ -321,8 +320,7 @@ QQmlListProperty QQuickPage::contentData() */ QQmlListProperty QQuickPage::contentChildren() { - Q_D(QQuickPage); - return QQmlListProperty(d->getContentItem(), nullptr, + return QQmlListProperty(contentItem(), nullptr, QQuickItemPrivate::children_append, QQuickItemPrivate::children_count, QQuickItemPrivate::children_at, diff --git a/src/quicktemplates2/qquickpane.cpp b/src/quicktemplates2/qquickpane.cpp index efa85e0c..b89131c4 100644 --- a/src/quicktemplates2/qquickpane.cpp +++ b/src/quicktemplates2/qquickpane.cpp @@ -114,7 +114,7 @@ QQuickItem *QQuickPanePrivate::getContentItem() { Q_Q(QQuickPane); if (!contentItem) - contentItem = new QQuickItem(q); + return new QQuickItem(q); return contentItem; } @@ -206,8 +206,7 @@ void QQuickPane::setContentHeight(qreal height) */ QQmlListProperty QQuickPane::contentData() { - Q_D(QQuickPane); - return QQmlListProperty(d->getContentItem(), nullptr, + return QQmlListProperty(contentItem(), nullptr, QQuickItemPrivate::data_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, @@ -229,8 +228,7 @@ QQmlListProperty QQuickPane::contentData() */ QQmlListProperty QQuickPane::contentChildren() { - Q_D(QQuickPane); - return QQmlListProperty(d->getContentItem(), nullptr, + return QQmlListProperty(contentItem(), nullptr, QQuickItemPrivate::children_append, QQuickItemPrivate::children_count, QQuickItemPrivate::children_at, diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index c457b347..ce4072e5 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -261,6 +261,7 @@ void QQuickPopupPrivate::init() popupItem->setVisible(false); q->setParentItem(qobject_cast(parent)); QObject::connect(popupItem, &QQuickControl::paddingChanged, q, &QQuickPopup::paddingChanged); + QObject::connect(popupItem, &QQuickControl::contentItemChanged, q, &QQuickPopup::contentItemChanged); positioner = new QQuickPopupPositioner(q); } @@ -2027,7 +2028,6 @@ void QQuickPopup::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) { Q_UNUSED(newItem); Q_UNUSED(oldItem); - emit contentItemChanged(); } void QQuickPopup::fontChange(const QFont &newFont, const QFont &oldFont) diff --git a/src/quicktemplates2/qquickpopupitem.cpp b/src/quicktemplates2/qquickpopupitem.cpp index 952c2db6..6f9d7697 100644 --- a/src/quicktemplates2/qquickpopupitem.cpp +++ b/src/quicktemplates2/qquickpopupitem.cpp @@ -96,7 +96,7 @@ QQuickItem *QQuickPopupItemPrivate::getContentItem() { Q_Q(QQuickPopupItem); if (!contentItem) - contentItem = new QQuickItem(q); + return new QQuickItem(q); return contentItem; } -- cgit v1.2.3