0

I created a gui in qtdesigner that has many checkboxes: Screenshot http://imgq.tk/img/-2012-07-13%2013:55:07.png

and I would like to know if there is a way to list all the checked boxes using pyside. It would be even better if I could just get the text from each box. The boxes are in a grid layout.

polandeer
  • 396
  • 4
  • 16

1 Answers1

1

Since you're in python, you should be able to introspect on the object and find all its members. But Qt makes this easy in general because of the parent-child relationship. You can query the form (the parent) for its children that are text boxes:

# my python's a bit rusty, but hopefully this is close
checkboxes = [x for x in form.children() where isinstance(x, QCheckBox)]

See the findChildren() and children() methods.

Kaleb Pederson
  • 45,767
  • 19
  • 102
  • 147
  • Could you please help me in this query - http://stackoverflow.com/questions/25164853/how-to-use-findchildren – Ejaz Aug 06 '14 at 19:32