Results 1 to 3 of 3

Thread: QGraphicsScene auto expanding.

  1. #1
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsScene auto expanding.

    Hi everyone,
    I have following problem. I am creating program that allows to make network schematics. It is based on QGraphicsScene and QGraphicsItem as network nodes. I'm creating QGraphicsScene with some default size, let's say 800x600. However in case of huge diagrams I need to expand QGraphicScene in order to be able to put so many network nodes as I want to. Is there any simple way to do it, for instance by using scrollbars in order to expand scene into infinity?

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsScene auto expanding.

    You don't have to set the size of the scene; it automatically expands when new items are added to it.

    Infinity, of course, is not an option. Computers are finite.

    The GraphicsView itself is derived from a scroll area, and you automatically get scrollbars with it. You can adjust their behavior - whether they're always there, never there or there only when the scene exceeds the view - through the view's settings.

  3. #3
    Join Date
    Jun 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsScene auto expanding.

    Thanks for help. Actually what I was looking for was method QGraphicsScene:setSceneRect() which allows to change scene size. Mayby I didn't precise my question enough

Similar Threads

  1. How to expanding the layout?
    By Kode.Cooper in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 14:24
  2. [QGraphicsView] Auto adjusting QGraphicsScene
    By Macok in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2009, 22:31
  3. Expanding QTextEdit
    By gruszczy in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2009, 04:22
  4. Expanding QLabel
    By mullwaden in forum Qt Programming
    Replies: 1
    Last Post: 15th November 2008, 08:08
  5. auto expanding widgets
    By bpetty in forum Qt Programming
    Replies: 1
    Last Post: 6th January 2007, 08:57

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.