Web Analytics Made Easy - Statcounter
Skip to content

File SBGUIPushButton.hpp#

FileList > GUI > UI > SBGUIPushButton.hpp

QPushButton subclass that can display an animated GIF overlay (e.g., a busy spinner) on top of the button's icon while a "busy" state is active. More...

  • #include "SBGUIExport.hpp"
  • #include <QPushButton>
  • #include <QMovie>
  • #include <QTimer>
  • #include <QPoint>

Classes#

Type Name
class SBGUIPushButton

Detailed Description#

Usage: auto* btn = new SBGUIPushButton(parent); btn->setIcon(QIcon(":/icons/download.svg")); btn->setOverlayGif(":/spinners/spinner.gif"); btn->setBusy(true); // starts animation overlay

Notes: * The overlay scales relative to the button's iconSize(). * Optionally dims the base icon while busy to provide visual feedback. * A fallback repaint timer is used in case the QMovie doesn't emit frameChanged.