CopperSpice API
1.9.2
|
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress. More...
Public Methods | |
QDragMoveEvent (const QPoint &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type=DragMove) | |
~QDragMoveEvent () | |
void | accept () |
void | accept (const QRect &xRect) |
QRect | answerRect () const |
void | ignore () |
void | ignore (const QRect &xRect) |
Public Methods inherited from QDropEvent | |
QDropEvent (const QPointF &pos, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers, Type type=Drop) | |
void | acceptProposedAction () |
Qt::DropAction | dropAction () const |
Qt::KeyboardModifiers | keyboardModifiers () const |
const QMimeData * | mimeData () const |
Qt::MouseButtons | mouseButtons () const |
QPoint | pos () const |
const QPointF & | posF () const |
Qt::DropActions | possibleActions () const |
Qt::DropAction | proposedAction () const |
void | setDropAction (Qt::DropAction action) |
QObject * | source () const |
Public Methods inherited from QEvent | |
QEvent (const QEvent &other) | |
QEvent (Type type) | |
virtual | ~QEvent () |
void | accept () |
void | ignore () |
bool | isAccepted () const |
QEvent & | operator= (const QEvent &other) |
void | setAccepted (bool accepted) |
bool | spontaneous () const |
Type | type () const |
Additional Inherited Members | |
Public Types inherited from QEvent | |
enum | Type |
Static Public Methods inherited from QEvent | |
static int | registerEventType (int hint=-1) |
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress. A widget will receive drag move events repeatedly while the drag is within its boundaries, if it accepts drop events and enter events. The widget should examine the event to see what kind of data it provides, and call the accept() method to accept the drop if appropriate.
The rectangle supplied by the answerRect() method can be used to restrict drops to certain parts of the widget. For example, we can check whether the rectangle intersects with the geometry of a certain child widget and only call acceptProposedAction() if that is the case.
This class inherits most of its functionality from QDropEvent.
QDragMoveEvent::QDragMoveEvent | ( | const QPoint & | pos, |
Qt::DropActions | actions, | ||
const QMimeData * | data, | ||
Qt::MouseButtons | buttons, | ||
Qt::KeyboardModifiers | modifiers, | ||
Type | type = DragMove |
||
) |
Creates a QDragMoveEvent of the required type indicating the mouse is at position pos given within a widget.
The mouse and keyboard states are specified by buttons and modifiers. The actions describe the types of drag and drop operation which are possible. The drag data is passed as MIME-encoded information in data.
QDragMoveEvent::~QDragMoveEvent | ( | ) |
Destroys the event.
|
inline |
Calls QDropEvent::accept().
|
inline |
The same as accept(), but also notifies that future moves will also be acceptable if they remain within the xRect given on the widget. This can improve performance, but may also be ignored by the underlying system.
If the rectangle is empty then drag move events will be sent continuously. This is useful if the source is scrolling in a timer event.
|
inline |
Returns the rectangle in the widget where the drop will occur if accepted. You can use this information to restrict drops to certain places on the widget.
|
inline |
Calls QDropEvent::ignore().
|
inline |
The opposite of the accept(const QRect &) function. Moves within the xRect are not acceptable, and will be ignored.