PDA

View Full Version : Anchoring and Dragging



frankiefrank
20th September 2011, 10:48
I'm making my first steps with QML. No newbie forum for Qt Quick as it's so fresh :-) So I'll just ask here.

I have an Image I want to center in its parent but also to allow dragging it using a MouseArea. Naturally I'd use the "anchors.centerIn: parent" to get the image in the position I want, but then my drag doesn't work. Is there a way to define a starting position as easily as with the anchor but still allow dragging?

Added after 33 minutes:

May have found the solution in another thread here, saying I should set the anchors to undefined on the pressed signal.
Based on
http://doc.qt.nokia.com/stable/qml-mousearea.html#drag.target-prop

Will try.