Results 1 to 2 of 2

Thread: Spanned Item Spacing on Empty Columns

  1. #1
    Join Date
    Feb 2007
    Posts
    16
    Thanks
    1
    Platforms
    Windows

    Default Spanned Item Spacing on Empty Columns

    Using the following code,

    " QLabel* id_field[4];
    id_field[0] = new QLabel("Search Fields");
    id_field[1] = new QLabel("Comparison");
    id_field[2] = new QLabel("Value(s)");
    id_field[3] = new QLabel("Combination");
    id_field[4] = new QLabel("Adv Combinations");

    m_Layout->setSpacing(0);

    m_CombinationField = new QLineEdit();

    m_Layout->addWidget(id_field[0],0,0);
    m_Layout->addWidget(id_field[1],0,15);
    m_Layout->addWidget(id_field[2],0,16);
    m_Layout->addWidget(id_field[3],0,18);

    //m_Layout->addWidget(id_field[4],47,0);
    m_Layout->addWidget(m_CombinationField, 48, 0, 1, 19);
    //m_Layout->addWidget(m_CombinationField, 48, 0, 1, 2);

    m_SearchArea->setLayout( m_Layout );
    "

    I'm trying to span a QLineEdit across the majority of a 20 column QGridLayout. However, when I do this, it tries to apply QLayout's spacing on each one of the empty columns whereas they previously would not display. This is resulting in huge gaps in my display. To test this, I set my spacing to 0 and this problem disapeared but this is not an ideal solution.

    What I'm looking for is a way to disable inter-column spacing on a QLineEdit across a span so it treats those empty columns as if they weren't even there while still lining up the LineEdit with the outer edges of my 0 and 18 index columns.

    Pictures of the problem included as an attachment...
    Attached Images Attached Images

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

    Default Re: Spanned Item Spacing on Empty Columns

    I'm not sure what the exact problem is but maybe the solution would be to use a separate horizontal layout for those lined up widgets and then place it as a nested layout inside the grid or even a vertical layout.

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

    giverson (20th March 2007)

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.