summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_tabview.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-08-27 14:50:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-03 18:51:13 +0200
commit53fa52bb604ab28ee37aba26e155486e94c66dec (patch)
tree82ebc7fb1893d99e870475253405ddd195b827c9 /tests/auto/controls/data/tst_tabview.qml
parentc304d741a27b5822a35d1fb83f8f5e65719907ce (diff)
downloadqtquickcontrols-53fa52bb604ab28ee37aba26e155486e94c66dec.tar.gz
TabView: fix dynamic tab handling
Task-number: QTBUG-33162 Change-Id: I873b37bd157230f80237fd40f3e5149fbd0207ca Reviewed-by: Volker Krause <volker.krause@kdab.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.qml22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_tabview.qml b/tests/auto/controls/data/tst_tabview.qml
index 8093ebc3..708f0383 100644
--- a/tests/auto/controls/data/tst_tabview.qml
+++ b/tests/auto/controls/data/tst_tabview.qml
@@ -223,6 +223,28 @@ TestCase {
tabView.destroy()
}
+ function test_dynamicModel() {
+ var test_tabView = ' \
+ import QtQuick 2.1; \
+ import QtQuick.Controls 1.0; \
+ TabView { \
+ id: tabView; \
+ property alias repeater: repeater; \
+ Repeater { id: repeater; Tab { } } \
+ } '
+
+ var tabView = Qt.createQmlObject(test_tabView, testCase, '')
+ compare(tabView.count, 0)
+
+ tabView.repeater.model = 4
+ compare(tabView.count, 4)
+
+ tabView.repeater.model = 0
+ compare(tabView.count, 0)
+
+ tabView.destroy()
+ }
+
function test_mousePressOnTabBar() {
var test_tabView = 'import QtQuick 2.1; \
import QtQuick.Controls 1.0; \