diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-21 14:20:35 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-21 14:20:35 +0200 |
| commit | e4d9e47025a2aa4f4e09aa888195fea3936ad21f (patch) | |
| tree | f44a3e4ae0cc56fabd9b17fcc02cc91fe96c4a06 /src/identitycollection.hpp | |
| parent | 7e0cc55346f8d70a1884b457510a8c55ca68f72e (diff) | |
| download | kristall-e4d9e47025a2aa4f4e09aa888195fea3936ad21f.tar.gz | |
Allows moving certificates between groups via drag'n'drop.
Diffstat (limited to 'src/identitycollection.hpp')
| -rw-r--r-- | src/identitycollection.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/identitycollection.hpp b/src/identitycollection.hpp index 7db879e..82d48a6 100644 --- a/src/identitycollection.hpp +++ b/src/identitycollection.hpp @@ -21,6 +21,9 @@ class IdentityCollection : public QAbstractItemModel template<typename T> T & as() { return *static_cast<T*>(this); } + + template<typename T> + T const & as() const { return *static_cast<T const*>(this); } }; struct IdentityNode : Node { @@ -83,6 +86,21 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + // Drag'n'Drop + + Qt::ItemFlags flags(const QModelIndex &index) const override; + + QStringList mimeTypes() const override; + QMimeData *mimeData(const QModelIndexList &indexes) const override; + bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override; + bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override; + Qt::DropActions supportedDropActions() const override; + + Qt::DropActions supportedDragActions() const override; + + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; + + private: void relayout(); |
