36class Q_GUI_EXPORT
QBasicDrag :
public QPlatformDrag,
public QObject
41 virtual Qt::DropAction drag(QDrag *drag) override;
42 void cancelDrag() override;
44 virtual bool eventFilter(QObject *o, QEvent *e) override;
49 virtual void startDrag();
50 virtual void cancel();
51 virtual void move(
const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) = 0;
52 virtual void drop(
const QPoint &globalPos, Qt::MouseButtons b, Qt::KeyboardModifiers mods) = 0;
53 virtual void endDrag();
56 void moveShapedPixmapWindow(
const QPoint &deviceIndependentPosition);
57 QShapedPixmapWindow *shapedPixmapWindow()
const {
return m_drag_icon_window; }
58 void recreateShapedPixmapWindow(QScreen *screen,
const QPoint &pos);
59 void updateCursor(Qt::DropAction action);
61 bool canDrop()
const {
return m_can_drop; }
62 void setCanDrop(
bool c) { m_can_drop = c; }
64 bool useCompositing()
const {
return m_useCompositing; }
65 void setUseCompositing(
bool on) { m_useCompositing = on; }
67 void setScreen(QScreen *screen) { m_screen = screen; }
69 Qt::DropAction executedDropAction()
const {
return m_executed_drop_action; }
70 void setExecutedDropAction(Qt::DropAction da) { m_executed_drop_action = da; }
72 QDrag *drag()
const {
return m_drag; }
75 QWindow *m_sourceWindow =
nullptr;
76 QPointer<QWindow> m_windowUnderCursor =
nullptr;
79 void enableEventFilter();
80 void disableEventFilter();
82 void exitDndEventLoop();
85 bool m_dndHasSetOverrideCursor =
false;
87 QEventLoop *m_eventLoop =
nullptr;
88 Qt::DropAction m_executed_drop_action = Qt::IgnoreAction;
89 bool m_can_drop =
false;
90 QDrag *m_drag =
nullptr;
91 QShapedPixmapWindow *m_drag_icon_window =
nullptr;
92 bool m_useCompositing =
true;
93 QScreen *m_screen =
nullptr;