KAnimatedButton Class
An extended version of QToolButton which can display an animation. More...
| Header: | #include <KAnimatedButton> |
| CMake: | find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons) |
| Inherits: | QToolButton |
Properties
- animationPath : QString
Public Functions
| KAnimatedButton(QWidget *parent = nullptr) | |
| QString | animationPath() const |
| void | setAnimationPath(const QString &path) |
Public Slots
Detailed Description
This widget extends QToolButton with the ability to display an animation. All you need to do is pass along a path to a file containing an animation, it can be anything supported by QMovie, or a picture containing all the frames of the animation next to each other (each frame being assumed of having the same size).
Property Documentation
animationPath : QString
Access functions:
| QString | animationPath() const |
| void | setAnimationPath(const QString &path) |
Member Function Documentation
[explicit] KAnimatedButton::KAnimatedButton(QWidget *parent = nullptr)
Construct an animated tool button.
parent The parent widget
QString KAnimatedButton::animationPath() const
Returns the path used to load the animation
Note: Getter function for property animationPath.
See also setAnimationPath().
void KAnimatedButton::setAnimationPath(const QString &path)
Sets the path to the file which contains the animation to load.
path The path of the file containing the animation
Note: Setter function for property animationPath.
See also animationPath().
[slot] void KAnimatedButton::start()
Starts the animation from frame 1
[slot] void KAnimatedButton::stop()
Stops the animation. This will also reset the widget to frame 1.