Okay,
The 2nd solution works perfectly for me, without error.
For the reference, mentioned the solution here,
Qt Code:
  1. class YourMarker: public QwtPlotMarker
  2. {
  3. public:
  4. YourMarker( ... )
  5. {
  6. setItemAttribute( QwtPlotItem::ScaleInterest, true );
  7. }
  8.  
  9. void updateScaleDiv( const QwtScaleDiv& xMap, const QwtScaleDiv& ) override
  10. {
  11. const double margin = ...; // pixels
  12.  
  13. const double min = xMap.invTransform( xMap.p1() + margin );
  14. const double max = xMap.invTransform( xMap.p2() - margin );
  15.  
  16. setXValue( qBound( min, xValue(), max ) );
  17. }
  18. };
To copy to clipboard, switch view to plain text mode 

Thank you so much