Commit 3e02fc52 authored by Stéphane Albert's avatar Stéphane Albert
Browse files

BUG: MANTIS-1138: Fixed editing of shader-widget value.

parent 4e9d7774
......@@ -180,7 +180,7 @@ ShaderWidget
m_UI->valueLineEdit->setVisible( text!=NULL );
m_UI->valueLineEdit->setText(
settings->HasValue()
? ToQString( settings->GetValue() )
? QString::number( settings->GetValue(), 'g', std::numeric_limits< double >::digits10 ) // ToQString( settings->GetValue() )
: QString()
);
m_UI->valueLineEdit->setCursorPosition( 0 );
......@@ -254,20 +254,24 @@ ShaderWidget
/*******************************************************************************/
void
ShaderWidget
::on_valueLineEdit_textChanged( const QString & text )
::on_valueLineEdit_editingFinished()
{
if( !HasSettings() )
if( !HasSettings() ||
!GetSettings()->HasValue() )
return;
if( GetSettings()->HasValue() )
{
bool isOk = true;
bool isOk = true;
GetSettings()->SetValue( text.toDouble( &isOk ) );
}
assert( m_UI!=NULL );
assert( m_UI->valueLineEdit!=NULL );
GetSettings()->SetValue( m_UI->valueLineEdit->text().toDouble( &isOk ) );
// assert( isOk );
if( !isOk )
return;
emit SettingsChanged();
}
......
......@@ -153,7 +153,7 @@ private:
private slots:
void on_effectComboBox_currentIndexChanged( const QString & );
void on_sizeSpinBox_valueChanged( int );
void on_valueLineEdit_textChanged( const QString & );
void on_valueLineEdit_editingFinished();
};
} // end namespace 'mvd'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment