QStringList list;
list<<"Channel";
for(int i =0;i < GlobalObject::mimoModel->tx;i++)
{
list<<QString::number(i+1);
// ui->tx_table->setItem(i+1,2,new QTableWidgetItem(i-1));
}
// ui->tx_table->setItem(0,0,new QTableWidgetItem("Channel"));
ui->tx_table->setHorizontalHeaderLabels(list);
QHeaderView* headerView = ui->tx_table->verticalHeader();//通过垂直方向的标题,消除第一行第一列的空格问题
headerView->setHidden(true); //行名隐藏
ui->tx_table->setSelectionBehavior(QAbstractItemView::SelectRows);
ui->tx_table->setSelectionMode(QAbstractItemView::SingleSelection);
ui->tx_table->setEditTriggers(QAbstractItemView::NoEditTriggers);
QT tableWigdet第一行第一列的问题
最新推荐文章于 2024-01-29 14:53:22 发布