# HG changeset patch # User Chris Cannam # Date 1470064409 -3600 # Node ID 5c3333fb70b3ad19d04e9154c8b60656439288a5 # Parent 50324fca132875c354bd79047826f8ad7994231f Must set range mappers before default values -- the presence of a range mapper alters the way the default is set up diff -r 50324fca1328 -r 5c3333fb70b3 widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Mon Aug 01 15:06:16 2016 +0100 +++ b/widgets/PropertyBox.cpp Mon Aug 01 16:13:29 2016 +0100 @@ -212,10 +212,10 @@ gainDial->setFixedWidth(24); gainDial->setFixedHeight(24); gainDial->setNotchesVisible(false); - gainDial->setDefaultValue(0); gainDial->setObjectName(tr("Playback Gain")); gainDial->setRangeMapper(new LinearRangeMapper (-50, 50, -25, 25, tr("dB"))); + gainDial->setDefaultValue(0); gainDial->setShowToolTip(true); connect(gainDial, SIGNAL(valueChanged(int)), this, SLOT(playGainDialChanged(int))); @@ -384,8 +384,10 @@ dial->setMaximum(max); dial->setPageStep(1); dial->setNotchesVisible((max - min) <= 12); + // important to set the range mapper before the default, + // because the range mapper is used to map the default + dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); dial->setDefaultValue(deflt); - dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); dial->setShowToolTip(true); connect(dial, SIGNAL(valueChanged(int)), this, SLOT(propertyControllerChanged(int)));