FIXME Subscripted generics cannot be used with class and instance checks
Traceback (most recent call last):
File "c:\Users\Administrator\Downloads\PyQt-Fluent-Widgets-PySide2\examples\gallery\demo.py", line 39, in <module>
w = MainWindow()
File "c:\Users\Administrator\Downloads\PyQt-Fluent-Widgets-PySide2\examples\gallery\app\view\main_window.py", line 36, in __init__
super().__init__()
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\window\fluent_window.py", line 150, in __init__
super().__init__(parent)
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\window\fluent_window.py", line 27, in __init__
super().__init__(parent=parent)
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\common\animation.py", line 85, in __init__
self.bgColorObject = BackgroundColorObject(self)
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\common\animation.py", line 171, in __init__
super().__init__(parent)
TypeError: 'PySide2.QtCore.QObject' called with wrong argument types:
PySide2.QtCore.QObject(MainWindow)
Supported signatures:
PySide2.QtCore.QObject(typing.Union[PySide2.QtCore.QObject, NoneType] = None)
Operation System
Windows10
Python Version
3.8.18
PyQt/PySide Version
Pyside2 5.15.2.1
PyQt/PySide-Fluent-Widgets Version
1.4.6
How to Reproduce?
我下载的pyside2版本的代码,运行examples/gallery/demo.py报错了。
FIXME Subscripted generics cannot be used with class and instance checks
Traceback (most recent call last):
File "c:\Users\Administrator\Downloads\PyQt-Fluent-Widgets-PySide2\examples\gallery\demo.py", line 39, in <module>
w = MainWindow()
File "c:\Users\Administrator\Downloads\PyQt-Fluent-Widgets-PySide2\examples\gallery\app\view\main_window.py", line 36, in __init__
super().__init__()
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\window\fluent_window.py", line 150, in __init__
super().__init__(parent)
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\window\fluent_window.py", line 27, in __init__
super().__init__(parent=parent)
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\common\animation.py", line 85, in __init__
self.bgColorObject = BackgroundColorObject(self)
File "D:\anaconda3\envs\py38\lib\site-packages\qfluentwidgets\common\animation.py", line 171, in __init__
super().__init__(parent)
TypeError: 'PySide2.QtCore.QObject' called with wrong argument types:
PySide2.QtCore.QObject(MainWindow)
Supported signatures:
PySide2.QtCore.QObject(typing.Union[PySide2.QtCore.QObject, NoneType] = None)
Minimum code
# coding:utf-8
import os
import sys
from PySide2.QtCore import Qt, QTranslator
from PySide2.QtGui import QFont
from PySide2.QtWidgets import QApplication
from qfluentwidgets import FluentTranslator
from app.common.config import cfg
from app.view.main_window import MainWindow
# enable dpi scale
if cfg.get(cfg.dpiScale) == "Auto":
QApplication.setHighDpiScaleFactorRoundingPolicy(
Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)
QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
else:
os.environ["QT_ENABLE_HIGHDPI_SCALING"] = "0"
os.environ["QT_SCALE_FACTOR"] = str(cfg.get(cfg.dpiScale))
QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
# create application
app = QApplication(sys.argv)
app.setAttribute(Qt.AA_DontCreateNativeWidgetSiblings)
# internationalization
locale = cfg.get(cfg.language).value
translator = FluentTranslator(locale)
galleryTranslator = QTranslator()
galleryTranslator.load(locale, "gallery", ".", ":/gallery/i18n")
app.installTranslator(translator)
app.installTranslator(galleryTranslator)
# create main window
w = MainWindow()
w.show()
app.exec_()
What happened?
我下载的pyside2版本的代码,运行examples/gallery/demo.py报错了。
Operation System
Windows10
Python Version
3.8.18
PyQt/PySide Version
Pyside2 5.15.2.1
PyQt/PySide-Fluent-Widgets Version
1.4.6
How to Reproduce?
我下载的pyside2版本的代码,运行examples/gallery/demo.py报错了。
Minimum code