Results 1 to 3 of 3

Thread: QSplitter

  1. #1
    Join Date
    Feb 2006
    Location
    Raleigh, NC
    Posts
    16
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default QSplitter

    I was wondering if there is a way to tell the splitter to split the screen 40/60%. It seems to base its size off of its child widgets, however, I'm trying to get my child widgets to size appropriate to the screen size. I'm not sure how to make them dynamic when the screen resizes instead of always use setMinimumWidth/Height etc. I want it to be flexible.

    Also on the right half of the splitter if I don't set the minimum width it will act as if there are no widgets there at all and hides them. I really don't want to have to specify minimumWidths. Maybe I should be using baseSize?
    Last edited by Solarity; 10th February 2006 at 15:46.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSplitter

    I used something like this:
    Qt Code:
    1. QValueList<int> list = splitter->sizes();
    2. int s=list.front()+list.back();
    3. list.front() = s*0.6; list.back() = s*0.4;
    4. splitter->setSizes(list);
    To copy to clipboard, switch view to plain text mode 

    The list manipulation may be a little different -- the main point is to use QSplitter::setSizes().

  3. The following user says thank you to wysota for this useful post:

    Solarity (16th March 2006)

  4. #3
    Join Date
    Feb 2006
    Location
    Raleigh, NC
    Posts
    16
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QSplitter

    Thanks! Good idea.

    It worked. Thanks again.
    Last edited by Solarity; 10th February 2006 at 17:16.

Similar Threads

  1. QSplitter only resize from user input?
    By winston2020 in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2009, 15:50
  2. QSplitter in Designer
    By Boron in forum Qt Tools
    Replies: 2
    Last Post: 21st July 2008, 18:34
  3. Dynamic QSplitter
    By EricF in forum Qt Programming
    Replies: 4
    Last Post: 26th October 2007, 14:59
  4. New to QSplitter
    By bruccutler in forum Qt Programming
    Replies: 6
    Last Post: 6th September 2007, 16:43
  5. How to set Widgets sizes with in QSplitter
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 29th June 2007, 07:38

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.