graph_tracer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef PLOT_TRACER_H
  2. #define PLOT_TRACER_H
  3. #include "axis_rect.h"
  4. class PlotTimeTracer : public QObject
  5. {
  6. Q_OBJECT
  7. public:
  8. explicit PlotTimeTracer(AxisRect *axisrect);
  9. ~PlotTimeTracer();
  10. void initialize();
  11. bool visible() const;
  12. QCPAxis::AxisType yAxisType() const;
  13. QPointF mousePos() const;
  14. void setVisible(bool visible);
  15. void setYAxisType(const QCPAxis::AxisType &yAxisType);
  16. void setMousePos(const QPointF &mousePos);
  17. void updateItems();
  18. QColor lineColor() const;
  19. void setLineColor(const QColor &lineColor);
  20. QColor textColor() const;
  21. void setTextColor(const QColor &textColor);
  22. QBrush textBrush() const;
  23. void setTextBrush(const QBrush &textBrush);
  24. signals:
  25. public slots:
  26. protected:
  27. AxisRect *mAxisRect;
  28. QCPItemStraightLine *mVerticalLine;
  29. QVector<QCPItemTracer *> mTracers;
  30. QVector<QCPItemLine *> mArrows;
  31. QVector<QCPItemText *> mTexts;
  32. QCPItemText *mTimeText;
  33. QColor mLineColor;
  34. QColor mTextColor;
  35. QBrush mTextBrush;
  36. bool mVisible;
  37. QCPAxis::AxisType mYAxisType;
  38. QPointF mMousePos;
  39. bool mIsInitialized;
  40. };
  41. #endif // PLOT_TRACER_H