Commit 5c2fbb8e authored by Alexander Wiebel's avatar Alexander Wiebel

[FIX] Now, the double property does not change its value after every editing

step, but only if it looses context or return is pressed. Unfortunately, this
also holds for the up and down buttons too. This means they also cause a changed
value only if the box looses focus or enter is pressed. However, at the
moment this seems to be not perfect but an improvement.
parent 2f4b5ba8
......@@ -86,7 +86,7 @@ WPropertyDoubleWidget::WPropertyDoubleWidget( WPropDouble property, QGridLayout*
m_spin.setSingleStep( ( max - min ) / 100.0 );
// connect the modification signal of the edit and slider with our callback
connect( &m_spin, SIGNAL( valueChanged( double ) ), this, SLOT( spinChanged( double ) ) );
connect( &m_spin, SIGNAL( editingFinished() ), this, SLOT( spinChanged() ) );
}
WPropertyDoubleWidget::~WPropertyDoubleWidget()
......@@ -94,9 +94,9 @@ WPropertyDoubleWidget::~WPropertyDoubleWidget()
// cleanup
}
void WPropertyDoubleWidget::spinChanged( double value )
void WPropertyDoubleWidget::spinChanged()
{
// set to the property
invalidate( !m_doubleProperty->set( value ) );
invalidate( !m_doubleProperty->set( m_spin.value() ) );
}
......@@ -76,11 +76,9 @@ private:
public slots:
/**
* Called whenever the spin box changes
*
* \param value the new value
* Called whenever return is pressed or the spin box has a chaged value and looses focus
*/
void spinChanged( double value );
void spinChanged();
};
#endif // WPROPERTYDOUBLEWIDGET_H
......
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