Results 1 to 2 of 2

Thread: zoomer doesn't zoom into the correct rectangle?

  1. #1
    Join Date
    Oct 2010
    Posts
    58
    Thanks
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default zoomer doesn't zoom into the correct rectangle?

    Hi,

    Anyone have any idea why my zoomer zooms fine until I try to zoom into the area on the far right of the qwtplot?

    It seems to work fine on the first 3/4 of my plot (from left to right), but when I zoom on my curve on the far right side of my plot it returns a blank area that is farther down the x axis than the area I selected.


    any ideas?

    Qt Code:
    1. class MyZoomer : public QwtPlotZoomer
    2. {
    3. public:
    4. MyZoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas):
    5. QwtPlotZoomer(xAxis, yAxis, canvas)
    6. {
    7. setTrackerMode(ActiveOnly);
    8. }
    9. };
    10.  
    11. class MyPlot : public QwtPlot
    12. {
    13. CurveAttrib ** curves;
    14. public:
    15. MyPlot(){
    16. myZoomer[0] = new MyZoomer(QwtPlot::xBottom, QwtPlot::yLeft, this->canvas());
    17. myZoomer[1] = new MyZoomer(QwtPlot::xBottom, QwtPlot::yRight, this->canvas());
    18. enableAxis(QwtPlot::yRight);
    19. }
    20. MyZoomer *myZoomer[2];
    21.  
    22. void plotMyPlot(){
    23. ....
    24.  
    25. myZoomer[0]->setZoomBase();
    26. myZoomer[1]->setZoomBase();
    27. this->setAxisAutoScale(yLeft);
    28. this->setAxisAutoScale(yRight);
    29. this->setAxisAutoScale(xBottom);
    30. }
    31. };
    32. #endif
    To copy to clipboard, switch view to plain text mode 

    I'm not doing very fancy stuff with my zoomer but I know it has to be in my code because if I use a QwtPlotZoomer zoomer = new QwtPlotZoomer it works just fine

    Thanks

  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: zoomer doesn't zoom into the correct rectangle?

    Quote Originally Posted by kja View Post
    Anyone have any idea why my zoomer zooms fine until I try to zoom into the area on the far right of the qwtplot?
    No, but what about debugging the rectangle that is passed to QwtPlotZoomer::zoom(const QwtDoubleRect &) ?

    Uwe

    PS: You could also debug the QwtPlotZoomer::zoomed() signal

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

    kja (7th December 2010)

Similar Threads

  1. how to zoom in zoom out tableview in QT programming?
    By nageshvk in forum Qt Programming
    Replies: 0
    Last Post: 27th October 2010, 05:05
  2. QWTPlot Zoom: cannot zoom negative value
    By jwieland in forum Qwt
    Replies: 0
    Last Post: 8th January 2010, 16:16
  3. Replies: 1
    Last Post: 16th November 2009, 05:25
  4. Why doesn't Eclipse find a correct inclusion?
    By Cruz in forum Installation and Deployment
    Replies: 4
    Last Post: 1st October 2009, 12:25
  5. Replies: 2
    Last Post: 21st May 2007, 21:12

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.