From 167f38750f23d226e1b5fc18f783fe6f4d4adf3e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 9 Aug 2016 23:45:20 +0200 Subject: TabBar: cull tabs outside the bar Same as a055629 for SwipeView, and 9cf30f1 for Menu. This hides the tabs until they become visible in the bar. Hiding them explicitly is not an option, because then they will never show up. This technique is used in QQuickItemView::initItem() and FxViewItem::setVisible(). Task-number: QTBUG-55129 Change-Id: I84a9e0acf6109dfff72130f7a2bf1e5e992829d8 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquicktabbar.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quicktemplates2/qquicktabbar.cpp') diff --git a/src/quicktemplates2/qquicktabbar.cpp b/src/quicktemplates2/qquicktabbar.cpp index a980a725..9a3995ab 100644 --- a/src/quicktemplates2/qquicktabbar.cpp +++ b/src/quicktemplates2/qquicktabbar.cpp @@ -187,6 +187,7 @@ void QQuickTabBar::itemAdded(int index, QQuickItem *item) { Q_D(QQuickTabBar); Q_UNUSED(index); + QQuickItemPrivate::get(item)->setCulled(true); // QTBUG-55129 if (QQuickTabButton *button = qobject_cast(item)) QObjectPrivate::connect(button, &QQuickTabButton::checkedChanged, d, &QQuickTabBarPrivate::updateCurrentIndex); if (isComponentComplete()) -- cgit v1.2.3