pyqt的元类冲突

时间:2019-07-14 03:05:17

标签: python pyqt metaclass

我想实现一个抽象类,它是QLabel的子类。

代码是:

from PyQt5.QtWidgets import *

from abc import ABCMeta

class myLabel(QLabel, metaclass=ABCMeta):

    pass

a = myLabel()

发生错误:

TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

0 个答案:

没有答案