Results 1 to 4 of 4

Thread: window sizes changing even though max size defined

  1. #1
    Join Date
    Jan 2007
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default window sizes changing even though max size defined

    Hi all,

    I have two questions, the title referring to the first one:

    I have defined my mainwindow to have a max size, but when I show a qgraphicsview inside the mainwindow (which is defined to be a certain size) then the window gets bigger...the buttons surrounding the qgraphicsview don't shrink, but instead the mainwindow gets bigger...any clues as to why this happens and everything isn't just scrunched into the main window? How does it override the mainwindow max size setting?

    Thanks in advance!

    Jonathan

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: window sizes changing even though max size defined

    This can be done by adding a few layouts in there and by setting minimum sizes for the buttons and also size policies for them.

    But I cannot tell you exactly what to do, since I don't know your main window configuration(what it looks like).

    Maybe you can post the UI, or the code that creates the UI. If it is compilable, even better.

    Regards

  3. #3
    Join Date
    Jan 2007
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: window sizes changing even though max size defined

    my main window is made in designer and I have set the max height to 768 therein.

    For there I then have a gridlayoutA which divides the window into two areas, the left being the viewport of the qgraphicsscene and the right being the button area. All the button groups have their own layout and are added to another gridlayoutB which is within the gridlayoutA (second column). When more buttons are dynamically added to one of the layouts on the right, the max window size keeps the window at that size and buttons are squashed together. If I click the "toggle minimap" button, a mini viewport (qgraphicsscene) pops up on the right and makes the window bigger....is there some setting for qgraphicsscene to not override the main window max height?

    Thanks!


    Link to picture of program:

    http://www.qtcentre.org/forum/attach...6&d=1184328369

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: window sizes changing even though max size defined

    No, there is no such setting.
    It all has to do with the layouts from the right side.
    They could be set to shrink when you add a new widget( a new view ).
    I guess you could play with that a bit.

    Another thing: don't use grid layouts if you don't need to. QHBoxLayout or QVBoxLayout are OK.

    Regards

Similar Threads

  1. Replies: 1
    Last Post: 9th February 2007, 09:41

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.