如何找到 PyQt5 类 QAbstractTransition 的 PyQt6 版本
我正在尝试将此 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
QAbstractTransition
已移至名为的新模块QtStateMachine
所以理想情况下,您应该使用 from PyQt6.QtStateMachine import QAbstractTransition 导入它。不幸的是 PyQt6 还没有实现它(也许这是一个错误),PySide6 已经实现了。QAbstractTransition
has been moved to the new module calledQtStateMachine
so ideally you should import it usingfrom PyQt6.QtStateMachine import QAbstractTransition
. Unfortunately PyQt6 hasn't implemented it (maybe it's a bug), PySide6 has instead.