Detecting a drop- or drag cancel event outside of my application
-
I need to detect when an active drag was dropped or cancelled outside of my application. I don't need the mime data or anything about it, just a notice when the current drag is cancelled or dropped outside. Qt doesn't seem to throw any events when this happens.
Is there a neat way to solve this?btw. The exec()-function of the drag object returns "ignored" in any case. Can this be changed somehow to tell me when it was cancelled outside?
-
Hi,
What about checking cursor position when
QDragobject is destroyed?Something like this:
connect(&drag,&QDrag::destroyed,[this]() { if(!parentWidget()->rect().contains(parentWidget()->mapFromGlobal(QCursor::pos()))) qDebug()<<"canceled outside"; else qDebug()<<"canceled inside"; }); -
Hi,
What about checking cursor position when
QDragobject is destroyed?Something like this:
connect(&drag,&QDrag::destroyed,[this]() { if(!parentWidget()->rect().contains(parentWidget()->mapFromGlobal(QCursor::pos()))) qDebug()<<"canceled outside"; else qDebug()<<"canceled inside"; }); -
Q qwasder85 has marked this topic as solved on