PyQt QPushButton for animation
- PyQt5 >= 5.8
python -m pip install pyqt-ani-button
from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout
from pyqt_ani_button import AniButton
class Widget(QWidget):
def __init__(self):
super().__init__()
self.__initUi()
def __initUi(self):
lay = QHBoxLayout()
for i in range(5):
btn = AniButton()
btn.setFixedSize(30, 15)
lay.addWidget(btn)
self.setLayout(lay)
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
ex = Widget()
ex.show()
sys.exit(app.exec_())
Result
ani_button_example.mp4
Perhaps this is not the animation you expected.
I'm working on button which is able to do color transition animation.