summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)