如何找到 PyQt5 类 QAbstractTransition 的 PyQt6 版本

发布于 2025-01-18 10:39:14 字数 769 浏览 2 评论 0原文

我正在尝试将此 PyQt5 示例转换为 PyQt6,但它有一些无法通过 QtCore 获得的模块。我一直在学习 PyQt6 课程并通过示例进行工作,但我还没有达到可以很好地理解文档的程度。我在QObject中找到了qrand和qsrand。如何找到导入 QAbstractTransition 的方式或位置?这可能是 PyQt6 中尚未实现的东西吗?

"""https://github.com/baoboa/pyqt5/blob/master/examples/animation/moveblocks.py"""
"""
from PyQt5.QtCore import (QAbstractTransition, QEasingCurve, QEvent,
        QParallelAnimationGroup, QPropertyAnimation, qrand, QRect,
        QSequentialAnimationGroup, qsrand, QState, QStateMachine, Qt, QTime,
        QTimer)
"""
from PyQt6.QtCore import (QEasingCurve, QEvent,
        QParallelAnimationGroup, QPropertyAnimation, QRect,
        QSequentialAnimationGroup, Qt, QTime, QTimer)
# from PyQt6.   can't find QAbstractTransition
from PyQt6.QtCore import QObject

I'm trying to convert this PyQt5 example to PyQt6 but it has some modules that are not available through QtCore. I've been taking a PyQt6 class and working through examples but I'm not yet at the point where I can understand the documentation very well. I found qrand and qsrand in QObject. How can I find how or where to import QAbstractTransition? Could this be something that is not yet implemented in PyQt6?

"""https://github.com/baoboa/pyqt5/blob/master/examples/animation/moveblocks.py"""
"""
from PyQt5.QtCore import (QAbstractTransition, QEasingCurve, QEvent,
        QParallelAnimationGroup, QPropertyAnimation, qrand, QRect,
        QSequentialAnimationGroup, qsrand, QState, QStateMachine, Qt, QTime,
        QTimer)
"""
from PyQt6.QtCore import (QEasingCurve, QEvent,
        QParallelAnimationGroup, QPropertyAnimation, QRect,
        QSequentialAnimationGroup, Qt, QTime, QTimer)
# from PyQt6.   can't find QAbstractTransition
from PyQt6.QtCore import QObject

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

檐上三寸雪 2025-01-25 10:39:14

QAbstractTransition 已移至名为的新模块QtStateMachine 所以理想情况下,您应该使用 from PyQt6.QtStateMachine import QAbstractTransition 导入它。不幸的是 PyQt6 还没有实现它(也许这是一个错误),PySide6 已经实现了。

QAbstractTransition has been moved to the new module called QtStateMachine so ideally you should import it using from PyQt6.QtStateMachine import QAbstractTransition. Unfortunately PyQt6 hasn't implemented it (maybe it's a bug), PySide6 has instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文