Skip to content
Snippets Groups Projects
Commit 80fd1e19 authored by Julien Malik's avatar Julien Malik
Browse files

BUG: handle no value case

parent b218fb11
No related branches found
No related tags found
No related merge requests found
......@@ -35,8 +35,23 @@ QtWidgetFloatParameter::~QtWidgetFloatParameter()
void QtWidgetFloatParameter::DoUpdateGUI()
{
bool signalsBlocked = m_QDoubleSpinBox->blockSignals( true );
m_QDoubleSpinBox->setValue(m_FloatParam->GetValue());
if (m_FloatParam->HasValue())
{
m_QDoubleSpinBox->setValue(m_FloatParam->GetValue());
}
m_QDoubleSpinBox->blockSignals( signalsBlocked );
QFont font = m_QDoubleSpinBox->font();
if (m_FloatParam->HasUserValue())
{
font.setBold(true);
}
else
{
font.setBold(false);
}
m_QDoubleSpinBox->setFont(font);
}
void QtWidgetFloatParameter::DoCreateWidget()
......@@ -63,6 +78,7 @@ void QtWidgetFloatParameter::DoCreateWidget()
void QtWidgetFloatParameter::SetValue(double value)
{
m_FloatParam->SetValue( static_cast<float>(value) );
m_FloatParam->SetUserValue(true);
}
}
......
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