Results 1 to 3 of 3

Thread: Dealing with Layout expanding size

  1. #1
    Join Date
    Jul 2011
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Dealing with Layout expanding size

    Hello everybody,

    Yes, I am dealing with the resize of my Layout. Basically, this it the situation:
    I have a main window with no docking widgets. As main widget, a normal widget with a single vertical Layout and inside this two horizontal Layouts. So, we have two Layouts, one called "top" and another one called "bottom".
    Inside the top, I have a QGraphicsView.
    Inside the bottom I have a QToolBox to the left and a QTextEdit to the right.

    When the program starts, the size looks quite good for the QGraphicsView without showing any scene, but because I want to display different scenes at different times, as soon as I display the first one, the top layout (and of course the view) get expanded down, and pushes down the toolbox, what looks horrible.

    What I want is to keep a fixed size for the top Layout, which means that I don't want the view get expanded when I set a scene inside.

    I tried several things to get it done, but without success. When I get something good looking on one side, it gets wrong on the other.
    I do not use constant values in setting positions on the screen.
    Any idea would be appreciated, thx in advance.
    Last edited by edxxgardo; 16th August 2011 at 08:49.

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Dealing with Layout expanding size

    What exactly you tried? I think calling setFixedSize (or height) on graphics view should should solve your problem.

  3. #3
    Join Date
    Jul 2011
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Dealing with Layout expanding size

    Hi nish,

    your suggestion helps, thanks a lot dude.
    I tried with setPolicySize with different configuration but I couldn't manage to keep the view with fixed size, it expanded all the times. My fault was probably that, because I don't want to use constant values in sizes, the view expanded every time. Anyway, good suggestion and thx again for your help.

Similar Threads

  1. Replies: 6
    Last Post: 14th March 2018, 20:25
  2. Replies: 1
    Last Post: 20th May 2011, 17:36
  3. How to expanding the layout?
    By Kode.Cooper in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 14:24
  4. Expanding QToolButton size
    By kodiak in forum Qt Programming
    Replies: 2
    Last Post: 4th June 2009, 07:17
  5. Can I insert expanding layout in Qt Designer?
    By zolookas in forum Newbie
    Replies: 2
    Last Post: 6th October 2008, 18:17

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.