Jakob Kousholt
2018-11-19 05:54:32 UTC
Hi,
I am trying to add a bunch of buttons and UI elements based of a python
list. My issue is that I would need to refer to them later to see if they
are checked or unchecked. Usually I would assign the button to a variable
and check that specific variable for the state of the checkbox like:
potatoCheckBox = QtWidgets.QCheckBox()
potatoCheckBox.checkState()
But I am not sure how to get about it over a list. of course the code is
not making any sense as you can't add two strings like that together to
assign a variable - big mess, However I think it kinda shows how I would
like to go about it. Using my list as a prefix for a lot of new attributes
on my UI class.
list = ['potato', 'tomato', 'poop']
for obj in list:
obj + CheckBox = QtWidgets.QCheckBox()
potatoCheckBox.checkState()
tomatoCheckBox.checkState()
poopCheckBox.checkState()
Any pointers in the right direction would be much appreciated. Thank you.
Jake
I am trying to add a bunch of buttons and UI elements based of a python
list. My issue is that I would need to refer to them later to see if they
are checked or unchecked. Usually I would assign the button to a variable
and check that specific variable for the state of the checkbox like:
potatoCheckBox = QtWidgets.QCheckBox()
potatoCheckBox.checkState()
But I am not sure how to get about it over a list. of course the code is
not making any sense as you can't add two strings like that together to
assign a variable - big mess, However I think it kinda shows how I would
like to go about it. Using my list as a prefix for a lot of new attributes
on my UI class.
list = ['potato', 'tomato', 'poop']
for obj in list:
obj + CheckBox = QtWidgets.QCheckBox()
potatoCheckBox.checkState()
tomatoCheckBox.checkState()
poopCheckBox.checkState()
Any pointers in the right direction would be much appreciated. Thank you.
Jake
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEKd6bbuUefk%2Bt8rmVT4wt8CVhu6ZBmx6N6pTKQOE%3DOeg1LH1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAEKd6bbuUefk%2Bt8rmVT4wt8CVhu6ZBmx6N6pTKQOE%3DOeg1LH1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.