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.39k stars 520 forks source link

[Bug]: AttributeError: 'QWheelEvent' object has no attribute 'propertyName' #921

Open qianye216 opened 2 months ago

qianye216 commented 2 months ago

What happened?

当tablewidget列表有滑动操作后,选择某行,按快捷键C(程序监听了快捷键操作),程序出现崩溃

  File "qfluentwidgets/common/style_sheet.py", line 215, in eventFilter

AttributeError: 'QWheelEvent' object has no attribute 'propertyName'

Operation System

Mac

Python Version

3.11.7

PyQt/PySide Version

PyQt 5.15.9

PyQt/PySide-Fluent-Widgets Version

v1.5.8

How to Reproduce?

本地运行正常,一打包就有问题

Minimum code

class CustomStyleSheetWatcher(QObject):
    """ Custom style sheet watcher """

    def eventFilter(self, obj: QWidget, e: QEvent):
        if e.type() != QEvent.DynamicPropertyChange:
            return super().eventFilter(obj, e)
        name = e.propertyName().data().decode()
        if name in [CustomStyleSheet.LIGHT_QSS_KEY, CustomStyleSheet.DARK_QSS_KEY]:
            addStyleSheet(obj, CustomStyleSheet(obj))

        return super().eventFilter(obj, e)
zhiyiYo commented 2 months ago

Nuitka 打包的吗

zhiyiYo commented 1 month ago

5.15.2 版本的 pyqt5 不会报错