From 038d5651940cfcd9fad017e6a4df00389b997da3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 1 Jun 2017 21:38:16 +0200 Subject: Let users disable the multi-touch support The newly added multi-touch support can create issues, especially together with Flickable that is unfortunately still not properly touch-compatible. The implementation is still based on synthesized mouse events, so things like Flickable::pressDelay that intercepts mouse presses and re-sends sends them after a delay, does not play well with touch-enabled controls. The easiest way we can disable the whole thing is to make multi- touch support a configurable feature, the same way hover support is. ./configure -no-feature-quicktemplates2-multitouch [...] Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... no [ChangeLog][Templates] Added a configure feature for disabling multi- touch support (configure -no-feature-quicktemplates2-multitouch). Task-number: QTBUG-61144 Change-Id: I0003ae925c2a499ecb3e2a5b720088bd963d9ad3 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickpopupitem.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quicktemplates2/qquickpopupitem.cpp') diff --git a/src/quicktemplates2/qquickpopupitem.cpp b/src/quicktemplates2/qquickpopupitem.cpp index 3a770bf7..6ccfd6ab 100644 --- a/src/quicktemplates2/qquickpopupitem.cpp +++ b/src/quicktemplates2/qquickpopupitem.cpp @@ -228,6 +228,7 @@ void QQuickPopupItem::mouseUngrabEvent() d->popup->mouseUngrabEvent(); } +#if QT_CONFIG(quicktemplates2_multitouch) void QQuickPopupItem::touchEvent(QTouchEvent *event) { Q_D(QQuickPopupItem); @@ -239,6 +240,7 @@ void QQuickPopupItem::touchUngrabEvent() Q_D(QQuickPopupItem); d->popup->touchUngrabEvent(); } +#endif #if QT_CONFIG(wheelevent) void QQuickPopupItem::wheelEvent(QWheelEvent *event) -- cgit v1.2.3 From 9b201572e518c976dee95f4c3146b4feedbb2e70 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 31 May 2017 09:05:20 +0200 Subject: Fix font inheritance for popups 1) First of all, Popup's QObject-parent depends on the way the Popup is declared in QML, or what is passed as a parent to createObject() when creating dynamic instances. For example: - Popup becomes a QObject child of of the contentItem: ApplicationWindow { Popup { } } - Popup becomes a QObject child of the window: ApplicationWindow { Item { Popup { } } } - Popup becomes a QObject child of the specified parent: ApplicationWindow { Component { id: component Popup { } } Component.onComplete: component.createObject(overlay) } Since QQuickWindow and QQuickView did not set the QObject-parent of their contentItem and rootObject, respectively, we had troubles finding popup instances, because window->findChildren() and window->contentItem()->findChildren() would produce inconsistent results. This has been fixed in qtdeclarative commit af6655885, so now we can use window->findChildren() reliably. 2) Popups inherit font from the associated window, not the parent item. It was wrong to call resolveFont() in setParentItem(), because the parent item might not change even though the associated window does. The piece of code was moved to setWindow() instead. 3) QQuickPopupItemPrivate::resolveFont() did not propagate the default font at all when the font was resolved before being associated to a window. 4) After the above fixes had been applied, to ensure that popups always inherit fonts and propagate them down to children as appropriate, we got a new test failure in tst_controls::Popup::test_font() indicating that there were extra font change notifiers triggered at creation time. This was fixed by associating "top-level" popups with the window as soon as they are appended to ApplicationWindow's default property, instead of waiting until the popup is complete and then doing a lookup in the parent hierarchy. Task-number: QTBUG-61114 Change-Id: I6185c76d50835cb7a06b03db0a3ac9ddad64bdd3 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickpopupitem.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quicktemplates2/qquickpopupitem.cpp') diff --git a/src/quicktemplates2/qquickpopupitem.cpp b/src/quicktemplates2/qquickpopupitem.cpp index 6ccfd6ab..952c2db6 100644 --- a/src/quicktemplates2/qquickpopupitem.cpp +++ b/src/quicktemplates2/qquickpopupitem.cpp @@ -88,6 +88,8 @@ void QQuickPopupItemPrivate::resolveFont() { if (QQuickApplicationWindow *window = qobject_cast(popup->window())) inheritFont(window->font()); + else + inheritFont(themeFont(QPlatformTheme::SystemFont)); } QQuickItem *QQuickPopupItemPrivate::getContentItem() -- cgit v1.2.3