mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Made the Axis be aware of Direction.
Now we can create an axis that's topToBottom, BottomToTop, LeftToRight and RightToLeft. This was needed for the Temperature Plot, because it should be inverted (starting on the bottom). Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
58aeb6ce40
commit
f9784d876e
3 changed files with 53 additions and 25 deletions
|
|
@ -13,12 +13,13 @@ class DiveCartesianAxis : public QObject, public QGraphicsLineItem{
|
|||
Q_PROPERTY(qreal x WRITE setX READ x)
|
||||
Q_PROPERTY(qreal y WRITE setY READ y)
|
||||
public:
|
||||
enum Orientation{TopToBottom, BottomToTop, LeftToRight, RightToLeft};
|
||||
DiveCartesianAxis();
|
||||
virtual ~DiveCartesianAxis();
|
||||
void setMinimum(double minimum);
|
||||
void setMaximum(double maximum);
|
||||
void setTickInterval(double interval);
|
||||
void setOrientation(Qt::Orientation orientation);
|
||||
void setOrientation(Orientation orientation);
|
||||
void setTickSize(qreal size);
|
||||
void updateTicks();
|
||||
double minimum() const;
|
||||
|
|
@ -34,7 +35,7 @@ signals:
|
|||
protected:
|
||||
virtual QString textForValue(double value);
|
||||
|
||||
Qt::Orientation orientation;
|
||||
Orientation orientation;
|
||||
QList<DiveLineItem*> ticks;
|
||||
QList<DiveTextItem*> labels;
|
||||
double min;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue