From ba44b0135af54aebee08610debbc2ef118f98bf2 Mon Sep 17 00:00:00 2001 From: Treeki Date: Sat, 11 Aug 2012 14:07:01 +0200 Subject: trying to add scene graph tree drag/drop, no idea what I'm doing --- lsscenemodel.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lsscenemodel.cpp') 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; +} -- cgit v1.2.3