12345678910111213141516171819202122232425262728293031323334 |
- #ifndef AXIS_TAG_H
- #define AXIS_TAG_H
- #include <QObject>
- #include "qcustomplot.h"
- class AxisTag : public QObject
- {
- Q_OBJECT
- public:
- explicit AxisTag(QCPAxis *parentAxis);
- virtual ~AxisTag();
- // setters:
- void setPen(const QPen &pen);
- void setBrush(const QBrush &brush);
- void setText(const QString &text);
- // getters:
- QPen pen() const { return mLabel->pen(); }
- QBrush brush() const { return mLabel->brush(); }
- QString text() const { return mLabel->text(); }
- // other methods:
- void updatePosition(double value);
- protected:
- QCPAxis *mAxis;
- QPointer<QCPItemTracer> mDummyTracer;
- QPointer<QCPItemLine> mArrow;
- QPointer<QCPItemText> mLabel;
- };
- #endif // AXIS_TAG_H
|