Usage of Delegate
Unsolved
QML and Qt Quick
-
@RG90
As @Eeli-K said, you have to declare your composite component as an Item, which includes your sub-elements.
Talking about dragging items on screen, you have to use the MouseArea component, which has a nice property calleddrag.target
which gives draggable functionalities on a given element, passing its id.Here my example code:
ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Drag me!") Item { id: myCompositeItem Rectangle { width: 100 height: 100 color: "red" } Rectangle { width: 100 height: 100 x: 250 color: "green" } } MouseArea { anchors.fill: parent drag.target: myCompositeItem } }
I don't know if I fully answered to your question, since you were talking about delegates.