Noob question on PyQt and Qt

Phil Thompson phil at riverbankcomputing.co.uk
Sun Aug 1 14:32:10 EDT 2004


On Sunday 01 August 2004 6:42 pm, dusty wrote:
> I am learning Python and Qt designer (using eric3). I'm writing an app
> using QCheckList and have succeeded in loading parent and children,
> with checkboxes, with data from a file.  I want to programmatically
> check some boxes depending on the string from the list.
>
> This is the code that I use to create the checkbox's:
>  ~~~
>   d = QCheckListItem(it, lstI[g:], QCheckListItem.CheckBox)
>   self.childlist1.append(d)
>  ~~~
> The first char in each line in 'lstI' determines if the checkbox
> should be checked or not.
> How do I change the checkbox to 'On' (checked) in Python code when the
> checkbox is created?

Use the setOn() method.

Phil



More information about the Python-list mailing list