Results 1 to 3 of 3

Thread: QwtScaleEngine::Inverted has no effect (Qwt 6.1.2)

  1. #1
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default QwtScaleEngine::Inverted has no effect (Qwt 6.1.2)

    Hi

    I recently upgraded Qwt to 6.1.2 (from 6.1.0).
    For one of my QwtPlot-derived class, I tweak the 'yLeft' axis scale engine to be QwtScaleEngine::Inverted. It used to work, but not anymore (i.e. the axis is not inverted).

    I tracked down
    Qt Code:
    1. QwtScaleEngine::Inverted
    To copy to clipboard, switch view to plain text mode 
    usage in Qwt source code. The flag is tested in
    Qt Code:
    To copy to clipboard, switch view to plain text mode 
    , but unfortunately the method is not called, eventhough I call setAxisAutoScale(yLeft, true) in constructor. I'm not sure why the method is not called. QwtPlot::setAxisScale() seems to disable AutoScale, but is not called until I use magnifier or zoomer for the first time.

    Any idea ?

    Is QwtScaleEngine::Inverted flag broken ?
    Is it possible to have an QwtScaleEngine::Inverted axis with zoomer/magnifier/panner tools ?

  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: QwtScaleEngine::Inverted has no effect (Qwt 6.1.2)

    Is QwtScaleEngine::Inverted flag broken ?
    Did a quick check with the simpleplot example: no problems there.

    Is it possible to have an QwtScaleEngine::Inverted axis with zoomer/magnifier/panner tools ?
    Sure all of them preserve the direction of the scale.

    When not using the autoscaler: setAxisScale( yLeft, 0, 10 ) is inverse to setAxisScale( yLeft, 10, 0 ) !

    Uwe

  3. #3
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Re: QwtScaleEngine::Inverted has no effect (Qwt 6.1.2)

    I found what caused the problem

    When data change, I want my view to fit contents. So I have a MyPlot::resetZoom() method, which used to be like this :

    Qt Code:
    1. void MyPlot::resetZoom(const QRectF & rect)
    2. {
    3. p_zoomer->zoom(rect);
    4. p_zoomer->setZoomBase(rect);
    5. p_zoomer->zoom(0);
    6. }
    To copy to clipboard, switch view to plain text mode 

    and is called like this :

    Qt Code:
    1. resetZoom(some_curve->boundingRect());
    To copy to clipboard, switch view to plain text mode 

    But I never quite understood the zoomer behaviour, and what to call to setup zoom level properly.
    I just changed my code to not use a QwtPlotZoomer anymore (but still a magnifier), and modified resetZoom() method :

    Qt Code:
    1. void MyPlot::resetZoom()
    2. {
    3. setAxisAutoScale(xAxis(), true);
    4. setAxisAutoScale(yAxis(), true);
    5. replot();
    6. }
    To copy to clipboard, switch view to plain text mode 

    And it's ok now.

    Some day I'll try to better understand all this stuff

Similar Threads

  1. Replies: 1
    Last Post: 1st December 2014, 19:51
  2. Draw line with inverted background color
    By viswanath in forum Qt Programming
    Replies: 4
    Last Post: 12th November 2011, 04:57
  3. QwtScaleEngine Time scale engine
    By med_1309 in forum Qwt
    Replies: 1
    Last Post: 25th August 2010, 19:54
  4. Inverted QTextEdit
    By TMan in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2009, 17:35
  5. QWTdial inverted range
    By jmsbc in forum Qwt
    Replies: 1
    Last Post: 12th January 2009, 22:21

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.