[Qt-interest] QgraphicsScene: best way to manage events

Mihail Naydenov mlists at ymail.com
Sat Nov 27 11:06:53 CET 2010


It seams by design.  

I have reimpl GraphicsView and the situation is the same.

It seams only the first drag call is handled by enter, then all others are 
move-s.
The docs suggest if enter is accepted, then move will be send "to continue" the 
operation. 

But in general it is move that is important.  



----- Original Message ----
> From: "Oliver.Knoll at comit.ch" <Oliver.Knoll at comit.ch>
> To: qt-interest at trolltech.com
> Sent: Fri, November 26, 2010 5:13:51 PM
> Subject: Re: [Qt-interest] QgraphicsScene: best way to manage events
> 
> 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
> 
> 
> 
> _______________________________________________
> Qt-interest  mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 


      



More information about the Qt-interest-old mailing list