Skip to content
Snippets Groups Projects
Commit 2f14c23a authored by Matthias Puchner's avatar Matthias Puchner
Browse files

listen to material changes (in-place material editor)

parent a9e5a54d
No related branches found
No related tags found
1 merge request!420Layer editor improvements3
Pipeline #47643 passed
......@@ -16,6 +16,8 @@
#include "GUI/Models/DoubleDescriptor.h"
#include "GUI/Models/ItemWithMaterial.h"
#include "GUI/Models/MaterialItemUtils.h"
#include "GUI/Models/MaterialModel.h"
#include "GUI/Models/MaterialModelStore.h"
#include "GUI/Models/ModelPath.h"
#include "GUI/Models/VectorDescriptor.h"
#include "GUI/Views/CommonWidgets/DoubleLineEdit.h"
......@@ -37,6 +39,9 @@ MaterialInplaceForm::MaterialInplaceForm(QWidget* parent, ItemWithMaterial* item
m_layout = new QGridLayout(this);
m_layout->setContentsMargins(0, 0, 0, 0);
createWidgets();
connect(GUI::Model::MaterialModelStore::materialModel(), &MaterialModel::materialChanged, this,
&MaterialInplaceForm::onMaterialChanged);
}
ItemWithMaterial* MaterialInplaceForm::itemWithMaterial() const
......@@ -158,3 +163,9 @@ MaterialItem* MaterialInplaceForm::material()
{
return GUI::Model::MaterialItemUtils::findMaterial(m_item->materialIdentifier());
}
void MaterialInplaceForm::onMaterialChanged(MaterialItem* materialItem)
{
if (materialItem->identifier() == m_item->materialIdentifier())
updateValues();
}
......@@ -35,6 +35,7 @@ private:
void selectMaterial();
void createWidgets();
MaterialItem* material();
void onMaterialChanged(MaterialItem* materialItem);
ItemWithMaterial* m_item;
SampleEditorController* m_ec;
......
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