Results 1 to 7 of 7

Thread: How to render QGraphicsScene/View to FullScreen??

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question How to render QGraphicsScene/View to FullScreen??

    Dear All,
    I have searched the forums and unable to find much info on this one.
    I have added a QGraphicsPixmapItem to QGraphicsscene which is set to QGraphicsView. But by using default scene size or setSceneRect im not able to set my scene to full screen. I have even tried with showFullScreen, showMaximized.

    My class structure:
    Main.cpp --- creating app..
    Mercury.cpp -- child of QDialog, creating dialog window here (setting this as parent) and showing scene in the same window. Till now im able to achieve 3/4th of screen and rest i see scrollbar popping up. Even after disabling scrollbar im unable to get scene fullscreen.

    Please provide hints on working thorugh this.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to render QGraphicsScene/View to FullScreen??

    Full screen for what ? The scene, the view or the item ?

    You will need to show view in full screen. Then you can use QGraphicsView::fitInView to show the item in max area.

  3. #3
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to render QGraphicsScene/View to FullScreen??

    Thanks for the reply. I need to render QGraphicsscene to fullscreen. I have been able to set 3/4th of screen on trying showFullScreen, showMaximized etc. Please tell me how can i ensure that scene is shown fullscreen.?
    Last edited by animator; 25th June 2010 at 07:18.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to render QGraphicsScene/View to FullScreen??

    Try this -
    Use QGraphicsView::setSceneRect to set the scene area and then show the view in full screen.

  5. #5
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to render QGraphicsScene/View to FullScreen??

    Thanks again aamer. But it sets scene to say some 3/4th fullscreen and shows scrollbars if it is bigger. I tried setting scrollbars off but even then screen is 3/4th but navigation happens within that and not extending to fullscreen. Please let me know if anything can be done with this.

  6. #6
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: How to render QGraphicsScene/View to FullScreen??

    Please let me know if anybody has solution for this.

  7. #7
    Join Date
    May 2010
    Posts
    19
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: How to render QGraphicsScene/View to FullScreen??

    myScene->setSceneRect(myScene->itemsBoundingRect());
    myView->setSceneRect(myScene->sceneRect());

  8. The following user says thank you to Tito for this useful post:

    Aruz (26th August 2012)

Similar Threads

  1. Replies: 8
    Last Post: 7th November 2012, 19:20
  2. QGLWidget inside QGraphicsScene/View
    By h123 in forum Qt Programming
    Replies: 3
    Last Post: 10th January 2009, 08:46
  3. QGraphicsScene render thread
    By nicolas1 in forum Qt Programming
    Replies: 7
    Last Post: 26th October 2008, 12:57
  4. QGraphicsScene render() crashes
    By iebele in forum Qt Programming
    Replies: 0
    Last Post: 29th April 2008, 13:38
  5. Working with coordinates (QGraphicsScene/view)
    By maverick_pol in forum Qt Programming
    Replies: 5
    Last Post: 27th March 2008, 08:35

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.