//[1]
QTableWidgetItem* pItem = new QTableWidgetItem();
pItem->setData(Qt::EditRole, 1);
ui.tableWidget->setItem(0, 0, pItem);
//[2]
pItem = new QTableWidgetItem();
pItem->setData(Qt::EditRole, 100);
ui.tableWidget->setItem(1, 0, pItem);
//[2]
pItem = new QTableWidgetItem();
pItem->setData(Qt::EditRole, 2);
ui.tableWidget->setItem(2, 0, pItem);
ui.tableWidget->sortByColumn(0, Qt::SortOrder::AscendingOrder);
QTableWidget某列按整型数据排序
最新推荐文章于 2024-08-14 17:30:40 发布