Added a 2 Ruler Items, Time and Depth.

The ruler items are needed so I can get the correct
coordinates of the planned dive. This is a very
rudimentary ruler and it needs a bit of love, but
it already gives me something to work on.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-06-20 16:48:24 -03:00
parent 636550d413
commit f129024fc7
2 changed files with 42 additions and 16 deletions

View file

@ -12,22 +12,21 @@ public:
QGraphicsLineItem *to;
};
class Ruler : public QGraphicsItem{
class Ruler : public QGraphicsLineItem{
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);
void updateTicks();
private:
void updateTicks();
Qt::Orientation orientation;
QList<QGraphicsLineItem*> ticks;
double min;
double max;
double interval;
double posBegin;
double posEnd;
};
@ -56,5 +55,9 @@ private:
QGraphicsLineItem *verticalLine;
QGraphicsLineItem *horizontalLine;
DiveHandler *activeDraggedHandler;
Ruler *timeLine;
Ruler *depthLine;
};
#endif