20 #include <QModelIndex>
30 std::vector<ModelView::ExternalProperty> get_choice_of_materials(
MaterialModel* model)
33 auto other_data = model->material_data();
34 std::copy(other_data.begin(), other_data.end(), std::back_inserter(result));
39 CustomLayerTreeEditorFactory::~CustomLayerTreeEditorFactory() =
default;
46 std::unique_ptr<CustomEditor>
49 auto value = index.data(Qt::EditRole);
51 auto material_choice_callback = [
this]() {
54 return std::make_unique<ExternalPropertyComboEditor>(material_choice_callback);
std::unique_ptr< CustomEditor > createEditor(const QModelIndex &index) const override
Creates editor for given model index basing either on editorType() or specific variant name.
static ExternalProperty undefined()
Main class to holds all models of GUI session.
MaterialModel * materialModel()
std::unique_ptr< ModelView::CustomEditor > createEditor(const QModelIndex &index) const
ApplicationModels * m_models
MVVM_MODEL_EXPORT bool IsExtPropertyVariant(const Variant &variant)
Returns true in the case of ExternalProperty based variant.
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.