Results 1 to 3 of 3

Thread: replot in Qwt Zoomer

  1. #1
    Join Date
    Sep 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default replot in Qwt Zoomer

    Hellow!, i have this code:

    QwtPlotZoomer* zoomer = new QwtPlotZoomer( canvas(),true);
    zoomer->setRubberBandPen( QColor( Qt::black ) );
    zoomer->setTrackerPen( QColor( Qt::black ) );
    zoomer->setMousePattern( QwtEventPattern::MouseSelect2,
    Qt::RightButton, Qt::ControlModifier );
    zoomer->setMousePattern( QwtEventPattern::MouseSelect3,
    Qt::RightButton );
    this->setAutoReplot(true);
    replot();

    In first i have this, because i called replot():
    ad7ef8fd02ec69e63af550639901254b.jpg
    But if i pressed right mouse button or select some areas and back to start area by right mouse button, i get that:
    7e25e354962e7dcde809012a402ef24e.jpg
    I try use it:
    zoomer->setZoomBase(this->rect());

    plot->setAutoReplot(true);

    connect(zoomer, SIGNAL(zoomed(const QRectF&)), this, SLOT(replot()));

    But nothing is working
    In advance many thanks for your help!

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

    Default Re: replot in Qwt Zoomer

    Try to understand, when your axes get initialized like we can see them in your first screenshot. Than take care, that your zoomer gets initialized with these ranges.

    zoomer->setZoomBase(this->rect());
    Calling setZoomBase without parameter initializes the zoomer with the current scale ranges ( this->rect() is wrong, because it is something else in widget coordinates ).

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    ruzik (22nd September 2011)

  4. #3
    Join Date
    Sep 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: replot in Qwt Zoomer

    Thank you for your help!

Similar Threads

  1. how to get zoomer to replot
    By kja in forum Newbie
    Replies: 3
    Last Post: 17th November 2010, 07:15
  2. how to accelerate the replot?
    By rambo83 in forum Qwt
    Replies: 6
    Last Post: 17th March 2010, 11:11
  3. how to speed up the replot?
    By rambo83 in forum Qwt
    Replies: 4
    Last Post: 16th December 2009, 11:51
  4. Replies: 0
    Last Post: 23rd November 2009, 10:43
  5. Replies: 1
    Last Post: 4th November 2009, 22:14

Tags for this Thread

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.