Create a QVBoxLayout, then add two QHBoxLayouts to it. In the upper part of QHBoxLayout add shortcuts, at the bottom remove the stretch, button, stretch.
example window http://img196.imageshack.us/img196/545/86911694.png
#include <QString> #include <QApplication> #include <QWidget> #include <QPushButton> #include <QVBoxLayout> #include <QHBoxLayout> #include <QLabel> #include <QLocale> int main(int argc, char** argv){ QApplication app(argc, argv); QWidget widget; QVBoxLayout* vLayout = new QVBoxLayout(&widget); QHBoxLayout* topLayout = new QHBoxLayout(); QHBoxLayout* bottomLayout = new QHBoxLayout(); QLabel* label1 = new QLabel(QObject::tr("Label1")); QLabel* label2 = new QLabel(QObject::tr("Label2")); label1->setAlignment(Qt::AlignCenter); label2->setAlignment(Qt::AlignCenter); QPushButton* btn1 = new QPushButton(QObject::tr("The Button!!!!")); topLayout->addWidget(label1); topLayout->addWidget(label2); bottomLayout->addStretch(); bottomLayout->addWidget(btn1); bottomLayout->addStretch(); vLayout->addLayout(topLayout); vLayout->addLayout(bottomLayout); widget.show(); return app.exec(); }
source share