Skip to content

Commit

Permalink
BUG: Fix bug where beam parameter was not filled after loading scene
Browse files Browse the repository at this point in the history
Simple line edit type parameter was not set in the UI

Re #73
  • Loading branch information
cpinter committed Jun 17, 2019
1 parent b4e6da4 commit 616bc06
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Beams/Widgets/qMRMLBeamParametersTabWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 616bc06

Please sign in to comment.