View Single Post
Old 07-30-2014, 08:11 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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
kovidgoyal is offline   Reply With Quote