水平布局:QHBoxLayout(所有控件都在一行水平摆放,并且无法设置控件的垂直方向上的对齐方式,只可以设置其水平方向上的对齐方式)
void setupUi(QWidget *parent)
{
QPushButton *pushButton_1= new QPushButton(parent);
pushButton_1->setText("1");
QPushButton *pushButton_2= new QPushButton(parent);
pushButton_2->setText("2");
QPushButton *pushButton_3= new QPushButton(parent);
pushButton_3->setText("3");
QPushButton *pushButton_4= new QPushButton(parent);
pushButton_4->setText("4");
QPushButton *pushButton_5= new QPushButton(parent);
pushButton_5->setText("5");
QPushButton *pushButton_6= new QPushButton(parent);
pushButton_6->setText("6");
QHBoxLayout* horizontalLayout = new QHBoxLayout(parent);
horizontalLayout->setSpacing(10);
horizontalLayout->setContentsMargins(4, 4, 4, 4);
horizontalLayout->addWidget(pushButt