[Qt-qml] How to change mouseGrabber in Qml?
Eduardo Fleury
eduardo.fleury at openbossa.org
Fri Oct 29 20:12:22 CEST 2010
Yes, I agree this needs polishing.
For simple cases maybe it's possible to update the position of the
dynamically created item in the "positionChanged()" handler of the _same_
MouseArea that implements onPressAndHold.
IOW, you're not changing the mouse grabber but forwarding information to the
target draggable item.
Best,
Eduardo
On Thu, Oct 28, 2010 at 3:31 AM, Gregory Schlomoff <
gregory.schlomoff at gmail.com> wrote:
> 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
> >
> >
>
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
>
--
Eduardo M. Fleury
OpenBossa - INdT
http://eduardofleury.com/
http://www.openbossa.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101029/2e6f50e4/attachment.html
More information about the Qt-qml
mailing list