Results 1 to 3 of 3

Thread: splitter

  1. #1
    Join Date
    Nov 2006
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default splitter

    Hi all,
    I have to use Qt Designer but I'm not very familiar with such tool.

    I inserted an horizontal splitter between a QStackedWidget (left) and a QFrame (right). I would like to have the following behavior. When I resize my window horizontally the right QFrame only must be enlarged while the left one must be fixed size. Anyway the user can resize both QStackedWidget and QFrame moving the splitter bar.

    Can you suggest the settings to have this behavior, please?

    Gianni

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: splitter

    Try setting appropriate stretch factors through QSplitter::setStretchFactor().
    Notice the example code in the docs. You could set a fixed size policy (QSizePolicy::Fixed) in the direction you want.
    J-P Nurmi

  3. #3
    Join Date
    Nov 2006
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: splitter

    Thanks for the reply but unfortunately I have to work with QT Designer (at least for the moment). This means that the GUI file (.h) is auto-generated and it doesn't make much sense change that code. Moreover I don't like to modify the GUI settings from a derived class. So, I would like to understand how to set splitter parameters directly in QT Designer.

    I tried as follows.

    Left widget:
    - sizePolicy
    --- hSizeType = Fixed
    --- vSizeType = Fixed
    --- horizontalStretch = 0
    --- verticalStretch = 0
    - minimumSize [150, 200]
    - maximumSize [16777215, 16777215]
    - sizeIncrement [0, 0]
    - baseSize [150, 200]

    Right frame:
    - sizePolicy
    --- hSizeType = MinimumExpanding
    --- vSizeType = Fixed
    --- horizontalStretch = 10
    --- verticalStretch = 0
    - minimumSize [500, 450]
    - maximumSize [16777215, 16777215]
    - sizeIncrement [10, 0]
    - baseSize [500, 450]

    Now, if I stretch the window horizontally from the right side, first of all the left widget enlarges. Then after an amount of pixel the left widget stops moving and the right frame starts to enlarge. Honestly I can't explain this behavior.

    Gianni

Similar Threads

  1. Image on Splitter
    By moizahamedv in forum Qt Programming
    Replies: 4
    Last Post: 3rd March 2006, 14:40

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.