[PyQt] Help with QTableView

Brian Kelley kelley at eyesopen.com
Fri Jan 25 13:48:25 GMT 2008

in the model's data method:

def data(index, role):
   if role == QtCore.Qt.CheckStateRole:
      return QtCore.Qt.Checked # or UnChecked

Note you can have a checkbox along with the datarole as well.

On Jan 18, 2008, at 12:10 AM, Catriona Johnson wrote:

> Hello
> How do I implement a checkbox in a QTableView column that
> retreives/stores values in a database?
> Also, I have one model with columns say abc and I have two QTableViews
> of this model that show the columns in different orders - bca and cab.
> How do I change the column order in the QTableView?
> Thanks
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

More information about the PyQt mailing list