我想要一个QTextEdit
and QPushButton
in a QBoxLayout
,其中按钮需要的大小尽可能小,其余的都是 textedit 。
到目前为止,我想出了这个。
QPushButton* button = new QPushButton();
button->setText("Button");
QTextEdit* textedit = new QTextEdit();
QBoxLayout* boxLayout = new QBoxLayout(QBoxLayout::TopToBottom);
boxLayout->addWidget(textedit, 0, Qt::AlignTop);
boxLayout->addWidget(button, 0, Qt::AlignLeading);
mUI->centralWidget->setLayout(boxLayout);
textedit 和按钮之间仍然有一个填充。我怎样才能删除它?