Results 1 to 3 of 3

Thread: Automatic reestructuring of elements of a grid layout

  1. #1
    Join Date
    Jul 2015
    Posts
    52
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Automatic reestructuring of elements of a grid layout

    I have a QGroupBox which contains many QCheckboxes. I use a QVBoxLayout to place them, but I would like the layout to place the QCheckboxes in a grid fashion, adapting the number of columns to the horizontal space available.


    Do I have to code the behaviour myself or is there a layout that does that automatically?

    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Automatic reestructuring of elements of a grid layout

    Sounds like a use case for a flow layout http://doc.qt.io/qt-5/qtwidgets-layo...t-example.html

    Cheers,
    _

  3. #3
    Join Date
    Jul 2015
    Posts
    52
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Automatic reestructuring of elements of a grid layout

    indeed!

    Correct me if I'm wrong, FlowLayout is not part of Qt, right?


    Added after 15 minutes:


    And is there a way to set this layout on QtDesigner?

    Nevermind: http://stackoverflow.com/questions/5...in-qt-designer
    Last edited by quimnuss; 13th January 2016 at 12:30.

Similar Threads

  1. Replies: 2
    Last Post: 14th November 2015, 02:15
  2. Change elements size in a grid
    By asieriko in forum Qt Quick
    Replies: 4
    Last Post: 5th January 2014, 13:23
  3. qdirmodel in grid layout
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 27th July 2008, 09:26
  4. How do I layout in a Grid?
    By DPinLV in forum Qt Tools
    Replies: 7
    Last Post: 10th August 2006, 02:37
  5. Grid layout
    By nupul in forum Qt Programming
    Replies: 7
    Last Post: 21st April 2006, 22:15

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.