diff --git a/GUI/coregui/Models/ParameterTuningModel.cpp b/GUI/coregui/Models/ParameterTuningModel.cpp index 7690f49777d82fc29f88108440089f8d52e43551..ad6c7ec8710bc9937b0494b9abeba41691ec9d5a 100644 --- a/GUI/coregui/Models/ParameterTuningModel.cpp +++ b/GUI/coregui/Models/ParameterTuningModel.cpp @@ -29,6 +29,21 @@ ParameterTuningModel::ParameterTuningModel(QObject *parent) } +Qt::ItemFlags ParameterTuningModel::flags(const QModelIndex &proxyIndex) const +{ + Qt::ItemFlags result = Qt::ItemIsSelectable | Qt::ItemIsEnabled; + + QModelIndex sourceIndex = toSourceIndex(proxyIndex); + if(sourceIndex.isValid()) { + const QString modelType = sourceIndex.data(SessionModel::ModelTypeRole).toString(); + if(modelType == Constants::ParameterType) { + result |= Qt::ItemIsDragEnabled; + } + } + + return result; +} + QMimeData *ParameterTuningModel::mimeData(const QModelIndexList &proxyIndexes) const { qDebug() << "ParameterTuningModel::mimeData" << proxyIndexes; diff --git a/GUI/coregui/Models/ParameterTuningModel.h b/GUI/coregui/Models/ParameterTuningModel.h index 4b9c21b225d555608f91f2ff96cdcbcdc99cf80b..b7a01c3f380c27279372f688f803ed5aa4a16283 100644 --- a/GUI/coregui/Models/ParameterTuningModel.h +++ b/GUI/coregui/Models/ParameterTuningModel.h @@ -34,6 +34,7 @@ class BA_CORE_API_ ParameterTuningModel : public FilterPropertyProxy public: ParameterTuningModel(QObject *parent = 0); + Qt::ItemFlags flags(const QModelIndex &proxyIndex) const; QMimeData *mimeData(const QModelIndexList &proxyIndexes) const; Qt::DropActions supportedDragActions() const; Qt::DropActions supportedDropActions() const;