2021-05-29

Create a sliding animation in PyQt5 [closed]

I am using Python 3 and PyQt5 and I am trying to create a sliding text animation so that that the text slides in from the left/right and stops in the middle of the window. Is there any way that I could create such an animation. This is what my code currently looks like:

from PyQt5.QtWidgets import *
import sys
 
app = QApplication(sys.argv)
w = QWidget()
vbox = QVBoxLayout()
label = QLabel("This text should move from the left/right side to the middle.")
#Code to make text slide from left/right side to middle of window
vbox.addWidget(label)
w.setLayout(vbox)
w.show()
sys.exit(app.exec_())

Could I use something like QPropertyAnimation?



from Recent Questions - Stack Overflow https://ift.tt/2RUOACz
https://ift.tt/eA8V8J

No comments:

Post a Comment