QTableWidget Sorting
Solved
General and Desktop
-
I have my QWidgetTable sort enabled, however, when I go to sort the column "priority", it counts the 10s as part of the 1s.
if (it.key() == "priority")
{
double val = it.value().toDouble();
QString string = QString(%1).arg(val);
table->setItem(row, 3, new QtableWidgetItem(string);
} -
Because you set a QString, not an integer. Use setData() and set the integer instead a QString.