QPushButton
can have icon, but I need to set animated icon to it. How to do this?
I created new class implemented from QPushButton
but how to replace icon from QIcon
to QMovie
?
相关问题
- QML: Cannot read property 'xxx' of undefin
- QTextEdit.find() doesn't work in Python
- Qt 5.0.1: Application will not execute outside of
- QT Layouts, how to make widgets in horizontal layo
- QT GUI freezes even though Im running in separate
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- Qt槽函数自动执行多遍
- Is there a non-java, cross platform way to launch
- How to get a settings storage path in a cross-plat
- How to set the font size of the label on pushbutto
- Why doesn't valgrind detect a memory leak in m
- Keep constant number of visible circles in 3D anim
- QTreeView remove decoration/expand button for all
This can be accomplished without subclassing
QPushButton
by simply using the signal / slot mechanism of Qt. Connect theframeChanged
signal ofQMovie
to a custom slot in the class that contains thisQPushButton
. This function will apply the current frame of theQMovie
as the icon of theQPushButton
. It should look something like this:And when allocating your
QMovie
andQPushButton
members ...