Results 1 to 3 of 3

Thread: Size proportions of widgets in QSplitter

  1. #1
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Size proportions of widgets in QSplitter

    Hello,
    I have some problems with the proper resizing of widgets in QSplitter.
    As you can see in the small screenshot I attached there is a textEdit in the upper half of the splitter. A button and a second textEdit are in the lower half. These are layouted in a gridLayout.
    What I am trying to achieve is to make the upper smaller than the lower part of the splitter. Let's say: the upper textEdit about 1/3 of the vertical space and the button + second textEdit the rest of 2/3 of the space.

    I played around the the sizePolicies of both textEdits but without success. I also tried to give a maxHeight for the upper textEdit but this only produces some completely unused space in the dialog.

    Any idea? No matter if this can be achieved inside Qt Designer or by manual coding.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Join Date
    Nov 2008
    Location
    Częstochowa/Poland
    Posts
    50
    Thanks
    2
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Size proportions of widgets in QSplitter

    void QSplitter::setSizes ( const QList<int> & list )

    Sets the child widgets respective sizes to the values given in the list.
    Me, Grimlock, not "nice dino". ME BASH BRAINS!

  3. #3
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    229
    Thanks
    2
    Thanked 29 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Size proportions of widgets in QSplitter

    Thanks for the inspiration. I used setStretchFactor(...) now which can handle "proportions" and not sizes directly.

Similar Threads

  1. resizing widgets depending on a main widget size
    By luf in forum Qt Programming
    Replies: 6
    Last Post: 10th October 2009, 16:13
  2. How to remove widgets from QSplitter?
    By mcb in forum Qt Programming
    Replies: 2
    Last Post: 23rd July 2009, 06:10
  3. Replies: 1
    Last Post: 27th March 2008, 15:10
  4. How to set Widgets sizes with in QSplitter
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 07:38
  5. Replies: 4
    Last Post: 10th December 2006, 09:04

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.