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/qquickpopupitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quicktemplates2/qquickpopupitem.cpp') 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