Results 1 to 2 of 2

Thread: Zoom the paintevent data using qrubberband

  1. #1
    Join Date
    Aug 2013
    Qt products
    Qt3 Qt4 Qt5
    Unix/X11 Windows

    Default Zoom the paintevent data using qrubberband

    hey i made a gui in which i draw manything using paintevent .now i want to put zoom functionality in this .so, i want that selcted area should be zoom for this i am using qrubberband but i do not know how to zoom selected area .please give me some suggession or some demo code. thanks in advance.

  2. #2
    Join Date
    Jan 2008
    Alameda, CA, USA
    Thanked 687 Times in 677 Posts
    Qt products
    Windows Android

    Default Re: Zoom the paintevent data using qrubberband

    You know the top left coordinate (in pixels) of the zoom rect, and you can compute the width and height scale factors compared to the full view (x-scale = fullwidth / zoomwidth, y-scale = fullheight / zoomheight). Use QPainter::translate() to move the zoom rect, followed by QPainter::scale() to magnify the contents to fit the whole view.

Similar Threads

  1. About QwtPlotCurve Zoom out\Zoom in?
    By wangq0206 in forum Qwt
    Replies: 2
    Last Post: 25th April 2013, 07:10
  2. 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
  3. QWTPlot Zoom: cannot zoom negative value
    By jwieland in forum Qwt
    Replies: 0
    Last Post: 8th January 2010, 16:16
  4. Replies: 1
    Last Post: 16th November 2009, 05:25
  5. QGLWidget with text - zoom in / zoom out
    By h123 in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 09:56


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.