Class SBGUIPushButtonPixmap#
ClassList > SBGUIPushButtonPixmap
The SBGUIPushButtonPixmap class extends QPushButton to have a button that is fully.More...
#include <SBGUIPushButtonPixmap.hpp>
Inherits the following classes: QPushButton, QPushButton
Public Functions#
| Type | Name |
|---|---|
| SBGUIPushButtonPixmap (QWidget * parent=nullptr) Constructs the pixmap push button. |
|
| SBGUIPushButtonPixmap (const QString & text, QWidget * parent=nullptr) Constructs the pixmap push button, discards the text. |
|
| QPixmap | getScaledPixmap () const Returns the pixmap scaled to the size of the button with the margin subtracted from each side. |
| void | setIcon (const QPixmap & pixmap) Sets pixmap as the icon. |
| void | setMargin (unsigned int margin) Sets the margin between the button border and the icon border. |
| virtual | ~SBGUIPushButtonPixmap () Destructs the button. |
Protected Attributes#
| Type | Name |
|---|---|
| unsigned int | margin The margin between the button border and the icon border. |
| QPixmap | originalPixmap The original pixmap. |
Protected Functions#
| Type | Name |
|---|---|
| void | resizeEvent (QResizeEvent * event) Handles resize events by updating the button icon if a pixmap is set. |
Detailed Description#
Short name: SBPushButtonPixmap
Public Functions Documentation#
function SBGUIPushButtonPixmap [1/2]#
Constructs the pixmap push button.
Parameters:
parentParent widget, or nullptr if none.
function SBGUIPushButtonPixmap [2/2]#
Constructs the pixmap push button, discards the text.
explicit SBGUIPushButtonPixmap::SBGUIPushButtonPixmap (
const QString & text,
QWidget * parent=nullptr
)
Constructs the pixmap push button, discarding the provided text.
Parameters:
textIgnored text string.parentParent widget, or nullptr if none.
function getScaledPixmap#
Returns the pixmap scaled to the size of the button with the margin subtracted from each side.
Returns the pixmap scaled to the size of the button, subtracting the margin from each side.
Returns:
The scaled pixmap.
function setIcon#
Sets pixmap as the icon.
Sets the specified pixmap as the button's icon.
Parameters:
pixmapThe pixmap to use as the button's icon.
function setMargin#
Sets the margin between the button border and the icon border.
Parameters:
marginThe margin in pixels.
function ~SBGUIPushButtonPixmap#
Destructs the button.
Protected Attributes Documentation#
variable margin#
The margin between the button border and the icon border.
variable originalPixmap#
The original pixmap.
Protected Functions Documentation#
function resizeEvent#
Handles resize events by updating the button icon if a pixmap is set.
Parameters:
eventThe resize event, may be nullptr if called manually.