[Interest] DragLeaveEvent not called?

Alex Malyushytskyy alexmalvtk at gmail.com
Wed Sep 4 03:29:03 CEST 2013


I have not used drag and drop features myself, so I might be wrong,
but returning true in event handler means that event is stopped/ignored and
according to QWidget::dragEnterEvent documentation:

"If the event is ignored, the widget won't receive any drag move
events<qwidget.html#dragMoveEvent>
."

try to return false:

if(event->type()==QEvent::DragEnter){	info("Enter!");	return
false;}else if(event->type()==QEvent::DragLeave){	info("Leave!");	return
false;}




On Mon, Sep 2, 2013 at 1:41 AM, Etienne Sandré-Chardonnal <
etienne.sandre at m4x.org> wrote:

> Hi,
>
> I'm still experimenting Drag&Drop. I have experience in Qt since 2002 but
> this is the first time I am trying drag & drop...
>
> In my main widget, I have a dragDropZone widget which is the active
> dropping zone.
>
> In the main widget constructor, I call:
>
> ui->dragDropZone->setAcceptDrops(true);
>
> ui->dragDropZone->installEventFilter(this);
>
> Then in the event filter:
>
> if(event->type()==QEvent::DragEnter){	info("Enter!");	return true;}else if(event->type()==QEvent::DragLeave){	info("Leave!");	return true;}
>
> But I get only "Enter!" messages.
>
>
> Does another event take precedence over dragleave if accepted?
>
> Thanks!
>
> Etienne
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130903/6cdfa82b/attachment.html>


More information about the Interest mailing list