Skip to content
Snippets Groups Projects
Commit 08f30e3f authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Blocked drag operation in the case of ParameterLabel item

parent 23d3a229
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment