Results 1 to 5 of 5

Thread: QGraphicsView and QGraphicsScene geometry

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: QGraphicsView and QGraphicsScene geometry

    In your resize event, you could try a call to

    Qt Code:
    1. QGraphicsView::fitInView( scene().sceneRect(), Qt::KeepAspectRatio );
    To copy to clipboard, switch view to plain text mode 

    This will maintain the same relative sizes and aspect ratio of everything in the scene, *except* those items with the QGraphicsItem::ItemIgnoresTransformations flag set. So if your tach's rect is square in scene coordinates, it will be square in the view.

  2. The following user says thank you to d_stranz for this useful post:

    meazza (4th July 2011)

Similar Threads

  1. QGraphicsScene & QGraphicsView help please
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 13th February 2017, 12:30
  2. QGraphicsView and QGraphicsScene
    By Molier in forum Qt Programming
    Replies: 11
    Last Post: 28th November 2010, 01:23
  3. QGraphicsView and QGraphicsScene
    By alisami in forum Qt Programming
    Replies: 8
    Last Post: 4th December 2008, 10:10
  4. QGraphicsScene and QGraphicsView
    By sabeesh in forum Qt Programming
    Replies: 7
    Last Post: 1st August 2007, 06:59
  5. QGraphicsScene and QGraphicsView
    By rossd in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2007, 14:43

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
  •  
Qt is a trademark of The Qt Company.