[Qt-qml] Row, Loader, Drag and Flickable make strange bedfellows
Bartosh Wroblevksy
bartosh at live.com
Wed Sep 1 00:22:45 CEST 2010
Hello QML-ers
This is a somewhat complicated example. So I apologize in advance. I am writing this to get some guidance. I have a row of loaders which loads a rectangle. Like this:
Flickable{
ListModel {
id: aModel
}
..
Row{
Repeater {
model:aModel
Loader { //loads a qml rectangle from "aModel"
I have set a mouse area on the loaded rectangle like this:
Rectangle {
id: rect
MouseArea {
anchors.fill: parent
drag.target: rect
...
...
}
}
First off, I have to ask if this is the intended way of making an item draggable when it is interface by a Loader. The reason I ask is because the Loader creates an invisible item that contains the rect. This means that instead of
drag.target:rect
I have to write
drag.target:rect.parent
I have to do this because combining a drag with a move of items in the model of "aModel" makes very strange things happen. Am I doing things right?
Thanks,
Bartosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100831/af916d73/attachment.html
More information about the Qt-qml
mailing list