Results 1 to 5 of 5

Thread: QwtPlotZoomer always generat signal zoomed

  1. #1
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default QwtPlotZoomer always generat signal zoomed

    In function
    void QwtPlotZoomer::zoom( int offset )
    {
    if ( offset == 0 )
    d_data->zoomRectIndex = 0;
    else
    {
    int newIndex = d_data->zoomRectIndex + offset;
    newIndex = qMax( 0, newIndex );
    newIndex = qMin( int( d_data->zoomStack.count() ) - 1, newIndex );

    d_data->zoomRectIndex = uint( newIndex );
    }

    rescale();

    Q_EMIT zoomed( zoomRect() );
    }

    need to generate |zoomed| and to call |rescale| only if value of |d_data->zoomRectIndex| is changed
    ???

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

    Default Re: QwtPlotZoomer always generat signal zoomed

    True - I fixed this SVN trunk.

    Uwe

  3. #3
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QwtPlotZoomer always generat signal zoomed

    Quote Originally Posted by Uwe View Post
    True - I fixed this SVN trunk.

    Uwe
    Why not fixed on a branch qwt-6.1? Is the current stable branch

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

    Default Re: QwtPlotZoomer always generat signal zoomed

    Quote Originally Posted by atrofimov View Post
    Why not fixed on a branch qwt-6.1? Is the current stable branch
    Because it might break applications in a way you would not expect from a "compatible" version and the signal is a sensible thing. Sending an unnecessary signal is of course not correct - but not totally wrong.

    But maybe you can also go with the QwtScaleWidget::scaleDivChanged() signals. Those indicate any change of the axes ( regardless of being initiated from the zoomer or something else ) and are often the better approach anyway.

    Uwe

  5. #5
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QwtPlotZoomer always generat signal zoomed

    Any signal has to work only if value changed

Similar Threads

  1. How to obtain values of a zoomed curve ?
    By Hogwarts in forum Qwt
    Replies: 3
    Last Post: 7th June 2012, 15:12
  2. Replies: 3
    Last Post: 18th May 2011, 20:33
  3. Replies: 1
    Last Post: 11th March 2011, 10:00
  4. QGraphicsPixmapItem cuts off when zoomed
    By abbapatris in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2008, 15:05
  5. Q3Canvas problem (zoomed in drawBackground)
    By Pieter from Belgium in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2006, 09:15

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.