mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
636550d413
commit
f129024fc7
2 changed files with 42 additions and 16 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue