Results 1 to 3 of 3

Thread: How to collapse rows of a QFormLayout?

  1. #1
    Join Date
    Oct 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to collapse rows of a QFormLayout?

    Hello all,

    I would like to have a the GUI of a dialog box organised as with a QFormLayout, except that I should be able to programmatically collapse/uncollapse specific rows. By collapsing, I mean hiding and resizing to zero height such as to have the next row occupy the space of the collapsed ones. Is there a way to achieve this, with QFormLayout or otherwise?

    TIA,
    Antoine

  2. #2
    Join Date
    Oct 2009
    Posts
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to collapse rows of a QFormLayout?

    just hide/show all the widgets in the row.

    Its better to use horizontal layout, i guess.

    Organize all your rows in separate horizontal layout and based on your condition you can hide or unhide(show) all the widgets you have for that row.
    Don't forget to stack up every thing in vertical layout.

    To have easy way of life in debugging and coding, if you have more than one widget in row embed them into a single widget. This way hiding and show can be done in a simpler way.

    Try with designer to have fell at least, if you don't want to use it.

    I don't know about form layout may be you can do the same thing with that also.

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

    abey (14th December 2009)

  4. #3
    Join Date
    Oct 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to collapse rows of a QFormLayout?

    That indeed works, thanks! I had tried something along those lines before but did not get it quite right. Now it's fine.

Similar Threads

  1. QSqlTableModel inserts empty rows
    By Nesbitt in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 12:47
  2. QTableWidget sorting with hidden rows
    By alex140773 in forum Qt Programming
    Replies: 0
    Last Post: 8th July 2008, 12:35
  3. Removing rows
    By indifference in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2007, 16:54
  4. Replies: 1
    Last Post: 28th September 2006, 06:21
  5. Replies: 6
    Last Post: 5th March 2006, 21: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.