summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_tabview.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-04-15 15:23:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-16 00:45:47 +0200
commit8272730f380ec9cf63db828e5726b933c52a98ef (patch)
tree619cd3d0df50bde2d68c7440003da48b93b829f1 /tests/auto/controls/data/tst_tabview.qml
parenta80b36edbe963495bca270a178237bc91772eed4 (diff)
downloadqtquickcontrols-8272730f380ec9cf63db828e5726b933c52a98ef.tar.gz
TabView: support dynamic tabs with createObject() and destroy()
Change-Id: I4c8e4219de6f510e4790343528fa7b6b502b7722 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com> Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_tabview.qml')
-rw-r--r--tests/auto/controls/data/tst_tabview.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tabview.qml b/tests/auto/controls/data/tst_tabview.qml
index 897565f1..efdb61f8 100644
--- a/tests/auto/controls/data/tst_tabview.qml
+++ b/tests/auto/controls/data/tst_tabview.qml
@@ -119,5 +119,20 @@ TestCase {
compare(tabView.count, 0)
tabView.destroy()
}
+
+ function test_dynamicTabs() {
+ var tabView = Qt.createQmlObject('import QtQuick 2.1; import QtQuick.Controls 1.0; TabView { property Component tabComponent: Component { Tab { } } }', testCase, '');
+ compare(tabView.count, 0)
+ var tab1 = tabView.tabComponent.createObject(tabView)
+ compare(tabView.count, 1)
+ var tab2 = tabView.tabComponent.createObject(tabView)
+ compare(tabView.count, 2)
+ tab1.destroy()
+ wait(0)
+ compare(tabView.count, 1)
+ tab2.destroy()
+ wait(0)
+ compare(tabView.count, 0)
+ }
}