diff options
author | Treeki <treeki@gmail.com> | 2012-08-11 14:07:01 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-08-11 14:07:01 +0200 |
commit | ba44b0135af54aebee08610debbc2ef118f98bf2 (patch) | |
tree | 0c68d0b3709a5ad3f119273aac2dc9cf071cca4b /lsscenemodel.cpp | |
parent | 3b2fb505d58f28f0ce9b4de121f12fc924c1ec0c (diff) | |
download | LayoutStudio-ba44b0135af54aebee08610debbc2ef118f98bf2.tar.gz LayoutStudio-ba44b0135af54aebee08610debbc2ef118f98bf2.zip |
trying to add scene graph tree drag/drop, no idea what I'm doing
Diffstat (limited to '')
-rw-r--r-- | lsscenemodel.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lsscenemodel.cpp b/lsscenemodel.cpp index 7450368..a5b6a23 100644 --- a/lsscenemodel.cpp +++ b/lsscenemodel.cpp @@ -58,3 +58,20 @@ QVariant LSSceneModel::data(const QModelIndex &index, int role) const { } return QVariant(); } + + +Qt::ItemFlags LSSceneModel::flags(const QModelIndex &index) const { + Qt::ItemFlags flag; + flag = Qt::ItemIsEnabled | Qt::ItemIsSelectable | + Qt::ItemIsDropEnabled | Qt::ItemIsEditable; + + if (index.isValid() && index.parent().isValid()) + flag |= Qt::ItemIsDragEnabled; + + return flag; +} + + +Qt::DropActions LSSceneModel::supportedDropActions() const { + return Qt::CopyAction | Qt::MoveAction; +} |