Is there a way to remove the checkbox from a QTreeWidgetItem?

It is possible to remove the checbox from a QTreeWidgetItem [doc.qt.nokia.com] that has the Qt::ItemIsUserCheckable [doc.qt.nokia.com] flag set, simply by calling setData() [qt.nokia.com] on the item with an invalid QVariant [doc.qt.nokia.com], e.g

  1.     item->setData(0, Qt::CheckStateRole, QVariant());

1 comment

July 26, 2012

Picture of pasomas pasomas

Lab Rat

But…is not valid for a QTableView with QSqlQueryModel ?

  1. model->setData(idxToSet, QVariant(), Qt::CheckStateRole);

Doesn’t seem to work…how can i do?

Write a comment

Sorry, you must be logged in to post a comment.