Skip to content
Snippets Groups Projects
Commit f5b0e4d9 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

PropertyEditorFactory: simplify CreateEditor

parent 7bf99197
No related branches found
No related tags found
1 merge request!1120GUI: FitParameterModel and fit items are refactored
......@@ -70,7 +70,7 @@ QString GUI::View::PropertyEditorFactory::toString(const QModelIndex& index)
QWidget* GUI::View::PropertyEditorFactory::CreateEditor(QObject* item, QWidget* parent)
{
QWidget* result(nullptr);
CustomEditor* result(nullptr);
if (FitDoubleItem* doubleItem = dynamic_cast<FitDoubleItem*>(item)) {
// only Scientific SpinBoxes in Fit-Window
......@@ -85,9 +85,8 @@ QWidget* GUI::View::PropertyEditorFactory::CreateEditor(QObject* item, QWidget*
if (parent && result) {
result->setParent(parent);
if (auto* cusEd = dynamic_cast<CustomEditor*>(result))
QObject::connect(cusEd, &CustomEditor::dataChanged,
[=] { gSessionData->projectDocument.value()->setModified(); });
QObject::connect(result, &CustomEditor::dataChanged,
[=] { gSessionData->projectDocument.value()->setModified(); });
}
return result;
......
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