|
1Qter豆
先贴代码
#include "form.h"
#include "ui_form.h"
Form::Form(QWidget *parent) :
QWidget(parent),
ui(new Ui::Form)
{
StaticLists = new QVBoxLayout();
Hlayout = new QHBoxLayout();
layoutBox = new QVBoxLayout();
layoutBox->addItem(Hlayout);
layoutBox->addItem(StaticLists);
this->setLayout(layoutBox);
this->show();
}
Form::~Form()
{
delete ui;
}
void Form::AddItemds(){
FriendButton = new QPushButton("Friend");
GroundButton = new QPushButton("Ground");
Hlayout->addWidget(FriendButton);
Hlayout->addWidget(GroundButton);
}
类似这个类里,我自己手动调用AddItemds时,没有显示2个button,这个为什么?求高手指明!!!!
|
最佳答案
查看完整内容
layoutBox->addItem(Hlayout);
应该是 addLayout吧
|