46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
|
#ifndef CHART_LINE_H
|
||
|
#define CHART_LINE_H
|
||
|
|
||
|
#include "chart/instruments/primitives/primitive_line.h"
|
||
|
|
||
|
namespace gtl
|
||
|
{
|
||
|
namespace gui
|
||
|
{
|
||
|
class chart_line : public ::chart::instrument::primitive::line
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
enum pos_behaviors{
|
||
|
magnetic_to_sample,
|
||
|
free
|
||
|
};
|
||
|
|
||
|
public:
|
||
|
chart_line(::chart::series::series *parent, Qt::Orientation orientation = Qt::Vertical);
|
||
|
|
||
|
void set_pos(qreal x);
|
||
|
qreal pos();
|
||
|
|
||
|
pos_behaviors behavior() const;
|
||
|
void set_behavior(pos_behaviors behavior);
|
||
|
|
||
|
void set_width(qreal value);
|
||
|
qreal width() const;
|
||
|
|
||
|
private:
|
||
|
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
||
|
|
||
|
protected:
|
||
|
pos_behaviors _behavior;
|
||
|
Qt::Orientation _orientation;
|
||
|
|
||
|
|
||
|
signals:
|
||
|
void get_nearest_x(qreal& x, pos_behaviors);
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif // CHART_LINE_H
|