int i = ui->tableWidget->currentIndex().column(); //当我点击某一列就对某一列排序ui->tableWidget->sortByColumn(i,Qt::DescendingOrder);