From c74dde76c5e27396e70ab1b8498f2c74f68134c0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Fri, 30 Sep 2016 09:55:08 +0200 Subject: TabBar: re-layout as appropriate in tab button size changes Auto-tested by the next change. Change-Id: I28ff7e82c0255b93d23cff7cbe111406d525f24b Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickcontainer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/quicktemplates2/qquickcontainer.cpp') diff --git a/src/quicktemplates2/qquickcontainer.cpp b/src/quicktemplates2/qquickcontainer.cpp index 34e198fc..be2acf39 100644 --- a/src/quicktemplates2/qquickcontainer.cpp +++ b/src/quicktemplates2/qquickcontainer.cpp @@ -144,7 +144,8 @@ static QQuickItem *effectiveContentItem(QQuickItem *item) return item; } -QQuickContainerPrivate::QQuickContainerPrivate() : contentModel(nullptr), currentIndex(-1), updatingCurrent(false) +QQuickContainerPrivate::QQuickContainerPrivate() : contentModel(nullptr), currentIndex(-1), updatingCurrent(false), + changeTypes(Destroyed | Parent | SiblingOrder) { } @@ -164,7 +165,7 @@ void QQuickContainerPrivate::cleanup() for (int i = 0; i < count; ++i) { QQuickItem *item = itemAt(i); if (item) - QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::Destroyed | QQuickItemPrivate::Parent | QQuickItemPrivate::SiblingOrder); + QQuickItemPrivate::get(item)->removeItemChangeListener(this, changeTypes); } if (contentItem) { @@ -196,7 +197,7 @@ void QQuickContainerPrivate::insertItem(int index, QQuickItem *item) updatingCurrent = true; item->setParentItem(effectiveContentItem(contentItem)); - QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::Destroyed | QQuickItemPrivate::Parent | QQuickItemPrivate::SiblingOrder); + QQuickItemPrivate::get(item)->addItemChangeListener(this, changeTypes); contentModel->insert(index, item); q->itemAdded(index, item); @@ -242,7 +243,7 @@ void QQuickContainerPrivate::removeItem(int index, QQuickItem *item) currentChanged = true; } - QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::Destroyed | QQuickItemPrivate::Parent | QQuickItemPrivate::SiblingOrder); + QQuickItemPrivate::get(item)->removeItemChangeListener(this, changeTypes); item->setParentItem(nullptr); contentModel->remove(index); -- cgit v1.2.3