35class Q_GUI_EXPORT
QBasicDrag :
public QPlatformDrag,
public QObject
40 virtual Qt::DropAction drag(QDrag *drag) override;
41 void cancelDrag() override;
43 virtual bool eventFilter(QObject *o, QEvent *e) override;
48 virtual void startDrag();
49 virtual void cancel();
50 virtual void move(
const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) = 0;
51 virtual void drop(
const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) = 0;
52 virtual void endDrag();
55 void moveShapedPixmapWindow(
const QPoint &deviceIndependentPosition);
56 QShapedPixmapWindow *shapedPixmapWindow()
const {
return m_drag_icon_window; }
57 void recreateShapedPixmapWindow(QScreen *screen,
const QPoint &pos);
58 void updateCursor(Qt::DropAction action);
60 bool canDrop()
const {
return m_can_drop; }
61 void setCanDrop(
bool c) { m_can_drop = c; }
63 bool useCompositing()
const {
return m_useCompositing; }
64 void setUseCompositing(
bool on) { m_useCompositing = on; }
66 void setScreen(QScreen *screen) { m_screen = screen; }
68 Qt::DropAction executedDropAction()
const {
return m_executed_drop_action; }
69 void setExecutedDropAction(Qt::DropAction da) { m_executed_drop_action = da; }
71 QDrag *drag()
const {
return m_drag; }
74 QWindow *m_sourceWindow =
nullptr;
75 QPointer<QWindow> m_windowUnderCursor =
nullptr;
78 void enableEventFilter();
79 void disableEventFilter();
81 void exitDndEventLoop();
84 bool m_dndHasSetOverrideCursor =
false;
86 QEventLoop *m_eventLoop =
nullptr;
87 Qt::DropAction m_executed_drop_action = Qt::IgnoreAction;
88 bool m_can_drop =
false;
89 QDrag *m_drag =
nullptr;
90 QShapedPixmapWindow *m_drag_icon_window =
nullptr;
91 bool m_useCompositing =
true;
92 QScreen *m_screen =
nullptr;