Results 1 to 2 of 2

Thread: Resize QWidget if QSplitter is collapsed

  1. #1
    Join Date
    May 2011
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Resize QWidget if QSplitter is collapsed

    Hi,
    I have a QSplitter(Qt::Horizontal) -> hsplitter inside a QSplitter(Qt::Vertical) ->rowSplitter

    mainLayout->addWidget(rowSplitter);
    setLayout(mainLayout);

    Now when I programatically collapse hsplitter, I want to resize my widget.
    For example if hsplitter->widget(0) width is "a" and hsplitter->width(1) is "b", on clicking a button,
    I want to collapse widget(0) and resize parent widget to size "b".

    Please help.

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

    Default Re: Resize QWidget if QSplitter is collapsed

    Use QSplitter::setSizes() to resize splitter's children.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QSplitter resize behavior
    By Alundra in forum Qt Programming
    Replies: 0
    Last Post: 5th June 2014, 21:25
  2. How to disable resize in a QWidget
    By aguleo in forum Newbie
    Replies: 2
    Last Post: 17th February 2013, 20:58
  3. Replies: 4
    Last Post: 29th December 2010, 04:07
  4. Replies: 0
    Last Post: 30th March 2010, 14:49
  5. QSplitter only resize from user input?
    By winston2020 in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2009, 15:50

Tags for this Thread

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.