changeset 170:bdba24db0446

* minor fixes to tooltip
author Chris Cannam
date Tue, 17 Oct 2006 13:50:17 +0000
parents 86cee2b060c7
children 78d523e8433e
files widgets/AudioDial.cpp widgets/PropertyBox.cpp
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/widgets/AudioDial.cpp	Tue Oct 17 13:49:31 2006 +0000
+++ b/widgets/AudioDial.cpp	Tue Oct 17 13:50:17 2006 +0000
@@ -69,7 +69,8 @@
 // Constructor.
 AudioDial::AudioDial(QWidget *parent) :
     QDial(parent),
-    m_knobColor(Qt::black), m_meterColor(Qt::white),
+    m_knobColor(Qt::black),
+    m_meterColor(Qt::white),
     m_defaultValue(0),
     m_mappedValue(0),
     m_noMappedUpdate(false),
@@ -90,13 +91,19 @@
 
 void AudioDial::setRangeMapper(RangeMapper *mapper)
 {
-    if (!m_rangeMapper) {
+    if (!m_rangeMapper && mapper) {
         connect(this, SIGNAL(valueChanged(int)),
                 this, SLOT(updateMappedValue(int)));
     }
+
     delete m_rangeMapper;
     m_rangeMapper = mapper;
-    m_mappedValue = m_rangeMapper->getValueForPosition(value());
+
+    if (m_rangeMapper) {
+        m_mappedValue = m_rangeMapper->getValueForPosition(value());
+    } else {
+        m_mappedValue = value();
+    }
 }
 
 
@@ -346,9 +353,11 @@
 
 void AudioDial::updateMappedValue(int value)
 {
-    if (m_rangeMapper) {
-        if (!m_noMappedUpdate) {
+    if (!m_noMappedUpdate) {
+        if (m_rangeMapper) {
             m_mappedValue = m_rangeMapper->getValueForPosition(value);
+        } else {
+            m_mappedValue = value;
         }
     }
 
--- a/widgets/PropertyBox.cpp	Tue Oct 17 13:49:31 2006 +0000
+++ b/widgets/PropertyBox.cpp	Tue Oct 17 13:50:17 2006 +0000
@@ -181,7 +181,6 @@
 	gainDial->setFixedWidth(24);
 	gainDial->setFixedHeight(24);
 	gainDial->setNotchesVisible(false);
-//!!!	gainDial->setToolTip(tr("Playback Level"));
 	gainDial->setDefaultValue(0);
         gainDial->setObjectName(tr("Playback Gain"));
         gainDial->setRangeMapper(new LinearRangeMapper
@@ -333,7 +332,6 @@
 	    if (inGroup) {
 		dial->setFixedWidth(24);
 		dial->setFixedHeight(24);
-//!!!		dial->setToolTip(propertyLabel);
 		m_groupLayouts[groupName]->addWidget(dial);
 	    } else {
 		dial->setFixedWidth(32);