Noob question on PyQt and Qt

D

dusty

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?
 
P

Phil Thompson

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
 
D

dusty

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

Thanks Phil.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top