34 :QWidget(widget), m_f_max(0), m_db_min(0), m_db_max(0),
35 m_decades(0), m_function(Q_NULLPTR)
37 init(10000, -12, +12);
69 const int width = this->width();
70 const int height = this->height();
74 if ((width <= 0) || (height <= 0))
return;
77 p.fillRect(
rect(), QBrush(palette().dark()));
79 double scale =
static_cast<double>(height-1) /
81 double min = pow(10.0, static_cast<double>(
m_db_min) / 10.0);
82 double max = pow(10.0, static_cast<double>(
m_db_max) / 10.0);
85 for (
int x=0; x < width; x++) {
92 double f = (
m_f_max *
static_cast<double>(x) /
93 static_cast<double>(width));
100 if (a < min) a = min;
101 if (a > max) a = max;
104 double db = 10.0 * log10(a);
109 p.drawLine(x, y+1, x, height-1);
113 p.setPen(palette().text().color());
115 p.drawLine(0, y, width-1, y);
virtual double at(double f)=0
static double rect(double param)