Mercurial > hg > svgui
comparison widgets/PropertyBox.cpp @ 1126:5c3333fb70b3 spectrogram-minor-refactor
Must set range mappers before default values -- the presence of a range mapper alters the way the default is set up
author | Chris Cannam |
---|---|
date | Mon, 01 Aug 2016 16:13:29 +0100 |
parents | 3f7cdfc56dce |
children | db90fee630bc |
comparison
equal
deleted
inserted
replaced
1125:50324fca1328 | 1126:5c3333fb70b3 |
---|---|
210 gainDial->setMaximum(50); | 210 gainDial->setMaximum(50); |
211 gainDial->setPageStep(1); | 211 gainDial->setPageStep(1); |
212 gainDial->setFixedWidth(24); | 212 gainDial->setFixedWidth(24); |
213 gainDial->setFixedHeight(24); | 213 gainDial->setFixedHeight(24); |
214 gainDial->setNotchesVisible(false); | 214 gainDial->setNotchesVisible(false); |
215 gainDial->setDefaultValue(0); | |
216 gainDial->setObjectName(tr("Playback Gain")); | 215 gainDial->setObjectName(tr("Playback Gain")); |
217 gainDial->setRangeMapper(new LinearRangeMapper | 216 gainDial->setRangeMapper(new LinearRangeMapper |
218 (-50, 50, -25, 25, tr("dB"))); | 217 (-50, 50, -25, 25, tr("dB"))); |
218 gainDial->setDefaultValue(0); | |
219 gainDial->setShowToolTip(true); | 219 gainDial->setShowToolTip(true); |
220 connect(gainDial, SIGNAL(valueChanged(int)), | 220 connect(gainDial, SIGNAL(valueChanged(int)), |
221 this, SLOT(playGainDialChanged(int))); | 221 this, SLOT(playGainDialChanged(int))); |
222 connect(params, SIGNAL(playGainChanged(float)), | 222 connect(params, SIGNAL(playGainChanged(float)), |
223 this, SLOT(playGainChanged(float))); | 223 this, SLOT(playGainChanged(float))); |
382 dial->setObjectName(name); | 382 dial->setObjectName(name); |
383 dial->setMinimum(min); | 383 dial->setMinimum(min); |
384 dial->setMaximum(max); | 384 dial->setMaximum(max); |
385 dial->setPageStep(1); | 385 dial->setPageStep(1); |
386 dial->setNotchesVisible((max - min) <= 12); | 386 dial->setNotchesVisible((max - min) <= 12); |
387 // important to set the range mapper before the default, | |
388 // because the range mapper is used to map the default | |
389 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); | |
387 dial->setDefaultValue(deflt); | 390 dial->setDefaultValue(deflt); |
388 dial->setRangeMapper(m_container->getNewPropertyRangeMapper(name)); | |
389 dial->setShowToolTip(true); | 391 dial->setShowToolTip(true); |
390 connect(dial, SIGNAL(valueChanged(int)), | 392 connect(dial, SIGNAL(valueChanged(int)), |
391 this, SLOT(propertyControllerChanged(int))); | 393 this, SLOT(propertyControllerChanged(int))); |
392 connect(dial, SIGNAL(mouseEntered()), | 394 connect(dial, SIGNAL(mouseEntered()), |
393 this, SLOT(mouseEnteredWidget())); | 395 this, SLOT(mouseEnteredWidget())); |