How to properly group objects with stacklayout
Unsolved
QML and Qt Quick
-
I'm trying to get a tab bar to switch position from a repeater to another item.
Currently I have this:
TabBar { id: bar width: parent.width TabButton { text: qsTr("History") } TabButton { text: qsTr("Details") } } StackLayout { id: stack width: parent.width currentIndex: bar.currentIndex Repeater { id: repeat model: attributes Row { id: detailsTab Layout.fillWidth: true clip: true spacing: 5 * scaleFactor Text { Layout.preferredWidth: popupColumn.width * 0.55 Layout.fillHeight: true text: attributeName wrapMode: Text.WrapAnywhere font.pixelSize: 12 * scaleFactor color: "#FFFCF7" } Text { Layout.fillWidth: true Layout.fillHeight: true text:attributeValue wrapMode: Text.WrapAnywhere font.pixelSize: 12 * scaleFactor color: "#FFFCF7" } } } Item { id: discoverTab } }
When the tab button history is clicked i expect the entire repeater to be displayed. Instead what happens is one field from the text object is displayed and when I click details tab the next text from the repeater is displayed.
How do I group properly to get the functionallity I want?
-
Just try your sample with two rectangles in a row. I tried and it is working fine. It could be issue with Layout what you have mentioned.