Results 1 to 2 of 2

Thread: Automatic scale of Graphics View

  1. #1
    Join Date
    Dec 2009
    Location
    Bratislava, Slovakia
    Posts
    11
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question Automatic scale of Graphics View

    I have one graphics view that fills the entire area within main window. I want to enable resizing of the window, so that the graphics view will stretch corresponding to main window. How can I manage it? (it should be simple, but googling didn't help)

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Automatic scale of Graphics View

    The view should stretch or the scene inside it should scale? If the former then you are missing a layout in your main window's central widget. If the latter then reimplement resizeEvent for your view (or the main window, which might be easier) and call QGraphicsView::fitInView().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Add graphics view to tab widget?
    By Ishmael in forum Qt Programming
    Replies: 1
    Last Post: 26th September 2009, 05:31
  2. Graphics View: Drawing Items that don't scale
    By Disperato in forum Qt Programming
    Replies: 5
    Last Post: 6th July 2009, 17:16
  3. Graphics View Queries
    By linuxdev in forum Qt Programming
    Replies: 13
    Last Post: 7th January 2009, 09:44
  4. Ignoring scaling graphics view/scale
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 17:44
  5. Automatic scroll in graphics view
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 18th November 2006, 14:07

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.