diff options
Diffstat (limited to 'src/quicktemplates2/qquickpopup.cpp')
-rw-r--r-- | src/quicktemplates2/qquickpopup.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/quicktemplates2/qquickpopup.cpp b/src/quicktemplates2/qquickpopup.cpp index 840b9f19..9e0015fa 100644 --- a/src/quicktemplates2/qquickpopup.cpp +++ b/src/quicktemplates2/qquickpopup.cpp @@ -299,6 +299,7 @@ bool QQuickPopupPrivate::contains(const QPointF &scenePos) const return popupItem->contains(popupItem->mapFromScene(scenePos)); } +#if QT_CONFIG(quicktemplates2_multitouch) bool QQuickPopupPrivate::acceptTouch(const QTouchEvent::TouchPoint &point) { if (point.id() == touchId) @@ -311,6 +312,7 @@ bool QQuickPopupPrivate::acceptTouch(const QTouchEvent::TouchPoint &point) return false; } +#endif bool QQuickPopupPrivate::blockInput(QQuickItem *item, const QPointF &point) const { @@ -373,6 +375,7 @@ bool QQuickPopupPrivate::handleMouseEvent(QQuickItem *item, QMouseEvent *event) } } +#if QT_CONFIG(quicktemplates2_multitouch) bool QQuickPopupPrivate::handleTouchEvent(QQuickItem *item, QTouchEvent *event) { switch (event->type()) { @@ -418,6 +421,7 @@ bool QQuickPopupPrivate::handleTouchEvent(QQuickItem *item, QTouchEvent *event) return false; } +#endif bool QQuickPopupPrivate::prepareEnterTransition() { @@ -566,13 +570,20 @@ void QQuickPopupPrivate::setWindow(QQuickWindow *newWindow) QQuickOverlayPrivate::get(overlay)->removePopup(q); } + window = newWindow; + if (newWindow) { QQuickOverlay *overlay = QQuickOverlay::overlay(newWindow); if (overlay) QQuickOverlayPrivate::get(overlay)->addPopup(q); + + QQuickControlPrivate *p = QQuickControlPrivate::get(popupItem); + p->resolveFont(); + p->resolvePalette(); + if (QQuickApplicationWindow *appWindow = qobject_cast<QQuickApplicationWindow *>(newWindow)) + p->updateLocale(appWindow->locale(), false); // explicit=false } - window = newWindow; emit q->windowChanged(newWindow); if (complete && visible && window) @@ -1440,12 +1451,6 @@ void QQuickPopup::setParentItem(QQuickItem *parent) if (parent) { QObjectPrivate::connect(parent, &QQuickItem::windowChanged, d, &QQuickPopupPrivate::setWindow); QQuickItemPrivate::get(d->parentItem)->addItemChangeListener(d, QQuickItemPrivate::Destroyed); - - QQuickControlPrivate *p = QQuickControlPrivate::get(d->popupItem); - p->resolveFont(); - p->resolvePalette(); - if (QQuickApplicationWindow *window = qobject_cast<QQuickApplicationWindow *>(parent->window())) - p->updateLocale(window->locale(), false); // explicit=false } else { close(); } @@ -2053,10 +2058,12 @@ bool QQuickPopup::overlayEvent(QQuickItem *item, QEvent *event) event->accept(); return d->modal; +#if QT_CONFIG(quicktemplates2_multitouch) case QEvent::TouchBegin: case QEvent::TouchUpdate: case QEvent::TouchEnd: return d->handleTouchEvent(item, static_cast<QTouchEvent *>(event)); +#endif case QEvent::MouseButtonPress: case QEvent::MouseButtonRelease: @@ -2067,6 +2074,7 @@ bool QQuickPopup::overlayEvent(QQuickItem *item, QEvent *event) } } +#if QT_CONFIG(quicktemplates2_multitouch) void QQuickPopup::touchEvent(QTouchEvent *event) { Q_D(QQuickPopup); @@ -2078,6 +2086,7 @@ void QQuickPopup::touchUngrabEvent() Q_D(QQuickPopup); d->handleUngrab(); } +#endif #if QT_CONFIG(wheelevent) void QQuickPopup::wheelEvent(QWheelEvent *event) |