Results 1 to 14 of 14

Thread: QGraphicsView keep aspect ratio of items when scaled

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QGraphicsView keep aspect ratio of items when scaled

    Hi,

    I'm trying to use QGraphicsView and QGraphicsScene to do represent a plastic film that is 0.3meter width and 100meter height. In this plastic film there are some marks that I want to show to the user. The problem is that the aspect ratio of the film. Using the "fitInView" method keeping the aspect ratio gets me a view like you can see on the attached image.
    keepAspectRatio.PNG
    The black line is the rectangle that represents the full scene.

    Without keeping the aspect ratio I get what I want but with the problem that the items also don't keep their aspect ratio, so a circle is displayed as an ellipse.

    What I need is to show the full scene into the view(sure that will not keep the aspect ratio) but show the items with the original aspect ratio.

    Thanks,

    P.D.: I don't want the scroll bars to be used. This is why I want to show the full scene fitting the view.

    Maybe the use of Qwt will be simple as I only want to let the user to pick the marks to show more information.
    Last edited by ^NyAw^; 29th January 2013 at 10:19.
    Òscar Llarch i Galán

Similar Threads

  1. Get aspect ratio from Phonon videoWidget
    By budda in forum Qt Programming
    Replies: 2
    Last Post: 24th October 2012, 08:46
  2. Printing and Aspect ratio
    By cpt4 in forum Qwt
    Replies: 9
    Last Post: 30th September 2011, 14:28
  3. keeping aspect ratio while resizing
    By franco.amato in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2009, 20:12
  4. Preserving aspect ratio of image
    By Banjo in forum Qt Programming
    Replies: 2
    Last Post: 16th January 2009, 13:39
  5. aspect ratio of top-level widgets
    By urbangipsy in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 21:49

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.