[Qt-qml] Row, Loader, Drag and Flickable make strange bedfellows
Martin Jones
martin.jones at nokia.com
Wed Sep 1 04:46:35 CEST 2010
Hi,
I'm struggling to understand the exact problem. Dragging items that are
positioned by a Row may lead to conflict since both the Row and the MouseArea
are manipulating the same item. Because of this I would have expected that
dragging the loaded item would be more successful.
Perhaps you could provide a small runnable example that demonstrates what you
want to achieve and where its going wrong.
BR,
Martin.
On Wed, 1 Sep 2010 08:22:45 am ext Bartosh Wroblevksy wrote:
> 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
More information about the Qt-qml
mailing list