QDragEnterEvent Class

The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action enters it. More...

Header: #include <QDragEnterEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Inherits: QDragMoveEvent

Public Functions

QDragEnterEvent(const QPoint &point, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
virtual ~QDragEnterEvent() override

Reimplemented Public Functions

virtual QDragEnterEvent *clone() const override

Protected Functions

QDragEnterEvent(const QDragEnterEvent &)
QDragEnterEvent(QDragEnterEvent &&)
QDragEnterEvent &operator=(const QDragEnterEvent &other)
QDragEnterEvent &operator=(QDragEnterEvent &&)

Detailed Description

A widget must accept this event in order to receive the drag move events that are sent while the drag and drop action is in progress. The drag enter event is always immediately followed by a drag move event.

QDragEnterEvent inherits most of its functionality from QDragMoveEvent, which in turn inherits most of its functionality from QDropEvent.

See also QDragLeaveEvent, QDragMoveEvent, and QDropEvent.

Member Function Documentation

[protected] QDragEnterEvent::QDragEnterEvent(const QDragEnterEvent &)

Default constructs an instance of QDragEnterEvent.

[protected] QDragEnterEvent::QDragEnterEvent(QDragEnterEvent &&)

Move-copy constructor.

QDragEnterEvent::QDragEnterEvent(const QPoint &point, Qt::DropActions actions, const QMimeData *data, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)

Constructs a QDragEnterEvent that represents a drag entering a widget at the given point with mouse and keyboard states specified by buttons and modifiers.

The drag data is passed as MIME-encoded information in data, and the specified actions describe the possible types of drag and drop operation that can be performed.

Warning: Do not create a QDragEnterEvent yourself since these objects rely on Qt's internal state.

[override virtual] QDragEnterEvent::~QDragEnterEvent()

Destroys the instance of QDragEnterEvent. The destructor is virtual.

[override virtual] QDragEnterEvent *QDragEnterEvent::clone() const

[protected] QDragEnterEvent &QDragEnterEvent::operator=(const QDragEnterEvent &other)

Copy-assignment operator.

[protected] QDragEnterEvent &QDragEnterEvent::operator=(QDragEnterEvent &&)

Move-assignment operator.

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.