[Qt-interest] QgraphicsScene: best way to manage events
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Fri Nov 26 16:13:51 CET 2010
On 2010-11-26 Mihail Mihail Naydenov wrote:
> You impl dragMoveEvent, there you accept ;)
That is exactly the "workaround" I just found here: http://lists.kde.org/?l=kde-devel&m=120895678821473
Apparently drag'n'drop only works on an *item* in the scene: I tried to drag an image onto the "Robot" in the qgraphicsview/dragdroprobot, and indeed, the cursor changes shape to accepted, once I modified the dragEnterEvent() to accept *all* events (regardless of MIME type). And the dropEvent method is also called as expected (implemented on the Robot item, and which off course does not know what to do with the image data).
But in case of the QGraphicsScene itself it seems one has to do as you described, accept the drag'n'drop event in the dragMoveEvent(), as also suggested in above link.
If this is really the case then this should be fixed (I am using the latest Qt 4.7.1 on Windows XP) and I will create a bug entry for this.
I will try this right now...
Thanks, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list