删除单元格

时间:2018-01-29 14:56:38

标签: c++ qt qtableview qgroupbox

我在QGroupBox单元格内有一个QTableViewQGroupBoxQHBoxLayout组成,其中包含两个QRadioButton

我在布局和组合框上尝试过setContentsMargins,但顶部似乎总是有一个边距/空格。

enter image description here

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 );

0 个答案:

没有答案