Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
None
-
5.12.3
-
None
-
-
619dfbe8d02347cedb93a949cde627ec4424e0ae (qt/qtdeclarative/dev)
-
Shovelling Snow, Q1/2020 Finale
Description
It would be nice if StackLayout had an attached property 'index' or similar to be used in its children; e.g. TabBar has such a property already.
When a StackLayout is used with a TabBar, they could be easily combined:
TabBar { id: tabBar TabButton { text: "one" } TabButton { text: "two" } } StackLayout { currentIndex: tabBar.currentIndex Loader { source: "One.qml" active: parent.currentIndex === StackLayout.index // <- to be added } Loader { source: "Two.qml" active: parent.currentIndex === StackLayout.index // <- to be added } }
Untested, but I hope it is possible to grasp the idea...
Attachments
Issue Links
- relates to
-
QTBUG-45779 Feature request: StackLayout::currentItem
- Open