DataRealTimeDisplay/realTimeDataDisplay/AxisTag.h
2023-01-16 15:10:44 +08:00

31 lines
634 B
C++

#pragma once
#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;
};