Python, mixing PyQt5 and abc.ABCMeta

后端 未结 2 787
攒了一身酷
攒了一身酷 2020-12-22 08:15

I am trying to create an AbstractClass using both abc.ABCMeta and QObject as parents and cannot seems to make it work.

Here is the Base class init. I have Pyqt5 and

2条回答
  •  青春惊慌失措
    2020-12-22 08:48

    abc.ABCMeta is supposed to be used as a metaclass. So instead of extending it, try:

    class ParamsHandler(pyqtWrapperType):
        __metaclass__ = abc.ABCMeta
    

提交回复
热议问题