Hi guys,
I have a QTableWidget with checkboxes in the 1st column. I have a button to 'select all' which is implemented,
for(int i = 0; i < tableWidget->rowCount(); i++) {
twi->setCheckState(Qt::Checked);
}
for(int i = 0; i < tableWidget->rowCount(); i++) {
QTableWidgetItem *twi = tableWidget->item(i, 0);
twi->setCheckState(Qt::Checked);
}
To copy to clipboard, switch view to plain text mode
I'm finding that the 1st checkbox in my table doesnt get properly updated. (Subsequently checking on another row cause it to be displayed properly). I tried calling
tableWidget->repaint
tableWidget->repaint
To copy to clipboard, switch view to plain text mode
afterwards but this doesnt fix my problem.
I'm sure I'm doing something dumb, (1/2 asleep due to new baby), any help appreciated.
Cheers,
Chris.
Added after 22 minutes:
Answering my own questions.
Theres a bug in Qt http://bugreports.qt.nokia.com/browse/QTBUG-5042
To resolve I call
tableWidget->verticalHeader()->show();
tableWidget->verticalHeader()->hide();
tableWidget->verticalHeader()->show();
tableWidget->verticalHeader()->hide();
To copy to clipboard, switch view to plain text mode
Bookmarks