<HTML>
<HEAD>
<TITLE>Re: [PyQt] example</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>If you are using a ListWidget, you can add a checkbox as follows:<BR>
<BR>
item = QtGui.QListWidgetItem(text)<BR>
item.setCheckState(QtCore.Qt.Checked)<BR>
item.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsUserCheckable |<BR>
QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsEnabled )<BR>
<BR>
<BR>
It is slightly more complicated when using your own model, you have to implement the CheckStateRole in the data and setdata methods.<BR>
<BR>
I.e. In data, return Qt.Checked or Unchecked when returning the CheckStateRole for an index.<BR>
<BR>
Brian<BR>
<BR>
On 3/2/09 12:48 AM, "Milan Hemžal" <<a href="001g@email.cz">001g@email.cz</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
<BR>
pls., do you have nobody example, howto create and use checkbox in listview?<BR>
<BR>
Thank's<BR>
<BR>
Milan<BR>
_______________________________________________<BR>
PyQt mailing list <a href="PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><BR>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><BR>
<BR>
</SPAN></FONT></BLOCKQUOTE>
</BODY>
</HTML>