I have created my own curvetracker. My intention is to execute trackerTextF virtual function but it would be processed within time limits. So if user moves more tracer is updated max 10times/second. So timer interval is 100ms.
For some reason i'm getting slot error:
Object::connect: No such slot QwtPlotPicker::tracked() in \src\curvetracker.cpp:27
I can't see any problem in my code
CurveTracker.h
{
public:
protected:
public slots:
void tracked();
protected:
private:
QLineF curveLineAt
( const CustomQwtCurve
*,
double x
) const;
};
class QwtPlotCurve;
class CurveTracker: public QwtPlotPicker
{
public:
CurveTracker( QWidget * );
protected:
virtual QwtText trackerTextF( const QPointF & ) const;
virtual QRect trackerRect( const QFont & ) const;
public slots:
void tracked();
protected:
QTimer* timer;
private:
QString curveInfoAt( const CustomQwtCurve *, const QPointF & ) const;
QLineF curveLineAt( const CustomQwtCurve *, double x ) const;
};
To copy to clipboard, switch view to plain text mode
CurveTracker.cpp
CurveTracker
::CurveTracker( QWidget *canvas
):{
setRubberBand( CrossRubberBand);
connect(timer,SIGNAL(timeout()), this, SLOT(tracked()));
timer->start(100);
}
CurveTracker::CurveTracker( QWidget *canvas ):
QwtPlotPicker( canvas )
{
setTrackerMode( QwtPlotPicker::ActiveOnly );
setRubberBand( CrossRubberBand);
setStateMachine( new QwtPickerDragPointMachine() );
timer=new QTimer(this);
connect(timer,SIGNAL(timeout()), this, SLOT(tracked()));
timer->start(100);
}
To copy to clipboard, switch view to plain text mode
Bookmarks