diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-07-21 09:34:06 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-07-21 09:34:26 +0200 |
commit | ef63be14186607c2b806f45d257d8aba6e9a6472 (patch) | |
tree | f86e663d32e2ad8cfd6ac307dd11526e561c66ba /src | |
parent | 7eace7ac5a74b68338b948857c4f2bc2e58abc48 (diff) | |
parent | d6c8721476607f22896785baa547a7551015f164 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: Idb1895dae2870dbed860ba3106fe52b01d733504
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/platform/widgets/qwidgetplatform_p.h | 6 | ||||
-rw-r--r-- | src/quicktemplates2/qquickdrawer.cpp | 4 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpage.cpp | 8 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpane.cpp | 8 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpopup.cpp | 6 | ||||
-rw-r--r-- | src/quicktemplates2/qquickpopupitem.cpp | 2 |
6 files changed, 18 insertions, 16 deletions
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<QWidgetPlatformMenu>("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<QWidgetPlatformMenuItem>("MenuItem", parent); #else + Q_UNUSED(parent); return nullptr; #endif } @@ -135,11 +137,15 @@ namespace QWidgetPlatform #ifndef QT_NO_SYSTEMTRAYICON return createWidget<QWidgetPlatformSystemTrayIcon>("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<QWidgetPlatformColorDialog>("ColorDialog", parent); diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index 007ce4e6..96d48f08 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -357,10 +357,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/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<QObject> QQuickPage::contentData() { - Q_D(QQuickPage); - return QQmlListProperty<QObject>(d->getContentItem(), nullptr, + return QQmlListProperty<QObject>(contentItem(), nullptr, QQuickItemPrivate::data_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, @@ -321,8 +320,7 @@ QQmlListProperty<QObject> QQuickPage::contentData() */ QQmlListProperty<QQuickItem> QQuickPage::contentChildren() { - Q_D(QQuickPage); - return QQmlListProperty<QQuickItem>(d->getContentItem(), nullptr, + return QQmlListProperty<QQuickItem>(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<QObject> QQuickPane::contentData() { - Q_D(QQuickPane); - return QQmlListProperty<QObject>(d->getContentItem(), nullptr, + return QQmlListProperty<QObject>(contentItem(), nullptr, QQuickItemPrivate::data_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, @@ -229,8 +228,7 @@ QQmlListProperty<QObject> QQuickPane::contentData() */ QQmlListProperty<QQuickItem> QQuickPane::contentChildren() { - Q_D(QQuickPane); - return QQmlListProperty<QQuickItem>(d->getContentItem(), nullptr, + return QQmlListProperty<QQuickItem>(contentItem(), nullptr, QQuickItemPrivate::children_append, QQuickItemPrivate::children_count, QQuickItemPrivate::children_at, diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 39bd56a1..4dba5893 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -265,6 +265,7 @@ void QQuickPopupPrivate::init() q->setParentItem(qobject_cast<QQuickItem *>(parent)); QObject::connect(popupItem, &QQuickItem::enabledChanged, q, &QQuickPopup::enabledChanged); QObject::connect(popupItem, &QQuickControl::paddingChanged, q, &QQuickPopup::paddingChanged); + QObject::connect(popupItem, &QQuickControl::contentItemChanged, q, &QQuickPopup::contentItemChanged); positioner = new QQuickPopupPositioner(q); } @@ -387,8 +388,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: @@ -2247,7 +2248,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 a8d35596..27528f2f 100644 --- a/src/quicktemplates2/qquickpopupitem.cpp +++ b/src/quicktemplates2/qquickpopupitem.cpp @@ -105,7 +105,7 @@ QQuickItem *QQuickPopupItemPrivate::getContentItem() { Q_Q(QQuickPopupItem); if (!contentItem) - contentItem = new QQuickItem(q); + return new QQuickItem(q); return contentItem; } |