zhiyiYo / PyQt-Fluent-Widgets

A fluent design widgets library based on C++ Qt/PyQt/PySide. Make Qt Great Again.
https://qfluentwidgets.com
GNU General Public License v3.0
5.61k stars 541 forks source link

metaclass conflict #60

Closed xianyuechen closed 1 year ago

xianyuechen commented 1 year ago

Describe the bug build error...

Environment

To Reproduce run any demo.py

Error Info

File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qfluentwidgets\__init__.py", line 17, in <module>
    from .components import *
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qfluentwidgets\components\__init__.py", line 1, in <module>
    from .dialog_box import *
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qfluentwidgets\components\dialog_box\__init__.py", line 2, in <module>
    from .dialog import Dialog, MessageBox
  File "C:\Users\xxxx\AppData\Local\Programs\Python\Python39\lib\site-packages\qfluentwidgets\components\dialog_box\dialog.py", line 102, in <module>
    class Dialog(FramelessDialog, Ui_MessageBox):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

other it's ok, when I test branch pyqt5. it's error when I test branch Pyside6

zhiyiYo commented 1 year ago

Maybe it's caused by the Python version, my 3.8.16 and 3.11.0 python won't have this problem.

xianyuechen commented 1 year ago

安装3.8.16好了

zhiyiYo commented 1 year ago

@dwincxy 把 qfluentwidgets/components/dialog_box/dialog.pyUi_MessageBox 的类定义为 class Ui_MessageBox 而非 QObject 的子类,可以解决此问题吗

xianyuechen commented 1 year ago

@zhiyiYo 不好意思,忘记回复了,后面我装环境直接用python官方源就好了,很多问题都是用了镜像源的原因,后面Pyqt5 和 Pyside6版本我试了都可以了