[SailfishDevel] Dragging a scene with the mouse

dcaliste at free.fr dcaliste at free.fr
Wed Oct 2 08:30:58 UTC 2013


   I have an object that inherits QQuickItem. It displays, let say a picture,
and the user can use the mouse to click on it, then drag to move the picture
around and release the button. It is implemented by overloading
mousePressEvent(), mouseMoveEvent() and then mouseReleaseEvent(). During the the
mouseMoveEvent(), the object is repaint by calling update(). The paint() method
is overloaded to paint the image at the position given by the mouse. The mouse
event is activated by setAcceptedMouseButton(Qt::LeftButton) in the constructor.

   This QQuickItem is used in the "hello sailor" example (the one with one page
and a pulley menu to a second page) to replace the label "hello sailor". With my
desktop Qt (5.1.1) (so putting my object in a Rectangle), the mouse dragging is
working perfectly. But in the Sailfish emulator, when I drag, it works for some
distance and then, it triggers the pulley menu (which by the way capture all
mouse event like the mouseReleaseEvent() which are not send to my object

   Does someone encounter this issue already ? Do you have any idea where to
investigate ? I can send the source to compile on request.

Thanks for advising me,


More information about the Devel mailing list