Results 1 to 2 of 2

Thread: QSplitter in Designer

  1. #1
    Join Date
    Nov 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QSplitter in Designer

    Hello,

    I have a QSplitter (horizontal), that contains 2 QListWidgets. Now I want that the first (left) QListWidgets gets ALL the space if the Window is resized (the user still should be able to resize per splitter).
    In code I can do this easily by calling:
    splitter->setStretchFactor(0, 1);

    But is it possible to do this (setting stretch factors if a QSplitter) in Qt Designer? I haven't found this property in Qt Designer.

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSplitter in Designer

    It isn't a property of QSplitter. From the setStretchFactor() docs:
    This function is provided for convenience. It is equivalent to
    Qt Code:
    1. QWidget *widget = splitter->widget(index);
    2. QSizePolicy policy = widget->sizePolicy();
    3. policy.setHorizontalStretch(stretch);
    4. policy.setVerticalStretch(stretch);
    5. widget->setSizePolicy(policy);
    To copy to clipboard, switch view to plain text mode 
    This means you'll have to set the properties of the relevant widgets, rather than on the splitter.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Bug in QSplitter with Qt4.5.1
    By araglin in forum Qt Programming
    Replies: 1
    Last Post: 28th April 2009, 07:45
  2. QSplitter
    By weixj2003ld in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2009, 13:46
  3. QSplitter in Designer
    By Boron in forum Qt Tools
    Replies: 2
    Last Post: 21st July 2008, 18:34
  4. New to QSplitter
    By bruccutler in forum Qt Programming
    Replies: 6
    Last Post: 6th September 2007, 16:43
  5. QSplitter
    By Solarity in forum Newbie
    Replies: 2
    Last Post: 10th February 2006, 17:05

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.