Results 1 to 2 of 2

Thread: empty space in QGridLayout

  1. #1
    Join Date
    Nov 2006
    Posts
    96

    Default empty space in QGridLayout

    Hi:

    Qt Code:
    1. QSpacerItem *space = new QSpacerItem(1,1);
    2.  
    3. /* layouts */
    4. QGridLayout *sessionLayout = new QGridLayout();
    5. sessionLayout->addWidget(hostLabel, 0, 0);
    6. sessionLayout->addWidget(hostText, 0, 1);
    7. sessionLayout->addWidget(portLabel, 1, 0);
    8. sessionLayout->addWidget(portText, 1, 1);
    9. sessionLayout->addWidget(connectButton, 2, 0);
    10. sessionLayout->addWidget(closeButton, 2, 1);
    To copy to clipboard, switch view to plain text mode 

    What I want to do is this:
    - I have 4 rows and 3 columns
    - I need 5 rows and 4 columns where the last line + column consist of empty spaces (as big as other rows/columns)

    - the problem is I don't know how to do it with QSpaceItem...I added it to sessionLayout with QGridLayout::addItem() but the problem is the size...

    so any other idea how to do this efficiently?
    Last edited by eleanor; 4th July 2008 at 01:49.

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: empty space in QGridLayout

    How about you create 2 QSpacerItems with different policies for row and for column and use addLayoutItem method?
    I'm a rebel in the S.D.G.

Similar Threads

  1. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11
  2. QTableWidget click in empty space results in error?
    By Giel Peters in forum Qt Programming
    Replies: 4
    Last Post: 21st January 2006, 00:07

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
  •  
Qt is a trademark of The Qt Company.