Results 1 to 5 of 5

Thread: Layout with internal frames

  1. #1
    Join Date
    Aug 2010
    Posts
    65
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Layout with internal frames

    I am trying to create a table of sorts within my application that displays various bits of information. However, I can't figure out how to make each "cell" have a frame around it using QLayout and its children.

    I've been using QGridLayout and it works quite well to create the table itself, but it has no support (as far as I can tell) for frames enclosing all its children. I've thought of wrapping each child in a QFrame and then making the QFrames the children of QGridLayout, but that seems quite overly complex.

    Is there some layout class with support for such things? I've looked into QGroupBox, but to my understanding it is a unidimensional layout (either horizontal or vertical) and is thus not practical to display a table.

    Any hints?

  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: Layout with internal frames

    Layouts are by definition invisible, they are space managers, not visual items. If you want a grid, you need to have something that draws it.
    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.


  3. #3
    Join Date
    Aug 2010
    Posts
    65
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Layout with internal frames

    Of that much I am aware. My question thus becomes "what visual item can perform such a task?"

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Layout with internal frames

    You can probably create a custom layout class that draws borders.

    Otherwise, I would do what you already suggested, put each item in a frame.

    Or, use QTableView or similar.

  5. #5
    Join Date
    Aug 2010
    Posts
    65
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Layout with internal frames

    Thanks for the hint. QTableView wasn't what I was looking for since I need to have some widgets in the middle of the table (QCheckBox'es and such), but I found QTableWidget on its documentation page, and it is almost perfect for my needs.

    Many thanks!
    Last edited by Wasabi; 10th November 2010 at 14:02.

Similar Threads

  1. QML How to use Ractangles as Frames for Images
    By Zschneidi in forum Newbie
    Replies: 0
    Last Post: 16th March 2010, 18:35
  2. Move Frames
    By Slewman in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2009, 14:03
  3. Frames connection
    By cuios in forum Newbie
    Replies: 6
    Last Post: 23rd March 2009, 18:08
  4. Display frames
    By bmn in forum Qt Programming
    Replies: 1
    Last Post: 30th April 2008, 10:26
  5. Resizable Frames/Layouts
    By VireX in forum Newbie
    Replies: 19
    Last Post: 19th March 2007, 00:59

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.