View Single Post
Old 08-16-2014, 10:38 AM   #5
dundo
Junior Member
dundo began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Aug 2014
Device: Kindle 4
Quote:
Originally Posted by jackie_w View Post
if widget == 'QPushButton':
button = QPushButton()
elif widget == 'QCheckBox':
button = QCheckBox()

You can also do: button = eval(widget + '()')

dundo is offline   Reply With Quote