first tab is the current on load

fix sizing problems on first load
This commit is contained in:
Marco Martin 2011-12-15 20:19:29 +01:00
parent 2c7e559f04
commit 2fdf11eabf
2 changed files with 7 additions and 2 deletions

View File

@ -88,5 +88,10 @@ Item {
rightMargin: backgroundFrame.margins.right + buttonFrame.margins.right rightMargin: backgroundFrame.margins.right + buttonFrame.margins.right
bottomMargin: backgroundFrame.margins.bottom + buttonFrame.margins.bottom bottomMargin: backgroundFrame.margins.bottom + buttonFrame.margins.bottom
} }
Component.onCompleted: {
if (!root.currentTab) {
root.currentTab = tabBarLayout.children[0]
}
}
} }
} }

View File

@ -81,8 +81,8 @@ Item {
} }
Component.onCompleted: { Component.onCompleted: {
if (internal.tabGroup.currentTab == tab) { if (internal.tabGroup && internal.tabGroup.currentTab == tab) {
parent.parent.currentTab = root internal.tabGroup.currentTab = tab
} }
} }
} }