我有一个牢房QGroupBox
里面。QTableView
由包含两个sQGroupBox
的 a 组成。QHBoxLayout
QRadioButton
我已经在布局和组框上尝试了 setContentsMargins,但顶部似乎总是有一个边距/空白。
QGroupBox *widget = new QGroupBox();
QHBoxLayout *layout = new QHBoxLayout(widget);
QRadioButton *wsRadioButton_ = new QRadioButton( this );
QRadioButton *pfRadioButton_ = new QRadioButton( this );
widget->setContentsMargins( 0, 0, 0, 0 );
layout->setContentsMargins( 10, 0, 0, 0 );
layout->addWidget(pfRadioButton_, Qt::AlignCenter);
layout->addWidget(wsRadioButton_, Qt::AlignCenter);
widget->setLayout(layout);
ui_->fsTableView_->setIndexWidget( model_->index( eModelRows::eRS, eModelCols::min ), widget );
ui_->fsTableView_->resizeRowToContents( eModelRows::eRS );