[Development] Drag and Drop: Leave instead of Drop

Cyril Oblikov munknex at gmail.com
Wed Aug 14 14:09:14 CEST 2013


For now it seems impossible to get QDropEvent if you previously set
dropActions to Qt::IgnoreAction. Even if you've accepted
QDragEnterEvent. QDragLeaveEvent is sent instead and
QApplication::mouseButtons() says that LeftButton is pressed, so it is
impossible to figure out whether dragged item entered other toplevel
widget or user dropped the item.

Usecase example: I want to know if user is dragging something (e.g.
files from Explorer) over my application. I use this info to highlight
areas where user might want to drop dragged items. So I need to know
if user dropped items anywhere on my app to remove the highlighting.

(Again: To get QDropEvent I can set dropActions to something other
than Qt::IgnoreAction, but in this case user will see the "accepting"
cursor everywhere in my app which is incorrect)

Any ideas? Should I file bug or maybe I just don't see the right solution?

More information about the Development mailing list