Added the skeleton for the Ruler Item,

The ruler will deliver the Time and the Depth, later.
it should be vertical or horizontal, and will have
ticks

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-06-20 15:52:27 -03:00
parent 52a0e6c82d
commit 636550d413
2 changed files with 60 additions and 0 deletions

View file

@ -11,6 +11,27 @@ public:
QGraphicsLineItem *from;
QGraphicsLineItem *to;
};
class Ruler : public QGraphicsItem{
public:
Ruler();
void setMinimum(double minimum);
void setMaximum(double maximum);
void setTickInterval(double interval);
void setOrientation(Qt::Orientation orientation);
void setLine(qreal x1, qreal y1, qreal x2, qreal y2);
private:
void updateTicks();
Qt::Orientation orientation;
QList<QGraphicsLineItem*> ticks;
double min;
double max;
double posBegin;
double posEnd;
};
class DivePlanner : public QGraphicsView {
Q_OBJECT
public: