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.49k stars 523 forks source link

CalendarPicker展开后滚动鼠标滚轮报错 #572

Closed AmanoRenard closed 11 months ago

AmanoRenard commented 11 months ago

Describe the bug CalendarPicker展开后滚动鼠标滚轮报错

Environment 环境信息

To Reproduce

  1. 运行程序
  2. 点击Pick a date展开日历
  3. 在展开的窗口上滚动鼠标滚轮
  4. See error

Code 最小复现代码

from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout
from qfluentwidgets import CalendarPicker

class Window(QWidget):
    def __init__(self):
        super().__init__()
        vbox = QVBoxLayout()
        self.setFixedSize(500, 500)
        cp = CalendarPicker()
        vbox.addWidget(cp)
        self.setLayout(vbox)

if __name__ == '__main__':
    QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)
    app = QApplication([])
    w = Window()
    w.show()
    app.exec()

错误信息

Traceback (most recent call last):
  File "I:\SDK\PyQt6\lib\site-packages\qfluentwidgets\components\date_time\calendar_view.py", line 217, in wheelEvent
    if self.vScrollBar.ani.state() == QPropertyAnimation.Running:
AttributeError: type object 'QPropertyAnimation' has no attribute 'Running'

Expected behavior 日历正常滚动

Screenshots image

AmanoRenard commented 11 months ago

用PyQt5不会报错

zhiyiYo commented 11 months ago

已修复此问题