aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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;
}