aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-12-28 20:24:18 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-01-02 13:31:19 +0000
commit406059366f88d4f0d862cd9d0a8d746e8c2335c1 (patch)
tree520e3288a5a1a92197cd318c77b68fe96424d3c2 /src
parent00a7dfd16d4484064bd0e5601720993d0525995a (diff)
QQuickMenu: fix Repeater support
QQuickMenu had itemChildAdded() copied from QQuickContainer, but it did not actually install an item change listener on the content item so itemChildAdded() got never called. Change-Id: Idfe558c7055b9a3df124b1f009941c423ecef4bb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickmenu.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquickmenu.cpp b/src/quicktemplates2/qquickmenu.cpp
index ab5415d3..74239cf2 100644
--- a/src/quicktemplates2/qquickmenu.cpp
+++ b/src/quicktemplates2/qquickmenu.cpp
@@ -461,8 +461,13 @@ void QQuickMenu::componentComplete()
void QQuickMenu::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem)
{
Q_D(QQuickMenu);
- Q_UNUSED(oldItem);
QQuickPopup::contentItemChange(newItem, oldItem);
+
+ if (oldItem)
+ QQuickItemPrivate::get(oldItem)->removeItemChangeListener(d, QQuickItemPrivate::Children);
+ if (newItem)
+ QQuickItemPrivate::get(newItem)->addItemChangeListener(d, QQuickItemPrivate::Children);
+
d->contentItem = newItem;
}