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:
Qt Code:
  1. class train_evt_marker: public QwtPlotMarker
  2. {
  3. public:
  4. train_evt_marker():QwtPlotMarker()
  5. {
  6. // here I see this log message
  7. QLOG_TRACE()<<"-------------constructor MARKER-------------";
  8. }
  9.  
  10. void draw(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect)
  11. {
  12. // here I can't see the log messages... is this overrided method ignored??
  13. QLOG_TRACE()<<"-------------DRAw MARKER-------------";
  14. // calling the parent method continuing the draw of the curve
  15. QwtPlotMarker::draw(painter,xMap,yMap,canvasRect);
  16. }
  17. };
To copy to clipboard, switch view to plain text mode 

TIA