ImFusion C++ SDK 4.5.0
ImFusion::GifIcon Class Reference

#include <ImFusion/Stream/StreamGUIHelpers.h>

Helper class to integrate an animated gif into the UI. More...

Inheritance diagram for ImFusion::GifIcon:

Detailed Description

Helper class to integrate an animated gif into the UI.

The gif file is wrapped inside a QToolButton.

Public Member Functions

 GifIcon (QToolButton *button, const QString &gifPath, QObject *parent=nullptr)
 Sets up the movie and scales the provided button to the width of the gif (fixed width).
void show ()
 Start playing the movie to update the button's icon and set the button visibility to true.
void hide ()
 Stops playing the gif moving and hides the button.

Constructor & Destructor Documentation

◆ GifIcon()

ImFusion::GifIcon::GifIcon ( QToolButton * button,
const QString & gifPath,
QObject * parent = nullptr )
explicit

Sets up the movie and scales the provided button to the width of the gif (fixed width).

Show or hide must be called afterwards to set the icon to the right state (visible or invisible).

Exceptions
std::invalid_argumentif button is nullptr Note: The class sets the button's size policy to setRetainSizeWhenHidden(true). So, the space of the button on the layout is preserved and stays empty while hidden.

The documentation for this class was generated from the following file:
  • ImFusion/Stream/StreamGUIHelpers.h
Search Tab / S to search, Esc to close