[Qt-qml] Row, Loader, Drag and Flickable make strange bedfellows

Bartosh Wroblevksy bartosh at live.com
Wed Sep 1 02:48:57 CEST 2010


Thank you all on the QML interest for answering my questions. I would really really really appreciate if this one could be addressed.

From: bartosh at live.com
To: qt-qml at trolltech.com
Date: Tue, 31 Aug 2010 18:22:45 -0400
Subject: [Qt-qml] Row, Loader, Drag and Flickable make strange bedfellows








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






 		 	   		  

_______________________________________________
Qt-qml mailing list
Qt-qml at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100831/816ad552/attachment.html 


More information about the Qt-qml mailing list