axis_tag.h 737 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef AXIS_TAG_H
  2. #define AXIS_TAG_H
  3. #include <QObject>
  4. #include "qcustomplot.h"
  5. class AxisTag : public QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. explicit AxisTag(QCPAxis *parentAxis);
  10. virtual ~AxisTag();
  11. // setters:
  12. void setPen(const QPen &pen);
  13. void setBrush(const QBrush &brush);
  14. void setText(const QString &text);
  15. // getters:
  16. QPen pen() const { return mLabel->pen(); }
  17. QBrush brush() const { return mLabel->brush(); }
  18. QString text() const { return mLabel->text(); }
  19. // other methods:
  20. void updatePosition(double value);
  21. protected:
  22. QCPAxis *mAxis;
  23. QPointer<QCPItemTracer> mDummyTracer;
  24. QPointer<QCPItemLine> mArrow;
  25. QPointer<QCPItemText> mLabel;
  26. };
  27. #endif // AXIS_TAG_H