Results 1 to 2 of 2

Thread: QGraphicsView and zooming

  1. #1
    Join Date
    Sep 2012
    Location
    Ankara
    Posts
    15
    Thanks
    3
    Qt products
    Platforms
    Unix/X11

    Unhappy QGraphicsView and zooming

    Hi everyone. I'm going to make a gui for IRAF text based astronomical program.
    I'll display images on this gui.
    So there is a QGraphicsView and it must be talented for zooming.
    I get QGraphicsView's name as gw and make zoom with sending w and h values to zoom function.

    Qt Code:
    1. def zoom(self, gw, w, h):
    2. gw.fitInView(0,0,w,h)
    To copy to clipboard, switch view to plain text mode 

    There is two problems:

    1) I'm using a verticalSlider for zooming and when i slide it at first it zooming, there is no problem whit second one. But at third it zooming out. I watched slider's values there is no problem with them.(actually I limited slider's value between 1 and 99. But at zoom out when I using scroll-ball and at end still scrolling down slider return 1-2-1-2-1-2-1-2 values in order)
    2) When I zoomed and put the screen's center somewhere and then zoomed again. Naturally center going to (0,0). How can I get center of displayed area?

    Sorry for bad English.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsView and zooming

    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Image rendering and zooming (QGraphicsView)
    By Sergex in forum Qt Programming
    Replies: 7
    Last Post: 6th October 2011, 12:51
  2. How to zooming like in AutoCAD with QGraphicsView?
    By Tarhan in forum Qt Programming
    Replies: 5
    Last Post: 17th January 2011, 08:16
  3. Questions about zooming QGraphicsView
    By JovianGhost in forum Qt Programming
    Replies: 4
    Last Post: 30th March 2010, 14:54
  4. Zooming is too slow with QGraphicsView
    By learning_qt in forum Qt Programming
    Replies: 10
    Last Post: 4th December 2008, 09:23
  5. Zooming in QGraphicsView
    By JonathanForQT4 in forum Newbie
    Replies: 3
    Last Post: 17th April 2007, 05:50

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.