34 public QSafeQuickItemChangeListener<QQuickDragAttachedPrivate>
36 Q_DECLARE_PUBLIC(QQuickDragAttached)
38 QML_ADDED_IN_VERSION(2, 0)
41 static QQuickDragAttachedPrivate *get(QQuickDragAttached *attached) {
42 return static_cast<QQuickDragAttachedPrivate *>(QObjectPrivate::get(attached)); }
44 QQuickDragAttachedPrivate()
45 : attachedItem(
nullptr)
47 , proposedAction(Qt::MoveAction)
48 , supportedActions(Qt::MoveAction | Qt::CopyAction | Qt::LinkAction)
52 , executingNativeDrag(
false)
53 , dragRestarted(
false)
56 , overrideActions(
false)
57 , listeningForDestruction(
false)
58 , dragType(QQuickDrag::Internal)
62 void itemGeometryChanged(QQuickItem *, QQuickGeometryChange,
const QRectF &) override;
63 void itemParentChanged(QQuickItem *, QQuickItem *parent) override;
64 void itemDestroyed(QQuickItem *item) override;
65 void listenForAttachedItemDestruction(
bool listen);
66 void updatePosition();
68 void deliverEnterEvent();
69 void deliverMoveEvent();
70 void deliverLeaveEvent();
71 void deliverEvent(QQuickWindow *window, QEvent *event);
72 void start(Qt::DropActions supportedActions);
73 Qt::DropAction startDrag(Qt::DropActions supportedActions, QPixmap pixmap = {});
74 void setTarget(QQuickItem *item);
75 QMimeData *createMimeData()
const;
78 QQuickDragGrabber dragGrabber;
80 QPointer<QObject> source;
81 QPointer<QObject> target;
82 QPointer<QQuickWindow> window;
83 QQuickItem *attachedItem;
84 QQuickDragMimeData *mimeData;
85 Qt::DropAction proposedAction;
86 Qt::DropActions supportedActions;
90 bool executingNativeDrag : 1;
91 bool dragRestarted : 1;
94 bool overrideActions : 1;
97 bool listeningForDestruction : 1;
100 QSize imageSourceSize;
101 QQuickPixmap pixmapLoader;
103 QVariantMap externalMimeData;
104 QQuickDrag::DragType dragType;