Results 1 to 2 of 2

Thread: qwt zoomer::zoomed(QRectF) -->possible bug?!

  1. #1
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation qwt zoomer::zoomed(QRectF) -->possible bug?!

    Here is a strange behaviour which I am not sure but it looks like a possible bug.

    Qt Code:
    1. connect(m_zoomer,SIGNAL(zoomed(QRectF)), this,SLOT(getZoomedArea(QRectF)));
    2.  
    3.  
    4. void my2dPlot::getZoomedArea(QRectF newlyZoomedArea)
    5. {
    6. QPointF a = newlyZoomedArea.topLeft();//(1535.7824557983249, -1.2464700495720682e-12)
    7. QPointF b = newlyZoomedArea.bottomRight();//(1572.0439921135721, 2.5595399250520858e-11)
    8. zoomedArea.setTopLeft(a);
    9. zoomedArea.setBottomRight(b);
    10. }
    To copy to clipboard, switch view to plain text mode 


    As you can see from the numbers I got from debugging,

    a is not a topleft but a bottomleft and
    b is not a bottomright but a topright

    Is it a bug? please reproduce

  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: qwt zoomer::zoomed(QRectF) -->possible bug?!

    QRect::top/bottom are confusing because top is smaller than bottom. The reason behind it is, that in screen coordinates (0, 0) is topLeft. In most plots the coordinate system is mirrored.

    Uwe

Similar Threads

  1. Rotate a QRectF
    By whitefurrows in forum Qt Programming
    Replies: 5
    Last Post: 15th July 2009, 15:33
  2. Replies: 0
    Last Post: 30th May 2009, 05:43
  3. QGraphicsPixmapItem cuts off when zoomed
    By abbapatris in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2008, 15:05
  4. Q3Canvas problem (zoomed in drawBackground)
    By Pieter from Belgium in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2006, 09:15
  5. QRectF and drawText
    By aronsson in forum Qt Programming
    Replies: 1
    Last Post: 4th July 2006, 16:05

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.