sonulohani
1st June 2012, 05:56
Sir, this is my code:-
in .h file
class Marker:public QwtPlotMarker{
public:
virtual void drawLabel(QPainter *painter, const QRectF &, const QPointF &pt) const{
painter=new QPainter;
QImage pixx(":/Images/AlarmEvent.png");
QRectF r(1,1,10,10);
painter->drawImage(r,pixx);
}
};
in .cpp file
Marker *mark;
mark=new Marker;
mark->setValue(xData_1.at(0),yData_1.at(0));//this is where i want to place the marker.
mark->attach(plot);
Sir, it is not showing any label on the marker. Why is this happening? Is something wrong in the code? Please Guide Me.
in .h file
class Marker:public QwtPlotMarker{
public:
virtual void drawLabel(QPainter *painter, const QRectF &, const QPointF &pt) const{
painter=new QPainter;
QImage pixx(":/Images/AlarmEvent.png");
QRectF r(1,1,10,10);
painter->drawImage(r,pixx);
}
};
in .cpp file
Marker *mark;
mark=new Marker;
mark->setValue(xData_1.at(0),yData_1.at(0));//this is where i want to place the marker.
mark->attach(plot);
Sir, it is not showing any label on the marker. Why is this happening? Is something wrong in the code? Please Guide Me.