Hi
I am trying to add space b/w rows and column of gridlayout but it is not working.
I have 2*2 gridlayout like the following
layout->setAlignment(Qt::AlignCenter);
layout->addWidget(button_panic, 0, 0);
layout->setHorizontalSpacing(5);
layout->addWidget(button_gas, 0, 1);
layout->setVerticalSpacing(5);
layout->addWidget(button_alarm, 2, 0);
layout->setHorizontalSpacing(5);
layout->addWidget(button_fire, 2, 1);
this->setLayout(layout);
QGridLayout *layout = new QGridLayout;
layout->setAlignment(Qt::AlignCenter);
layout->addWidget(button_panic, 0, 0);
layout->setHorizontalSpacing(5);
layout->addWidget(button_gas, 0, 1);
layout->setVerticalSpacing(5);
layout->addWidget(button_alarm, 2, 0);
layout->setHorizontalSpacing(5);
layout->addWidget(button_fire, 2, 1);
this->setLayout(layout);
To copy to clipboard, switch view to plain text mode
How to add space b/w widgeta laid in layout.
Bookmarks