PDA

View Full Version : Spanned Item Spacing on Empty Columns



giverson
19th March 2007, 20:46
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...

wysota
19th March 2007, 22:10
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.