API Documentation
|
#include <Button.h>
Public Types | |
enum | ButtonState { e_large , e_medium , e_medium_centered , e_small , e_circular , e_circular_small , e_push_button , e_none } |
Public Member Functions | |
Button (QWidget *parent=nullptr) | |
Button (ButtonState state, QWidget *parent=nullptr) | |
Button (const TranslatedString &name, const String &icon="", QWidget *parent=nullptr) | |
Button (const std::function< void(Button *)> &on_click, QWidget *parent=nullptr) | |
Button (const TranslatedString &name, const std::function< void(Button *)> &on_click, QWidget *parent=nullptr) | |
Button (const TranslatedString &name, const String &icon, const std::function< void(Button *)> &on_click, QWidget *parent=nullptr) | |
Button (const TranslatedString &name, const String &icon, TooltipType tooltip, const std::function< void(Button *)> &on_click, QWidget *parent=nullptr) | |
~Button () | |
void | paintEvent (QPaintEvent *event) override |
void | setAlignment (Qt::Alignment m_alignment) |
void | setup (const TranslatedString &name, const String &icon, const std::function< void(Button *)> &on_click) |
void | setup (const TranslatedString &name, const String &icon, TooltipType tooltip, const std::function< void(Button *)> &on_click) |
void | setup (const TranslatedString &name, const String &icon, Resource< bool > &checked_var) |
void | setup (GenericOption &checked_var) |
void | setup (ApplicationOption< bool > &checked_var) |
void | setup (const TranslatedString &name, const String &icon, ApplicationOption< bool > &checked_var) |
int | styleDefaultIconSize () const |
int | scaledIconSize () const |
void | setToolTip (TooltipType type) |
void | setToolTip (const QString &tip) |
void | setButtonState (ButtonState state) |
void | showPopupMenu (QWidget *widget, bool is_popup=true) |
bool | requestButtonState (ButtonState state) |
void | requestFixedState (bool fixed_state) |
ButtonState | buttonState () const |
void | setFunction (const std::function< void(Button *)> &on_click) |
void | setHoverFunction (const std::function< void(Button *, bool hovering)> &on_hover) |
void | setPressFunction (const std::function< void(Button *, bool hovering)> &on_press) |
void | enterEvent (ButtonEnterEvent *e) override |
void | leaveEvent (QEvent *e) override |
void | setMargin (uint04 margin) |
void | setIconSize (int size) |
void | setProgressPercent (fltp04 progress) |
bool | event (QEvent *e) override |
void | setIconSizeMultiplier (fltp04 icon_size_multiplier) |
void | setHoverIconSizeMultiplier (fltp04 icon_size_multiplier) |
void | setTitle (const TranslatedString &title) |
void | setText (const QString &text) |
const TranslatedString & | title () const |
const String & | iconName () const |
void | setIconName (const String &icon) |
void | setIcon (const QIcon &icon) |
void | setHoverIconName (const String &icon) |
void | setCheckedIconName (const String &icon) |
bool | eventFilter (QObject *watched, QEvent *event) override |
void | setToolTip (const TranslatedString &tooltip) |
void | setDisabledToolTip (const TranslatedString &tooltip) |
void | setToolTip (const TranslatedString &enabled_tooltip, const TranslatedString &disabled_tooltip) |
void | setFlat (bool is_flat) |
void | setButtonDialog (ButtonDialog *dialog) |
void | setSound (const String &sound) |
void | setIgnoreClicks (bool ignore_clicks) |
void | copyButtonFrom (Button *button) |
void | setBackgroundOpacity (fltp04 background_opacity) |
void | setMenuDialog (QWidget *widget) |
void | setIconColor (const RGBColor &color) |
void | setBackgroundColor (const RGBColor &color, bool update_foreground=true) |
void | clearBackgroundColor () |
void | setFocusOnPress (bool focus_on_press) |
void | setAutoDefault (bool is_auto_default) |
void | setDefault (bool is_default) |
void | setCheckable (bool checkable) |
void | setChecked (bool checked) |
QSize | sizeHint () const override |
QSize | minimumSizeHint () const override |
void | virtualMouseEvent (QEvent::Type event) |
void | setFontMultiplier (fltp04 font_multiplier) |
void | setBold (bool is_bold) |
void | setMenu (QMenu *menu) |
void | setClickCooldown (const TimeSpan &span) |
QMenu * | menu () const |
Static Public Attributes | |
static String | s_default_sound = "tap-warm" |
Protected Slots | |
void | onButtonClickSlot () |
void | onButtonPressSlot () |
void | onButtonReleaseSlot () |
Protected Member Functions | |
QString | autoWrapText (const QFontMetrics &metrics) |
void | updateTooltip () |
void | updateText () |
void | mouseReleaseEvent (QMouseEvent *) override |
void | mousePressEvent (QMouseEvent *) override |
bool | ignorePress () const |
void | setup () |
void | _setIcon (const String &icon, bool force=false) |
void | updateFont () |
void | _defaultRender (QStylePainter *p, QStyleOptionToolButton *tool_button, QIcon::State state, QIcon::Mode mode, bool draw_backgound, bool is_default) |
Friends | |
class | HoverButtonIconWatch |
enum ButtonState |
Button | ( | QWidget * | parent = nullptr | ) |
Button | ( | ButtonState | state, |
QWidget * | parent = nullptr ) |
Button | ( | const TranslatedString & | name, |
const String & | icon = "", | ||
QWidget * | parent = nullptr ) |
Button | ( | const TranslatedString & | name, |
const std::function< void(Button *)> & | on_click, | ||
QWidget * | parent = nullptr ) |
Button | ( | const TranslatedString & | name, |
const String & | icon, | ||
const std::function< void(Button *)> & | on_click, | ||
QWidget * | parent = nullptr ) |
Button | ( | const TranslatedString & | name, |
const String & | icon, | ||
TooltipType | tooltip, | ||
const std::function< void(Button *)> & | on_click, | ||
QWidget * | parent = nullptr ) |
~Button | ( | ) |
|
protected |
|
protected |
|
protected |
|
inline |
void clearBackgroundColor | ( | ) |
void copyButtonFrom | ( | Button * | button | ) |
|
override |
|
override |
|
override |
const String & iconName | ( | ) | const |
|
protected |
|
override |
QMenu * menu | ( | ) | const |
|
override |
|
overrideprotected |
|
overrideprotected |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
override |
bool requestButtonState | ( | ButtonState | state | ) |
void requestFixedState | ( | bool | fixed_state | ) |
int scaledIconSize | ( | ) | const |
void setAlignment | ( | Qt::Alignment | m_alignment | ) |
void setAutoDefault | ( | bool | is_auto_default | ) |
void setBackgroundColor | ( | const RGBColor & | color, |
bool | update_foreground = true ) |
void setBackgroundOpacity | ( | fltp04 | background_opacity | ) |
void setBold | ( | bool | is_bold | ) |
void setButtonDialog | ( | ButtonDialog * | dialog | ) |
void setButtonState | ( | ButtonState | state | ) |
void setCheckable | ( | bool | checkable | ) |
void setChecked | ( | bool | checked | ) |
void setCheckedIconName | ( | const String & | icon | ) |
void setClickCooldown | ( | const TimeSpan & | span | ) |
void setDefault | ( | bool | is_default | ) |
void setDisabledToolTip | ( | const TranslatedString & | tooltip | ) |
void setFlat | ( | bool | is_flat | ) |
void setFocusOnPress | ( | bool | focus_on_press | ) |
void setFontMultiplier | ( | fltp04 | font_multiplier | ) |
|
inline |
|
inline |
void setHoverIconName | ( | const String & | icon | ) |
void setHoverIconSizeMultiplier | ( | fltp04 | icon_size_multiplier | ) |
void setIcon | ( | const QIcon & | icon | ) |
void setIconColor | ( | const RGBColor & | color | ) |
void setIconName | ( | const String & | icon | ) |
void setIconSize | ( | int | size | ) |
void setIconSizeMultiplier | ( | fltp04 | icon_size_multiplier | ) |
|
inline |
void setMargin | ( | uint04 | margin | ) |
void setMenu | ( | QMenu * | menu | ) |
void setMenuDialog | ( | QWidget * | widget | ) |
|
inline |
void setProgressPercent | ( | fltp04 | progress | ) |
void setSound | ( | const String & | sound | ) |
void setText | ( | const QString & | text | ) |
void setTitle | ( | const TranslatedString & | title | ) |
void setToolTip | ( | const QString & | tip | ) |
void setToolTip | ( | const TranslatedString & | enabled_tooltip, |
const TranslatedString & | disabled_tooltip ) |
void setToolTip | ( | const TranslatedString & | tooltip | ) |
void setToolTip | ( | TooltipType | type | ) |
|
protected |
void setup | ( | ApplicationOption< bool > & | checked_var | ) |
void setup | ( | const TranslatedString & | name, |
const String & | icon, | ||
ApplicationOption< bool > & | checked_var ) |
void setup | ( | const TranslatedString & | name, |
const String & | icon, | ||
const std::function< void(Button *)> & | on_click ) |
void setup | ( | const TranslatedString & | name, |
const String & | icon, | ||
Resource< bool > & | checked_var ) |
void setup | ( | const TranslatedString & | name, |
const String & | icon, | ||
TooltipType | tooltip, | ||
const std::function< void(Button *)> & | on_click ) |
void setup | ( | GenericOption & | checked_var | ) |
void showPopupMenu | ( | QWidget * | widget, |
bool | is_popup = true ) |
|
override |
int styleDefaultIconSize | ( | ) | const |
const TranslatedString & title | ( | ) | const |
|
protected |
|
protected |
|
protected |
void virtualMouseEvent | ( | QEvent::Type | event | ) |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |