24 #ifndef DIGIKAM_DRAG_DROP_IMPLEMENTATIONS_H
25 #define DIGIKAM_DRAG_DROP_IMPLEMENTATIONS_H
29 #include <QAbstractItemView>
56 Qt::DropActions supportedDropActions()
const;
57 QStringList mimeTypes()
const;
58 bool dropMimeData(
const QMimeData*,
63 QMimeData* mimeData(
const QModelIndexList& indexes)
const;
71 virtual Qt::ItemFlags dragDropFlags(
const QModelIndex& index)
const;
80 Qt::ItemFlags dragDropFlagsV2(
const QModelIndex& index)
const;
81 virtual bool isDragEnabled(
const QModelIndex& index)
const;
82 virtual bool isDropEnabled(
const QModelIndex& index)
const;
90 #define DECLARE_MODEL_DRAG_DROP_METHODS \
91 virtual Qt::DropActions supportedDropActions() const override \
92 { return DragDropModelImplementation::supportedDropActions(); } \
93 virtual QStringList mimeTypes() const override \
94 { return DragDropModelImplementation::mimeTypes(); } \
95 virtual bool dropMimeData(const QMimeData* d, Qt::DropAction a, \
96 int r, int c, const QModelIndex& p) override \
97 { return DragDropModelImplementation::dropMimeData(d, a, r, c, p); } \
98 virtual QMimeData* mimeData(const QModelIndexList& indexes) const override \
99 { return DragDropModelImplementation::mimeData(indexes); }
121 virtual void paste();
150 void dragEnterEvent(QDragEnterEvent* event);
151 void dragMoveEvent(QDragMoveEvent* e);
152 void dropEvent(QDropEvent* e);
153 void startDrag(Qt::DropActions supportedActions);
155 #define DECLARE_VIEW_DRAG_DROP_METHODS(ParentViewClass) \
156 virtual QAbstractItemView* asView() override \
158 void dragEnterEvent(QDragEnterEvent* e) override \
159 { DragDropViewImplementation::dragEnterEvent(e); } \
160 void dragMoveEvent(QDragMoveEvent* e) override \
161 { ParentViewClass::dragMoveEvent(e); \
162 DragDropViewImplementation::dragMoveEvent(e); } \
163 void dropEvent(QDropEvent* e) override \
164 { ParentViewClass::dropEvent(e); \
165 DragDropViewImplementation::dropEvent(e); } \
166 void startDrag(Qt::DropActions supportedActions) override \
167 { DragDropViewImplementation::startDrag(supportedActions); }
169 void encodeIsCutSelection(QMimeData* mime,
bool isCutSelection);
170 bool decodeIsCutSelection(
const QMimeData* mimeData);
174 Q_DISABLE_COPY(DragDropViewImplementation)
Definition: abstractitemdragdrophandler.h:42
Definition: dragdropimplementations.h:40
AbstractItemDragDropHandler * m_dragDropHandler
Definition: dragdropimplementations.h:103
Definition: dragdropimplementations.h:113
virtual QAbstractItemView * asView()=0
virtual QPixmap pixmapForDrag(const QList< QModelIndex > &indexes) const =0
virtual QModelIndex mapIndexForDragDrop(const QModelIndex &index) const =0
virtual AbstractItemDragDropHandler * dragDropHandler() const =0
virtual ~DragDropViewImplementation()=default
DragDropViewImplementation()=default
Definition: datefolderview.cpp:43
DropAction
Definition: itemdragdrop.cpp:60