Mercurial > hg > svgui
comparison widgets/AudioDial.cpp @ 1147:1badacff7ab2 3.0-integration
Introduce labels in RangeMapper and use them in AudioDial, though only for tooltip at present. Make use of this for spectrogram magic -81dB/-Inf threshold. Also introduce static strings for inf/pi and use where appropriate.
author | Chris Cannam |
---|---|
date | Fri, 05 Aug 2016 17:48:52 +0100 |
parents | 4a578a360011 |
children | a34a2a25907c |
comparison
equal
deleted
inserted
replaced
1146:74f2706995b7 | 1147:1badacff7ab2 |
---|---|
407 } | 407 } |
408 } | 408 } |
409 | 409 |
410 if (m_showTooltip) { | 410 if (m_showTooltip) { |
411 QString name = objectName(); | 411 QString name = objectName(); |
412 QString unit = ""; | 412 QString label; |
413 if (m_rangeMapper) { | |
414 label = m_rangeMapper->getLabel(value); | |
415 } | |
413 QString text; | 416 QString text; |
414 if (m_rangeMapper) unit = m_rangeMapper->getUnit(); | 417 if (label != "") { |
415 if (name != "") { | 418 if (name != "") { |
416 text = tr("%1: %2%3").arg(name).arg(m_mappedValue).arg(unit); | 419 text = tr("%1: %2").arg(name).arg(label); |
420 } else { | |
421 text = label; | |
422 } | |
417 } else { | 423 } else { |
418 text = tr("%2%3").arg(m_mappedValue).arg(unit); | 424 QString unit = ""; |
425 if (m_rangeMapper) { | |
426 unit = m_rangeMapper->getUnit(); | |
427 } | |
428 if (name != "") { | |
429 text = tr("%1: %2%3").arg(name).arg(m_mappedValue).arg(unit); | |
430 } else { | |
431 text = tr("%2%3").arg(m_mappedValue).arg(unit); | |
432 } | |
419 } | 433 } |
420 setToolTip(text); | 434 setToolTip(text); |
421 } | 435 } |
422 } | 436 } |
423 | 437 |