Results 1 to 3 of 3

Thread: About QwtPlotCurve Zoom out\Zoom in?

  1. #1

    Default Re: About QwtPlotCurve Zoom out\Zoom in?

    first of all , hello , everyone!
    I program Curve application with Qwt, when I use QwtPlot::setAxisScale(xBottom, 0, 3600, 300), the result of ZoomIn is right,the scale show right , but the result of Zoom out is not correct.

    I rewrite the function QwtText QwtScaleDraw::label(double v) const, I print out the value "v", is
    v = 0
    v = 3600
    v = 300
    v = 600
    v = 900
    v = 1200
    v = 1500
    v = 1800
    v = 2100
    v = 2400
    v = 2700
    v = 3000
    v = 3600
    and then , I perform ZoomIn , the result is
    v = 900
    v = 1800
    v = 1200
    v = 1500
    and i click the mouseRightbutton , the result is not the same as I think,
    v = 0
    v = 3500
    v = 500
    v = 1000
    v = 1500
    v = 2000
    v = 2500
    v = 3000
    what i need to do , to take the result as i think .
    i want the result like this:
    v = 0
    v = 3600
    v = 300
    v = 600
    v = 900
    v = 1200
    v = 1500
    v = 1800
    v = 2100
    v = 2400
    v = 2700
    v = 3000
    v = 3600
    Last edited by wangq0206; 25th April 2013 at 07:17.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: About QwtPlotCurve Zoom out\Zoom in?

    The zoomer doesn't know the about the step size ( 300 ), when zooming out.

    One solution is to use QwtPlot::setAxisMaxMajor() instead of the step size - what affects the zoomer - or implement a slot connected to QwtPlotZoomer::zoomed(), where you fix the scale.

    Uwe

  3. #3

    Default Re: About QwtPlotCurve Zoom out\Zoom in?

    first , thank Uwe very much !!!!
    i don't understand what you said!
    this is my code:
    Qt Code:
    1. QMainPlot::QMainPlot(QWidget *parent) : QwtPlot(parent)
    2. {
    3. setAutoReplot(false);
    4.  
    5. setAxisScaleDraw(QwtPlot::xBottom,
    6. new QTimeScaleDraw(m_TimeScaleFormat));
    7.  
    8. setAxisScale(QwtPlot::xBottom, 0, 3600, 300);
    9. setAutoReplot(true);
    10. }
    To copy to clipboard, switch view to plain text mode 
    i don't know how to put the code"setAxisMaxMajor(QwtPlot::xBottom, 12);" where ?

    and , how to implement the slot to QwtPlotZoomer::Zoomed()?
    please give me some codes.
    Last edited by wangq0206; 25th April 2013 at 08:24.

Similar Threads

  1. Replies: 18
    Last Post: 16th November 2012, 15:09
  2. how to zoom in zoom out tableview in QT programming?
    By nageshvk in forum Qt Programming
    Replies: 0
    Last Post: 27th October 2010, 06:05
  3. QWTPlot Zoom: cannot zoom negative value
    By jwieland in forum Qwt
    Replies: 0
    Last Post: 8th January 2010, 17:16
  4. Replies: 1
    Last Post: 16th November 2009, 06:25
  5. QGLWidget with text - zoom in / zoom out
    By h123 in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 10:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.