Results 1 to 3 of 3

Thread: How can I stop expanding a QGraphicsScene?

  1. #1
    Join Date
    Aug 2009
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default How can I stop expanding a QGraphicsScene?

    Hi

    I am working with QGraphicsView and QGraphicsScene and I want to have a fixed size for the scene without scrollbars, and my widgets from the scene not disappear when the widgets are moved outside the graphicsView. The widgets should stay inside the graphicsView.
    Is there any simple way to do it?

    Thank you very much for helping!

  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: How can I stop expanding a QGraphicsScene?

    Yes, you posted this earlier.

    Is there something wrong with your original post? It's only a few posts below this one.

  3. #3
    Join Date
    Oct 2010
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How can I stop expanding a QGraphicsScene?

    self.view.setHorizontalScrollBarPolicy(QtCore.Qt.S crollBarAlwaysOff)
    self.view.setVerticalScrollBarPolicy(QtCore.Qt.Scr ollBarAlwaysOff)
    self.view.setAlignment(QtCore.Qt.AlignLeft|QtCore. Qt.AlignTop)
    self.adjustSize()

    That's PySide but it should work in C++. Self is the parent window.

Similar Threads

  1. QGraphicsScene auto expanding.
    By miqqo in forum Qt Programming
    Replies: 2
    Last Post: 7th July 2010, 21:56
  2. How to expanding the layout?
    By Kode.Cooper in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 14:24
  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. expanding/shrinking issues.
    By Preeteesh in forum Qt Programming
    Replies: 5
    Last Post: 16th June 2007, 21:27

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.