[Qt-qml] How to change mouseGrabber in Qml?

Gregory Schlomoff gregory.schlomoff at gmail.com
Thu Oct 28 08:31:59 CEST 2010


Drag and drop is still something that is not really implemented in QML.

>From our experience, the best way to achieve it is to create a custom
QML component in C++ that will in turn call the standard Qt API to
handle drag&drop with QGraphicItem

You can see an example implementation that we did here :
http://bitbucket.org/gregschlom/qml-drag-drop

(Be aware though that this code is missing some of the new features we
added afterwards. But it will give you a good starting point)

Cheers,

Greg


On Thu, Oct 28, 2010 at 12:52 PM,  <Antti.S.Vaisanen at nokia.com> wrote:
> Hi,
> I need to select an item from a GridView by long tapping it and drag and
> drop it to other place.
> If I dynamically create a new item onPressAndHold event handler in a
> GridView delegate, how can I make new item a “mouse grabber” and continue
> with dragging?
> Any ideas to accomplish this task are more than welcome.
>
> Cheers,
> Antti
>
>
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
>




More information about the Qt-qml mailing list