digiKam
Loading...
Searching...
No Matches
abstractitemdragdrophandler.h
Go to the documentation of this file.
1/* ============================================================
2 *
3 * This file is a part of digiKam project
4 * https://www.digikam.org
5 *
6 * Date : 2009-04-26
7 * Description : Qt Model for Images - drag and drop handling
8 *
9 * SPDX-FileCopyrightText: 2009-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 *
13 * ============================================================ */
14
15#pragma once
16
17// Qt includes
18
19#include <QAbstractItemModel>
20
21// Local includes
22
23#include "digikam_export.h"
24
25class QAbstractItemView;
26class QDropEvent;
27
28namespace Digikam
29{
30
31class DIGIKAM_EXPORT AbstractItemDragDropHandler : public QObject
32{
33 Q_OBJECT
34
35public:
36
37 explicit AbstractItemDragDropHandler(QAbstractItemModel* const model);
39
40 QAbstractItemModel* model() const;
41
48 virtual bool dropEvent(QAbstractItemView* view, const QDropEvent* e, const QModelIndex& droppedOn);
49
54 virtual Qt::DropAction accepts(const QDropEvent* e, const QModelIndex& dropIndex);
55
60 virtual QStringList mimeTypes() const;
61
65 virtual QMimeData* createMimeData(const QList<QModelIndex>&);
66
74 virtual bool acceptsMimeData(const QMimeData* data);
75
76protected:
77
78 QAbstractItemModel* m_model = nullptr;
79};
80
81} // namespace Digikam
Definition abstractitemdragdrophandler.h:32
Definition datefolderview.cpp:34