[PyQt] override className() in QMetaClass

Daniel Goertzen daniel.goertzen at gmail.com
Thu Sep 8 22:33:17 BST 2011


Does pyqt provide a way to override the class name when deriving a QObject
based class?

An example of why this is wanted:

def my_widget_class_factory(...):
   class temp(QWidget):
      ...(dynamically generate class attributes and methods)
   return temp

All classes generated by the above function will come back with className()
as "temp".  This causes headaches for Designer.

I know I can add a metaclass to mangle the class name, but I was wondering
there was an easier way (ie, does QObject's metaclass provided a way to
rename the class?)

Thanks,
Dan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110908/baf162d9/attachment.html>


More information about the PyQt mailing list