blob: 8a1371cb677e261d693bf5c0ed2f015d89ff0e82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#include "widget/wnumberdb.h"
#include <QVBoxLayout>
#include "moc_wnumberdb.cpp"
#include "util/math.h"
#include "widget/wskincolor.h"
WNumberDb::WNumberDb(QWidget* pParent)
: WNumber(pParent) {
}
void WNumberDb::setValue(double dValue) {
QString strDb;
if (dValue != 0.0) {
double v = ratio2db(dValue);
strDb = QString::number(v, 'f', m_iNoDigits);
} else {
strDb = "-" + QString(QChar(0x221E));
}
if (m_skinText.contains("%1")) {
setText(m_skinText.arg(strDb));
} else {
setText(m_skinText + strDb + " dB");
}
}
|