QT表头拖动
作者:互联网
ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);//表格列宽可拖动
ui->tableWidget->verticalHeader()->setSectionResizeMode(QHeaderView::Interactive);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(1,QHeaderView::ResizeToContents);//单元格根据内容扩充长度
ui->tableWidget->setColumnWidth(1,600); //指定列宽
标签:QHeaderView,QT,拖动,setSectionResizeMode,表头,tableWidget,ui,horizontalHeader,列宽 来源: https://www.cnblogs.com/lllion/p/15735089.html