Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.4, 6.1.0
-
3aad05bc09 (qt/qtdeclarative/dev) 3aad05bc09 (qt/tqtc-qtdeclarative/dev) def37f47b0 (qt/qtdeclarative/6.3) def37f47b0 (qt/tqtc-qtdeclarative/6.3)
Description
When a listview with sections is added to a Drawer, first element in listview is not visible. Please refer to the attached sample and the snapshot for the issue.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 Window { id: root width: 640 height: 480 visible: true Button { anchors.centerIn: parent text: "drawer" onClicked: { if (drawer.opened) drawer.close() else drawer.open() } } Drawer { id: drawer width: 0.33 * root.width height: root.height clip: true ListView { id: listview width: parent.width height: parent.height clip: true model: ListModel { id: stackviewmodel ListElement { title: "page 1" isVisible: true section: "section 1" } ListElement { title: "page 2" isVisible: true section: "section 1" } ListElement { title: "page 3" isVisible: true section: "section 1" } ListElement { title: "page 4" isVisible: true section: "section 1" } ListElement { title: "page 5" isVisible: true section: "section 1" } ListElement { title: "page 1" isVisible: false section: "section 2" } ListElement { title: "page 2" isVisible: false section: "section 2" } ListElement { title: "page 1" isVisible: false section: "section 3" } ListElement { title: "page 2" isVisible: false section: "section 3" } ListElement { title: "page 1" isVisible: false section: "section 4" } ListElement { title: "page 2" isVisible: false section: "section 4" } } delegate: ItemDelegate { id: controlitemdelegate width: parent.width height: visible ? 48 : 0 text: model.title visible: model.isVisible padding: 0 } section.property: "section" section.criteria: ViewSection.FullString section.delegate: Component { Rectangle { id: sectionDelegate width: parent.width height: visible ? 48 : 0 Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom height: 1 color: "green" } Text { id: sectionTxt text: section width: parent.width font.bold: true anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter verticalAlignment: Text.AlignVCenter elide: Text.ElideMiddle } MouseArea { anchors.fill: parent onClicked: { for (var i = 0; i < stackviewmodel.count; i++) { var page = stackviewmodel.get(i) if (page.section === section) { page.isVisible = !page.isVisible } } } } } } ScrollIndicator.vertical: ScrollIndicator {} } } }
Attachments
Issue Links
- mentioned in
-
Page Loading...