I want to sort the column data in the table but the data is in string format and I want to do in Integer format.

Qt Code:
  1. ID = 0;
  2.  
  3. tbl_item12 = new QTableWidgetItem (QTableWidgetItem (QString::number(ID)));
  4.  
  5. ui->tableWidget->setItem( CurRow,12 ,tbl_item12 );
  6. ui->tableWidget->sortByColumn(12,Qt::DescendingOrder);
  7.  
  8. but I get error on shorting Integer
  9.  
  10. tbl_item13 = new QTableWidgetItem (QTableWidgetItem (ID));
To copy to clipboard, switch view to plain text mode 

Can anyone help me to insert the integer value in column and sort it?

If possible send me the snippets of the code.