Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.0 Alpha
-
None
-
4f2251caa995cab6b5231580b7b4c7e3be55ba14
Description
When tabs created dynamically by Repeater (by adding items into model), TabBar cannot set proper width for them. On adding tabs I also see this warning:
QQuickItem::stackAfter: Cannot stack after 0x27c9a50, which must be a sibling
I also only see newly added items when I set them as current. If remove line, that set added tab as current, this tab not even displayed.
Also, if I uncomment code that defines second ListItem in tab model, on adding new tabs I see the following warnings:
file:///mnt/store/Development/qt5.6_git/qml/Qt/labs/controls/TabBar.qml:52:18: QML ListView: Binding loop detected for property "currentIndex"
import QtQuick 2.5 import QtQuick.Layouts 1.1 import Qt.labs.controls 1.0 ApplicationWindow { visible: true width: 640 height: 300 ListModel { id: tabModel ListElement { text: "Test 0" } // ListElement { // text: "Test 1" // } } ColumnLayout { anchors.fill: parent TabBar { id: tabBar Layout.fillHeight: false Layout.fillWidth: true Repeater { model: tabModel delegate: TabButton { text: model.text } } } Item { Layout.fillHeight: true Layout.fillWidth: true } Button { Layout.fillHeight: false Layout.fillWidth: false Layout.alignment: Qt.AlignHCenter text: "Add" onClicked: { tabModel.append({ "text": "Test new" }) tabBar.currentIndex = tabModel.count - 1 } } } }
Attachments
Issue Links
- relates to
-
QTBUG-48720 Stack before/after warnings in auto tests
- Closed
For Gerrit Dashboard: QTBUG-48993 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
138923,3 | TabBar: fix the default layouting of dynamically added tabs | 5.6 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |
138924,2 | TabBar: fix binding loop on currentIndex | 5.6 | qt/qtquickcontrols2 | Status: MERGED | +2 | 0 |