Qt5以上QtableWiget的自适应列宽的设置

ui-> tableWidget->horizontalHeader()->setSectionResizeMode( 0, QHeaderView:: Stretch);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Stretch);
ui->tableWidget->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);

你可能感兴趣的:(Qt5以上QtableWiget的自适应列宽的设置)