From 943dd6eadb207447d8eabe207f6d77494797a52c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 26 Oct 2015 17:30:24 +0100 Subject: TabBar: fix the default layouting of dynamically added tabs countChanged() used to be connected to updateLayout(), but this went missing somewhere around 73f931a7. Now we have the itemAdded() and itemRemoved() hooks that allow us to do the same more efficiently. Change-Id: I8a3eefb61555358d63fae63d066851038e332233 Task-number: QTBUG-48993 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_tabbar.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_tabbar.qml b/tests/auto/controls/data/tst_tabbar.qml index 8d2dbc17..7d659a9d 100644 --- a/tests/auto/controls/data/tst_tabbar.qml +++ b/tests/auto/controls/data/tst_tabbar.qml @@ -496,4 +496,19 @@ TestCase { control.destroy() } + + function test_layout() { + var control = tabBar.createObject(testCase, {spacing: 0, width: 200}) + + var tab1 = tabButton.createObject(control) + control.addItem(tab1) + tryCompare(tab1, "width", control.width) + + var tab2 = tabButton.createObject(control) + control.addItem(tab2) + tryCompare(tab1, "width", control.width / 2) + tryCompare(tab2, "width", control.width / 2) + + control.destroy() + } } -- cgit v1.2.3