namespace pv {
namespace view {
+const int Ruler::RulerHeight = 30;
const int Ruler::MinorTickSubdivision = 4;
const int Ruler::ScaleUnits[3] = {1, 2, 5};
return s;
}
+QSize Ruler::sizeHint() const
+{
+ return QSize(0, RulerHeight);
+}
+
void Ruler::paintEvent(QPaintEvent*)
{
using namespace Qt;
Q_OBJECT
private:
+ static const int RulerHeight;
static const int MinorTickSubdivision;
static const int ScaleUnits[3];
static QString format_time(double t, unsigned int prefix,
unsigned precision = 0);
+public:
+ QSize sizeHint() const;
+
private:
void paintEvent(QPaintEvent *event);
const double View::MaxScale = 1e9;
const double View::MinScale = 1e-15;
-const int View::RulerHeight = 30;
-
const int View::MaxScrollValue = INT_MAX / 2;
const int View::SignalHeight = 30;
void View::update_layout()
{
- setViewportMargins(_header->sizeHint().width(), RulerHeight, 0, 0);
+ setViewportMargins(_header->sizeHint().width(),
+ _ruler->sizeHint().height(), 0, 0);
_ruler->setGeometry(_viewport->x(), 0,
_viewport->width(), _viewport->y());
_header->setGeometry(0, _viewport->y(),
offset += SignalHeight + 2 * SignalMargin;
}
- setViewportMargins(_header->sizeHint().width(), RulerHeight, 0, 0);
+ update_layout();
normalize_layout();
}
static const double MaxScale;
static const double MinScale;
- static const int RulerHeight;
-
static const int MaxScrollValue;
public: