aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-11-02 13:27:50 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-11-02 14:48:07 +0000
commit757fac28721b77664e4d3188548ee025c93bd9e1 (patch)
treea6c82662e057b2fdc637aef491b9845333d4e1f5 /src
parentb882fae50e12d32709f12621e5cfc4dab2def964 (diff)
Revert "QQuickTabBar: optimize layouting"
This reverts commit 80f6b146e6a1b3e7164a728271c0e17eb25c3e98, because the optimizations caused a binding loop on the TabBar page in the Gallery example. qrc:/pages/TabBarPage.qml:90:13: QML TabBar: Binding loop detected for property "implicitHeight" As a result, the tabs are looking broken at least when running with the Imagine style. Change-Id: I231bf5b21ecf92000bac94782567301214b64fec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquicktabbar.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/quicktemplates2/qquicktabbar.cpp b/src/quicktemplates2/qquicktabbar.cpp
index 52522262..814d14ea 100644
--- a/src/quicktemplates2/qquicktabbar.cpp
+++ b/src/quicktemplates2/qquicktabbar.cpp
@@ -228,29 +228,27 @@ void QQuickTabBarPrivate::updateLayout()
contentHeightChange = true;
}
- updatingLayout = true;
if (contentWidthChange)
emit q->contentWidthChanged();
if (contentHeightChange)
emit q->contentHeightChanged();
- updatingLayout = false;
}
-void QQuickTabBarPrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &)
+void QQuickTabBarPrivate::itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &)
{
- if (!updatingLayout && change.sizeChange() && QQuickItemPrivate::get(item)->componentComplete)
+ if (!updatingLayout)
updateLayout();
}
-void QQuickTabBarPrivate::itemImplicitWidthChanged(QQuickItem *item)
+void QQuickTabBarPrivate::itemImplicitWidthChanged(QQuickItem *)
{
- if (!updatingLayout && !hasContentWidth && QQuickItemPrivate::get(item)->componentComplete)
+ if (!updatingLayout && !hasContentWidth)
updateLayout();
}
-void QQuickTabBarPrivate::itemImplicitHeightChanged(QQuickItem *item)
+void QQuickTabBarPrivate::itemImplicitHeightChanged(QQuickItem *)
{
- if (!updatingLayout && !hasContentHeight && QQuickItemPrivate::get(item)->componentComplete)
+ if (!updatingLayout && !hasContentHeight)
updateLayout();
}
@@ -399,10 +397,7 @@ void QQuickTabBar::geometryChanged(const QRectF &newGeometry, const QRectF &oldG
{
Q_D(QQuickTabBar);
QQuickContainer::geometryChanged(newGeometry, oldGeometry);
- if (!d->updatingLayout)
- d->updateLayout();
- else
- polish();
+ d->updateLayout();
}
bool QQuickTabBar::isContent(QQuickItem *item) const