TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of t

python类继承冲突问题

关键截图:
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of t_第1张图片
描述:
exa类同时继承了QtWidgets,Ui_MainWindow两个类,但是QtWidgets,Ui_MainWindow这两个类是冲突的,所以会报上述错误。
可以修改为

class exa(QtWidgets.QMainWindow,Ui_MainWindow):
    def __init__(self):
        super(exa, self).__init__()
        self.setupUi(self)

以上

你可能感兴趣的:(TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of t)