Pass in the actual classes rather than strings, like this
Code:
def create_groupbox(self, lvalues, widget=QPushButton):
button = widget()
and if you want to test whether something is a push button, do this
Code:
if isinstance(button, QPushButton):
# is a QPushButton
elif isinstance(button, QCheckBox):
# is a check box