1、插入一行
QTableWidget->setRowCount(QTableWidget->rowCount()+1);
2、设置多列
QTableWidget->setColumnCount(2);
3、设置表头
QStringList hearder;
hearder << "文件名" << "进度";
QTableWidget->setHorizontalHeaderLabels(hearder);
4、设置自动填充宽度
QTableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
5、设置默认列宽
QTableWidget->horizontalHeader()->setDefaultSectionSize(150);
6、设置默认行高
QTableWidget->verticalHeader()->setDefaultSectionSize(25);
7、隐藏列表序列
QTableWidget->verticalHeader()->setVisible(false);
8、为单元格添加内容
QTableWidget->setItem(QTableWidget->rowCount()-1, 0, new QTable