aboutsummaryrefslogtreecommitdiff
path: root/src/identitycollection.hpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2020-06-21 14:20:35 +0200
committerFelix (xq) Queißner <git@mq32.de>2020-06-21 14:20:35 +0200
commite4d9e47025a2aa4f4e09aa888195fea3936ad21f (patch)
treef44a3e4ae0cc56fabd9b17fcc02cc91fe96c4a06 /src/identitycollection.hpp
parent7e0cc55346f8d70a1884b457510a8c55ca68f72e (diff)
downloadkristall-e4d9e47025a2aa4f4e09aa888195fea3936ad21f.tar.gz
Allows moving certificates between groups via drag'n'drop.
Diffstat (limited to 'src/identitycollection.hpp')
-rw-r--r--src/identitycollection.hpp18
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();