Results 1 to 2 of 2

Thread: fitInView problem at QGraphicsView

  1. #1
    Join Date
    Sep 2008
    Posts
    12
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default fitInView problem at QGraphicsView

    At my qt4 application i am creating a QGraphicsView and adding a scene to it then displaying pdf files, when i rotate the view i want to image fit in the view so i tried to use the finInView but couldn't managed to fit the view seems something is missing, can someone help me on it? Here is the class: http://rafb.net/p/Kgkr7116.html

    You may read the line 33,34, 73 and then display and paintView functions. Do i need to set a rect for the scene?

    The problem is when i rotate the graphicsview, i am not sure how to fit the image at the view. If i don't make any scaling, it fits but there always happen extra empty spaces to scroll.
    Last edited by oguzy; 20th November 2008 at 08:01.

  2. #2
    Join Date
    Jun 2008
    Posts
    35
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: fitInView problem at QGraphicsView

    take scene bounding rect of graphics item and call

    Qt Code:
    1. centerOn(rect.center());
    2.  
    3. setSceneRect(rect);
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 2
    Last Post: 26th February 2009, 10:12
  2. Problem with QGraphicsView and ItemIgnoresTransformations
    By coderCPP1981 in forum Qt Programming
    Replies: 6
    Last Post: 27th June 2008, 05:28
  3. Mystic Problem (QGraphicsView + QGLWidget)
    By NoRulez in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2008, 10:39
  4. Problem determining size of QGraphicsView
    By Bocki in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2008, 14:54
  5. graphics view FitInView problem
    By aamer4yu in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2007, 10:24

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.