Results 1 to 11 of 11

Thread: Is QGraphicsScene::sceneRect the actual size of the scene or is it just a ViewPort

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,315
    Thanks
    314
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Is QGraphicsScene::sceneRect the actual size of the scene or is it just a ViewPor

    What I suggested in a different thread by this poster on the same overall design was that if each page were a separate QGraphicsItem, then these could all be placed in the same scene. If he wants to display only one of the pages in a particular QGraphicsView, then he should set that view's scene rect to match the rect occupied by the item in the scene's scene rect. To display all of the pages in a single view, then the view's scene rect should match the scene's scene rect.

    I think part of the problem is that it looks like he has created all of the items with the same size and position in the QGraphicsScene, instead of following my suggestion to create them with a size of 1/4 the scene rect and position them side-by-side or in a 2 x 2 array. The scene rect should be sized to 4 times the page size, with the actual dimensions depending on the page arrangement.

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

    Default Re: Is QGraphicsScene::sceneRect the actual size of the scene or is it just a ViewPor

    Hmm... I always thought that modifying the view's scene rect modifies the scene's scene rect. Well, I learned something new today
    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. QGraphicsscene.sceneRect on Windows platform
    By sanku3 in forum Qt Programming
    Replies: 0
    Last Post: 26th September 2011, 08:12
  2. QGraphicsScene's sceneRect() doesn't update
    By blooglet in forum Qt Programming
    Replies: 2
    Last Post: 17th February 2011, 09:11
  3. Viewport and scene coordinates
    By aurelius in forum Newbie
    Replies: 2
    Last Post: 30th October 2008, 23:47
  4. How to enlarge sceneRect() to the viewport size
    By iw2nhl in forum Qt Programming
    Replies: 3
    Last Post: 27th August 2007, 16:39
  5. QGraphicsScene: evolution of sceneRect
    By Pieter from Belgium in forum Qt Programming
    Replies: 2
    Last Post: 10th November 2006, 15:11

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.