37class Q_GUI_EXPORT
QBasicDrag :
public QPlatformDrag,
public QObject
42 virtual Qt::DropAction drag(QDrag *drag) override;
43 void cancelDrag() override;
45 virtual bool eventFilter(QObject *o, QEvent *e) override;
50 virtual void startDrag();
51 virtual void cancel();
52 virtual void move(
const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) = 0;
53 virtual void drop(
const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) = 0;
54 virtual void endDrag();
57 void moveShapedPixmapWindow(
const QPoint &deviceIndependentPosition);
58 QShapedPixmapWindow *shapedPixmapWindow()
const {
return m_drag_icon_window; }
59 void recreateShapedPixmapWindow(QScreen *screen,
const QPoint &pos);
60 void updateCursor(Qt::DropAction action);
62 bool canDrop()
const {
return m_can_drop; }
63 void setCanDrop(
bool c) { m_can_drop = c; }
65 bool useCompositing()
const {
return m_useCompositing; }
66 void setUseCompositing(
bool on) { m_useCompositing = on; }
68 void setScreen(QScreen *screen) { m_screen = screen; }
70 Qt::DropAction executedDropAction()
const {
return m_executed_drop_action; }
71 void setExecutedDropAction(Qt::DropAction da) { m_executed_drop_action = da; }
73 QDrag *drag()
const {
return m_drag; }
76 QWindow *m_sourceWindow =
nullptr;
77 QPointer<QWindow> m_windowUnderCursor =
nullptr;
80 void enableEventFilter();
81 void disableEventFilter();
83 void exitDndEventLoop();
86 bool m_dndHasSetOverrideCursor =
false;
88 QEventLoop *m_eventLoop =
nullptr;
89 Qt::DropAction m_executed_drop_action = Qt::IgnoreAction;
90 bool m_can_drop =
false;
91 bool m_dragEndRequested =
false;
92 QPointer<QDrag> m_drag;
93 QShapedPixmapWindow *m_drag_icon_window =
nullptr;
94 bool m_useCompositing =
true;
95 QScreen *m_screen =
nullptr;