summaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickcontainer.cpp')
-rw-r--r--src/quicktemplates2/qquickcontainer.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/quicktemplates2/qquickcontainer.cpp b/src/quicktemplates2/qquickcontainer.cpp
index 8217a3ff..c4af6151 100644
--- a/src/quicktemplates2/qquickcontainer.cpp
+++ b/src/quicktemplates2/qquickcontainer.cpp
@@ -336,21 +336,6 @@ void QQuickContainerPrivate::reorderItems()
}
}
-// Helper function needed for derived classes such as QQuickMenuBarPrivate.
-void QQuickContainerPrivate::addObject(QObject *obj)
-{
- Q_Q(QQuickContainer);
- QQuickItem *item = qobject_cast<QQuickItem *>(obj);
- if (item) {
- if (QQuickItemPrivate::get(item)->isTransparentForPositioner())
- item->setParentItem(effectiveContentItem(contentItem));
- else if (contentModel->indexOf(item, nullptr) == -1)
- q->addItem(item);
- } else {
- contentData.append(obj);
- }
-}
-
void QQuickContainerPrivate::_q_currentIndexChanged()
{
Q_Q(QQuickContainer);
@@ -394,7 +379,15 @@ void QQuickContainerPrivate::contentData_append(QQmlListProperty<QObject> *prop,
{
QQuickContainer *q = static_cast<QQuickContainer *>(prop->object);
QQuickContainerPrivate *p = QQuickContainerPrivate::get(q);
- p->addObject(obj);
+ QQuickItem *item = qobject_cast<QQuickItem *>(obj);
+ if (item) {
+ if (QQuickItemPrivate::get(item)->isTransparentForPositioner())
+ item->setParentItem(effectiveContentItem(p->contentItem));
+ else if (p->contentModel->indexOf(item, nullptr) == -1)
+ q->addItem(item);
+ } else {
+ p->contentData.append(obj);
+ }
}
int QQuickContainerPrivate::contentData_count(QQmlListProperty<QObject> *prop)