[Qt-interest] [4.5] QGraphicsView does not propagate drag & drop events

Amit Kumar Sharma qtbond007 at gmail.com
Tue Jul 28 12:22:56 CEST 2009


Items do not receive drag and drop events by default; to enable this
feature, call setAcceptDrops(true).

On Tue, Jul 28, 2009 at 11:38 AM, André Somers<andre at familiesomers.nl> wrote:
> Hi,
>
>
>
> I am trying to implement a QGraphicsView-based visualization that requires
> some drag and drop. While dropping objects on the scene works nicely, I am
> having trouble implementing dragging one GraphicsViewItem onto another. The
> drag operation starts, but there does seem to be any drag & drop events
> happening in my graphic items. I have called setAcceptDrops(true) on the
> graphics items that should accept drops, but that does not seem to help.
>
> I am not sure if it is relevant, but the items I am dragging are child items
> of items that have the QGraphicsItem::ItemIsMovable flag set.
>
>
>
> I have reimplemented all the relevant methods in the item that should
> receive the drop (dragEnterEvent, dragMoveEvent, dragLeaveEvent, dropEvent)
> but qDebug() statements show that they are not called. Is there something I
> am overlooking?
>
>
>
> Thanks!
>
>
>
> André
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>



-- 
cheers,

AK




More information about the Qt-interest-old mailing list