Commit 0e44e8bf authored by Volker Krause's avatar Volker Krause
Browse files

Don't leak item editor factory

parent 124a3449
......@@ -35,7 +35,7 @@ AggregationEditWidget::AggregationEditWidget(QWidget* parent) :
ui->setupUi(this);
ui->aggregationView->setModel(m_model);
qobject_cast<QStyledItemDelegate*>(ui->aggregationView->itemDelegate())->setItemEditorFactory(m_editorFactory);
qobject_cast<QStyledItemDelegate*>(ui->aggregationView->itemDelegate())->setItemEditorFactory(m_editorFactory.get());
connect(ui->actionAddAggregation, &QAction::triggered, this, &AggregationEditWidget::addAggregation);
connect(ui->actionDeleteAggregation, &QAction::triggered, this, &AggregationEditWidget::deleteAggregation);
......
......@@ -52,7 +52,7 @@ private:
std::unique_ptr<Ui::AggregationEditWidget> ui;
AggregationEditorModel *m_model;
SchemaEntryItemEditorFactory *m_editorFactory;
std::unique_ptr<SchemaEntryItemEditorFactory> m_editorFactory;
};
}
}
......
......@@ -83,6 +83,8 @@ SchemaEntryItemEditorFactory::SchemaEntryItemEditorFactory() :
registerEditor(qMetaTypeId<AggregationElement>(), new AggregationElementEditorCreator(m_elementModel.get()));
}
SchemaEntryItemEditorFactory::~SchemaEntryItemEditorFactory() = default;
void SchemaEntryItemEditorFactory::setProduct(const Product& product)
{
m_elementModel->setProduct(product);
......
......@@ -32,6 +32,7 @@ class SchemaEntryItemEditorFactory : public QItemEditorFactory
{
public:
SchemaEntryItemEditorFactory();
~SchemaEntryItemEditorFactory();
void setProduct(const Product &product);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment