Solved QGridelayout, align with missing column?
-
Hi,
I want to create a really simple button UI, 2 on the top row and one on the bottom row. Is there anyway to use one widget to contain them all, and set a grid layout for that?
current code -ctrlPanelLay.addWidget(_play, 0,0); ctrlPanelLay.addWidget(_stop, 0,1); ctrlPanelLay.addWidget(exitButton, 1,0);
When using the grid layout, I get
But what I want is
Is this some alignment issue?
-
You need to set the columnSpan to 2 for you last element, and then set alignment to horizontal center I guess.
trlPanelLay.addWidget(exitButton, 1,0, 1, 2, Qt::AlignHCenter);
-
@Gojir4 Like a charm, thanks!