PDA

View Full Version : stitch 4 QSpinBox without margin ?



divide
12th March 2010, 19:33
Hello,

I try to stitch 4 QSpinBox using the following code:

QWidget* w = new QWidget();
QGridLayout* grid = new QGridLayout(w);
grid->setMargin(0);
grid->addWidget(new QSpinBox(), 1, 1);
grid->addWidget(new QSpinBox(), 1, 2);
grid->addWidget(new QSpinBox(), 2, 1);
grid->addWidget(new QSpinBox(), 2, 2);

However, I get this:
http://uppix.net/9/4/5/1af3f664053c00c1bb00c64c671e4.jpg (http://uppix.net/9/4/5/1af3f664053c00c1bb00c64c671e4.html)

So there's still a 5/6 pixels margin between SpinBox I want to get rid off... Any way to do this ?

Lykurg
12th March 2010, 20:22
Hi,

please use the [code] tags next time and also add the images at the board and not on a 3rd party site. This is to keep the posts consistent a long time.

As for your problem have a look at QGridLayout::setSpacing().

Lykurg

divide
12th March 2010, 20:52
ok :)

thanks !