diff --git a/src/UI/PropertyModel.cc b/src/UI/PropertyModel.cc index 5dd71eaaca81359c570771bf09db4c45356602b1..d80604ca44e28994fd8797e6afeba3ed5a1e59f4 100644 --- a/src/UI/PropertyModel.cc +++ b/src/UI/PropertyModel.cc @@ -261,22 +261,7 @@ PropertyModel::columnCount(const QModelIndex & /* parent */) const noexcept Qt::ItemFlags PropertyModel::flags(const QModelIndex &index) const noexcept { - // Handle the case where the model is not editable - if (!editableState) { - return /* Qt::ItemIsSelectable | */ QAbstractItemModel::flags(index); - } - - // Here the model is editable - const int col = index.column(); - const Item *item = static_cast<Item *>(index.internalPointer()); - const bool isArray = QJsonValue::Array == item->getType(); - const bool isObject = QJsonValue::Object == item->getType(); - - if ((col == 1) && !(isArray || isObject)) - return Qt::ItemIsSelectable | Qt::ItemIsEditable | QAbstractItemModel::flags(index); - - else - return QAbstractItemModel::flags(index); + return QAbstractItemModel::flags(index); } // Get the json stored inside the model diff --git a/src/UI/PropertyModel.hh b/src/UI/PropertyModel.hh index c79f0aa831199e4b8726d6adcf37d6c76c734992..d22ab6eccb28c96e34f3e00419b66a519d12f3b8 100644 --- a/src/UI/PropertyModel.hh +++ b/src/UI/PropertyModel.hh @@ -71,10 +71,7 @@ public: root->setKey(object.getElementName()); } - ~PropertyModel() noexcept = default; - void loadJson(const QJsonDocument &json); - void setEditable(const bool); QVariant data(const QModelIndex &, int role) const noexcept override; bool setData(const QModelIndex &, const QVariant &v, int r = Qt::EditRole) noexcept override; @@ -96,7 +93,6 @@ private: QJsonValue generateJson(Item *) const noexcept; std::unique_ptr<Item> root{ nullptr }; QStringList headers{}; - bool editableState{ false }; }; }