aboutsummaryrefslogtreecommitdiff
path: root/src/identitycollection.hpp
diff options
context:
space:
mode:
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();