Open 3D Engine AzQtComponents API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzQtComponents::CommonDragAndDropBusTraits Class Reference

#include <DragAndDrop.h>

Inherits AZ::EBusTraits.

Inherited by AzQtComponents::DragAndDropEvents, and AzQtComponents::DragAndDropItemViewEvents.

Public Types

using BusIdType = AZ::u32
 

Static Public Attributes

static constexpr AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::MultipleAndOrdered
 
static constexpr AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById
 
static constexpr const int s_LowPriority = -10
 
static constexpr const int s_NormalPriority = 0
 Run this handler after the default handler.
 
static constexpr const int s_HighPriority = 10
 The default handler.
 

Detailed Description

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.


The documentation for this class was generated from the following file: