I don't know if my trouble is properly related to Qwt or widely to c++
How do I override draw method of an item (curve, marker) for customize its drawing behaviour ?
I tried with this code, but I can't take the control of overrided draw method, seems that compiler is ignoring it:
This is the code that is not working:
{
public:
{
// here I see this log message
QLOG_TRACE()<<"-------------constructor MARKER-------------";
}
{
// here I can't see the log messages... is this overrided method ignored??
QLOG_TRACE()<<"-------------DRAw MARKER-------------";
// calling the parent method continuing the draw of the curve
}
};
class train_evt_marker: public QwtPlotMarker
{
public:
train_evt_marker():QwtPlotMarker()
{
// here I see this log message
QLOG_TRACE()<<"-------------constructor MARKER-------------";
}
void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect)
{
// here I can't see the log messages... is this overrided method ignored??
QLOG_TRACE()<<"-------------DRAw MARKER-------------";
// calling the parent method continuing the draw of the curve
QwtPlotMarker::draw(painter,xMap,yMap,canvasRect);
}
};
To copy to clipboard, switch view to plain text mode
TIA
Bookmarks