diff --git a/GUI/coregui/Views/FitWidgets/RunFitControlWidget.cpp b/GUI/coregui/Views/FitWidgets/RunFitControlWidget.cpp index 8894ceab392e9e201bec4f961a6b1ef43f29219e..e27d0ae7ec26f1aca3c32f5a3beaff945f921d20 100644 --- a/GUI/coregui/Views/FitWidgets/RunFitControlWidget.cpp +++ b/GUI/coregui/Views/FitWidgets/RunFitControlWidget.cpp @@ -108,6 +108,8 @@ void RunFitControlWidget::onFittingStarted(JobItem *jobItem) m_startButton->setEnabled(false); m_stopButton->setEnabled(true); + Q_ASSERT(fitSuiteItem()); + fitSuiteItem()->setItemValue(FitSuiteItem::P_UPDATE_INTERVAL, sliderUpdateInterval()); fitSuiteItem()->mapper()->setOnPropertyChange( @@ -177,7 +179,8 @@ void RunFitControlWidget::onSliderValueChanged(int value) qDebug() << "RunFitControlWidget::onSliderValueChanged(int value)"; int interval = sliderValueToUpdateInterval(value); m_updateIntervalLabel->setText(QString::number(interval)); - fitSuiteItem()->setItemValue(FitSuiteItem::P_UPDATE_INTERVAL, interval); + if(fitSuiteItem()) + fitSuiteItem()->setItemValue(FitSuiteItem::P_UPDATE_INTERVAL, interval); } void RunFitControlWidget::onFitSuitePropertyChange(const QString &name) @@ -227,10 +230,10 @@ int RunFitControlWidget::sliderValueToUpdateInterval(int value) FitSuiteItem *RunFitControlWidget::fitSuiteItem() { - Q_ASSERT(m_currentItem); - FitSuiteItem *result = m_currentItem->fitSuiteItem(); - Q_ASSERT(result); - return result; + if(m_currentItem) + return m_currentItem->fitSuiteItem(); + + return nullptr; } bool RunFitControlWidget::isValidJobItem(JobItem *jobItem) diff --git a/GUI/coregui/Views/JobWidgets/ParameterTuningDelegate.cpp b/GUI/coregui/Views/JobWidgets/ParameterTuningDelegate.cpp index a8f1c46a7f0ebf97fc51aa8464c206d71a93aaf5..6dea5c2c92823d7a5d812386e4ba2dfa0d69af5f 100644 --- a/GUI/coregui/Views/JobWidgets/ParameterTuningDelegate.cpp +++ b/GUI/coregui/Views/JobWidgets/ParameterTuningDelegate.cpp @@ -104,8 +104,8 @@ ParameterTuningDelegate::ParameterTuningDelegate(QObject *parent) ParameterTuningDelegate::~ParameterTuningDelegate() { - if(m_currentItem) - m_currentItem->mapper()->unsubscribe(this); +// if(m_currentItem) +// m_currentItem->mapper()->unsubscribe(this); } @@ -199,16 +199,16 @@ QWidget *ParameterTuningDelegate::createEditor(QWidget *parent, m_contentLayout->addWidget(m_slider); // FIXME there is an issue with time of life of editor .vs. item - m_currentItem->mapper()->setOnValueChange( - [this](){ - if(m_valueBox && m_currentItem) - m_valueBox->setValue(m_currentItem->value().toDouble()); - }, this); - - m_currentItem->mapper()->setOnItemDestroy( - [this](SessionItem *) { - m_currentItem = 0; - }, this); +// m_currentItem->mapper()->setOnValueChange( +// [this](){ +// if(m_valueBox && m_currentItem) +// m_valueBox->setValue(m_currentItem->value().toDouble()); +// }, this); + +// m_currentItem->mapper()->setOnItemDestroy( +// [this](SessionItem *) { +// m_currentItem = 0; +// }, this); m_contentWidget->setLayout(m_contentLayout); diff --git a/GUI/coregui/Views/JobWidgets/ParameterTuningWidget.cpp b/GUI/coregui/Views/JobWidgets/ParameterTuningWidget.cpp index d9710d2658686c1762638d91b334bcb55df81720..90ba9dd1c572d5c03ee4c0f2d49e9008c668cd92 100644 --- a/GUI/coregui/Views/JobWidgets/ParameterTuningWidget.cpp +++ b/GUI/coregui/Views/JobWidgets/ParameterTuningWidget.cpp @@ -202,7 +202,7 @@ void ParameterTuningWidget::restoreModelsOfCurrentJobItem() if(m_currentJobItem->isRunning()) return; -// closeActiveEditors(); + closeActiveEditors(); m_jobModel->restore(m_currentJobItem); m_jobModel->runJob(m_currentJobItem->index());