If you are using a ListWidget, you can add a checkbox as follows:

        item = QtGui.QListWidgetItem(text)
        item.setCheckState(QtCore.Qt.Checked)
        item.setFlags( QtCore.Qt.ItemIsSelectable | 
QtCore.Qt.ItemIsUserCheckable |
                                  QtCore.Qt.ItemIsEditable | 
QtCore.Qt.ItemIsEnabled )


It is slightly more complicated when using your own model, you have to 
implement the CheckStateRole in the data and setdata methods.

I.e. In data, return Qt.Checked or Unchecked when returning the CheckStateRole 
for an index.

Brian

On 3/2/09 12:48 AM, "Milan Hemžal" <0...@email.cz> wrote:

Hi,

pls., do you have nobody example, howto create and use checkbox in listview?

Thank's

Milan
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to