Qt UI 布局

关于UI 的一些小布局:

#include "QGridLayout"
#include "QHBoxLayout"

    QGridLayout *gridLayout = new QGridLayout;
    gridLayout->addWidget(valueLine,0,0,1,3);//起始(3行,0列),尺寸(1行,3列)
    gridLayout->addWidget(bt_1,1,0);
    gridLayout->addWidget(bt_2,1,1);
    gridLayout->addWidget(bt_3,1,2);
	......
	......
	......
	//mainLayout布局设置(水平布局)
    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->addLayout(gridLayout);
    setLayout(mainLayout);  
    效果图如下:
	


你可能感兴趣的:(Linux,qt,布局)