Class SBGUIPushButton#
Inherits the following classes: QPushButton
Public Functions#
Type | Name |
---|---|
SBGUIPushButton (QWidget * parent=nullptr) |
|
bool | dimBaseIconWhileBusy () const |
bool | isBusy () const |
QPoint | overlayOffset () const |
qreal | overlayScale () const |
void | setBusy (bool on) Enable/disable the busy overlay. |
void | setDimBaseIconWhileBusy (bool on) If true, draws a subtle shade over the base icon while busy. |
bool | setOverlayGif (const QString & path) Load a GIF (from file path or Qt resource) to use as the busy overlay. |
void | setOverlayMovie (QMovie * movie) Provide an already-constructed QMovie as the overlay. |
void | setOverlayOffset (const QPoint & px) Optional pixel offset to nudge the overlay relative to the icon rect. |
void | setOverlayScale (qreal s) Scale overlay relative to the base icon rectangle. |
~SBGUIPushButton () override |
Protected Functions#
Type | Name |
---|---|
void | paintEvent (QPaintEvent * e) override Paints the standard QPushButton then, if busy, draws the animated overlay centered on the button's icon rectangle. |
Public Functions Documentation#
function SBGUIPushButton#
function dimBaseIconWhileBusy#
function isBusy#
function overlayOffset#
function overlayScale#
function setBusy#
Enable/disable the busy overlay.
Starts/stops the movie and triggers repaints.
function setDimBaseIconWhileBusy#
If true, draws a subtle shade over the base icon while busy.
function setOverlayGif#
Load a GIF (from file path or Qt resource) to use as the busy overlay.
Parameters:
path
File path or qrc path to a GIF.
Returns:
true on success, false if the movie is invalid.
Ownership: the created QMovie is parented to this button.
function setOverlayMovie#
Provide an already-constructed QMovie as the overlay.
Ownership is transferred to this button (parent is set to this).
Parameters:
movie
QMovie to use (may be nullptr to clear).
function setOverlayOffset#
Optional pixel offset to nudge the overlay relative to the icon rect.
function setOverlayScale#
Scale overlay relative to the base icon rectangle.
1.0 = same size, 0.8 = 80%, etc. Clamped to [0.2, 2.0].
function ~SBGUIPushButton#
Protected Functions Documentation#
function paintEvent#
Paints the standard QPushButton then, if busy, draws the animated overlay centered on the button's icon rectangle.