Add unit aware preferences widget

This commit is contained in:
wmayer
2018-03-07 14:34:53 +01:00
parent a86a576d49
commit 9eed7f06ba
4 changed files with 59 additions and 0 deletions

View File

@@ -457,6 +457,39 @@ void PrefColorButton::savePreferences()
// --------------------------------------------------------------------
PrefUnitSpinBox::PrefUnitSpinBox ( QWidget * parent )
: QuantitySpinBox(parent), PrefWidget()
{
}
PrefUnitSpinBox::~PrefUnitSpinBox()
{
}
void PrefUnitSpinBox::restorePreferences()
{
if (getWindowParameter().isNull()) {
Console().Warning("Cannot restore!\n");
return;
}
double fVal = (double)getWindowParameter()->GetFloat( entryName() ,rawValue() );
setValue(fVal);
}
void PrefUnitSpinBox::savePreferences()
{
if (getWindowParameter().isNull()) {
Console().Warning("Cannot save!\n");
return;
}
double q = rawValue();
getWindowParameter()->SetFloat( entryName(), q );
}
// --------------------------------------------------------------------
namespace Gui {
class PrefQuantitySpinBoxPrivate
{