summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-01-29 12:31:47 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-02-02 11:23:30 +0000
commit94fe5ab8a619d009d698214623b8a9b5e2746f1b (patch)
tree693d522701bb2a1ddd6a0292b3b34a93abe46a30
parentead40640d55ed0f96f84f54c627e870727d45d7d (diff)
downloadqtquickcontrols-94fe5ab8a619d009d698214623b8a9b5e2746f1b.tar.gz
Not update TabView.currentIndex when loader inserting
Autotest is included. Task-number: QTBUG-43701 Change-Id: I60664d78988ee8d099e502e49711d69552e08312 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/controls/TabView.qml1
-rw-r--r--tests/auto/controls/data/tst_tabview.qml17
2 files changed, 17 insertions, 1 deletions
diff --git a/src/controls/TabView.qml b/src/controls/TabView.qml
index 71dc9b26..f8cf78b8 100644
--- a/src/controls/TabView.qml
+++ b/src/controls/TabView.qml
@@ -277,7 +277,6 @@ FocusScope {
if (completed)
tab.Component.onDestruction.connect(stack.onDynamicTabDestroyed.bind(tab))
__tabs.append({tab: tab})
- __didInsertIndex(__tabs.count - 1)
tabAdded = true
}
}
diff --git a/tests/auto/controls/data/tst_tabview.qml b/tests/auto/controls/data/tst_tabview.qml
index 9e556dd1..46df9177 100644
--- a/tests/auto/controls/data/tst_tabview.qml
+++ b/tests/auto/controls/data/tst_tabview.qml
@@ -443,6 +443,23 @@ TestCase {
item.destroy()
}
+ function test_43701() {
+ var test_tabView = ' \
+ import QtQuick 2.2; \
+ import QtQuick.Controls 1.3; \
+ TabView { \
+ id: tabView; \
+ currentIndex: 2; \
+ Tab {} Tab {} Tab {} \
+ } '
+
+ var tabView = Qt.createQmlObject(test_tabView, testCase, '')
+ compare(tabView.count, 3)
+ compare(tabView.currentIndex, 2)
+
+ tabView.destroy()
+ }
+
function printGeometry(control) {
console.log("printGeometry:" + control)
console.log("x=" + control.x + ",y=" + control.y + ",w=" + control.width + ",h=" + control.height)