Align widgets to the center in QHBoxLayout
Solved
General and Desktop
-
I am creating a new QHBoxLayout and adding two widgets to this layout. I want them to be beside each other and in the center like the image below.
Currently, they are aligned horizontally but with a lot of space.
auto layout= new QHBoxLayout(this); layout->addWidget(button1, 0, Qt::AlignmentFlag::AlignCenter); layout->addWidget(button2, 0, Qt::AlignmentFlag::AlignCenter);
-