From 616bc061d3caa4c2c2a77f047db014409f88be7e Mon Sep 17 00:00:00 2001 From: Csaba Pinter <csaba.pinter@queensu.ca> Date: Mon, 17 Jun 2019 17:07:38 -0400 Subject: [PATCH] BUG: Fix bug where beam parameter was not filled after loading scene Simple line edit type parameter was not set in the UI Re https://github.com/SlicerRt/SlicerRT/issues/73 --- Beams/Widgets/qMRMLBeamParametersTabWidget.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Beams/Widgets/qMRMLBeamParametersTabWidget.cxx b/Beams/Widgets/qMRMLBeamParametersTabWidget.cxx index fc1b4cea1..16d574a65 100644 --- a/Beams/Widgets/qMRMLBeamParametersTabWidget.cxx +++ b/Beams/Widgets/qMRMLBeamParametersTabWidget.cxx @@ -175,11 +175,18 @@ void qMRMLBeamParametersTabWidget::updateWidgetFromMRML() QString parameterValue = d->BeamNode->GetAttribute(attributeName.toLatin1().constData()); // Set value to supported widget types + QLineEdit* lineEdit = qobject_cast<QLineEdit*>(currentParameterFieldWidget); QSlider* slider = qobject_cast<QSlider*>(currentParameterFieldWidget); QDoubleSpinBox* spinBox = qobject_cast<QDoubleSpinBox*>(currentParameterFieldWidget); QComboBox* comboBox = qobject_cast<QComboBox*>(currentParameterFieldWidget); QCheckBox* checkBox = qobject_cast<QCheckBox*>(currentParameterFieldWidget); - if (slider) + if (lineEdit) + { + lineEdit->blockSignals(true); + lineEdit->setText(parameterValue); + lineEdit->blockSignals(false); + } + else if (slider) { slider->blockSignals(true); slider->setValue(parameterValue.toDouble()); //TODO: ctkSlider