#include <DragAndDrop.h>
Inherits AZ::EBusTraits.
Inherited by AzQtComponents::DragAndDropEvents, and AzQtComponents::DragAndDropItemViewEvents.
Public Types | |
using | BusIdType = AZ::u32 |
The DragAndDropEvents bus is intended to act as a proxy for objects handling QT Drag and Drop Events on Widgets. Multiple handlers can register with a single Widget name to handle drag and drop events from that name. It is the handler authors' responsibility to not conflict with others' drag and drop handlers.
See http://doc.qt.io/qt-5.8/dnd.html for more complete documentation on QT Drag and Drop.
In general, to use this system, listen on the bus at the address of one of the contexts (see who derives from the above context base class to see the available contexts). Each time you get any of the events, always check if the event has already been consumed by some other system by examining the event's "isAccepted()" bool property or the accepted bool passed in. If its already accepted by someone, do not do anything yourself. otherwise you may examine the mimeData attached in event->mimeData() and decide whether its relevant or not to your handler. if it is, accept the event yourself. The context is intentionally not const, allowing higher priority handlers to fill the context so that later ones can use it.
Note that this API covers both general dragging (over main windows and other windows of the application such as viewports) as well as list views, tree views, and other item views. Note that item views are a special case and the control generally eats the Begin/End/etc events itself. In that case, the CanDrop and DoDrop handlers are exercised instead of the above.