I am building an QtQuick application by using StackView. Everything is going well except one major thing for me. I am using GridView to create some buttons or tables by using delegates. But if user clicks on these delegates (rectangle for my situation) and drag it to top or bottom, elements (rectangles) are moving. When user release it, its coming back to original position. I am looking for a solution to keep them fixed. Here is my snippet
ListModel {
id: stepList
ListElement { name: "button1"; src:"/images/stepsTitleActive.png"; }
ListElement { name: "button2"; src:"/images/stepsTitle.png" ; }
}
GridView {
id: stepListGrid
anchors.fill: parent
anchors.leftMargin: 42
anchors.topMargin: 73
model: stepList
cellHeight: 31
cellWidth: 164
delegate: Rectangle { // this is the place where i create buttons
id: rectfor
width: 158
height: 31
color: "transparent"
radius: 20
Text { // t his is the place where i put some texts in the buttons
color: "#4A4A4A"
text: name
font.family: "SF Pro Text"
font.weight: 500
font.pixelSize: 11
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: 9
z: 999
}
Image { // this is the place background for buttons(rectangles)
id: stepListBackground
anchors.fill: parent
source: src
}
}
}
User can click and hold on button1 and can move it up and down, with whole gridview elements. I want to disable it. I've read this document below but could not figure it out.
https://doc-snapshots.qt.io/qt6-dev/qml-qtquick-gridview.html#delegate-prop