diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-10-26 17:30:24 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-10-27 10:27:32 +0000 |
commit | 943dd6eadb207447d8eabe207f6d77494797a52c (patch) | |
tree | 6bd3668d3519571ad7bd971915fd48e1993f76e8 /tests | |
parent | 1d305ebf16d465b65dded01260845460ec06e40b (diff) |
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 <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_tabbar.qml | 15 |
1 files changed, 15 insertions, 0 deletions
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() + } } |