API Documentation
Loading...
Searching...
No Matches
DesignObjectToggleWidget Class Reference

#include <DesignObjectToggleWidget.h>

Inheritance diagram for DesignObjectToggleWidget:
[legend]
Collaboration diagram for DesignObjectToggleWidget:
[legend]

Public Member Functions

 DesignObjectToggleWidget (QWidget *parent=nullptr)
 
void clearTarget ()
 
void setTarget (DesignObject::DesignProperty property, const DynamicPointer< QTDesignObject > &object)
 
void setTarget (const DynamicPointer< QTDesignObject > &object)
 
void setDesignProperty (DesignObject::DesignProperty property)
 
void setupForMetadata (const TranslatedString &title, String meta_data)
 
void setupForMetadata (const String &metadata)
 
- Public Member Functions inherited from Toggle
 Toggle (QWidget *parent=nullptr)
 
 Toggle (const std::function< void(Button *)> &on_click)
 
 Toggle (const TranslatedString &name, const std::function< void(Button *)> &on_click)
 
 Toggle (const TranslatedString &name, const String &icon, const std::function< void(Button *)> &on_click)
 
 Toggle (const TranslatedString &name, const String &icon, Resource< bool > &on_click)
 
 ~Toggle ()
 
QSize sizeHint () const override
 
QSize minimumSizeHint () const override
 
float offset () const
 
void setOffset (float o)
 
- Public Member Functions inherited from Button
 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 TranslatedStringtitle () const
 
const StringiconName () 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
 

Protected Slots

void onObjectDeletedSlot ()
 
void sendCommand ()
 
void onObjectUpdatedSlot ()
 
- Protected Slots inherited from Toggle
void onChecked (bool checked)
 
- Protected Slots inherited from Button
void onButtonClickSlot ()
 
void onButtonPressSlot ()
 
void onButtonReleaseSlot ()
 

Protected Attributes

DesignObject::DesignProperty m_property
 
DynamicPointer< QTDesignObjectm_target
 
TranslatedString m_title
 
String m_meta_data
 
- Protected Attributes inherited from Button
std::function< void(Button *)> m_on_click = nullptr
 
std::function< void(Button *, bool hovering)> m_on_hover = nullptr
 
std::function< void(Button *, bool pressing)> m_on_press = nullptr
 
QTResourceListenerm_icon_theme_listener = nullptr
 
ButtonDialogm_dialog = nullptr
 
QPointer< QWidget > m_menu_dialog = nullptr
 
TranslatedString m_title
 
TranslatedString m_disabled_tooltip
 
TranslatedString m_enabled_tooltip
 
String m_icon
 
String m_current_icon
 
String m_hover_icon
 
String m_checked_icon
 
String m_sound
 
Time m_last_click_time = Time(0)
 
TimeSpan m_click_cooldown = TimeSpan(0.1)
 
fltp04 m_icon_size_multiplier = 1.0f
 
uint04 m_margin = Constant<uint04>::NaN
 
fltp04 m_hover_icon_size_multiplier = Constant<fltp04>::NaN
 
fltp04 m_progress = Constant<fltp04>::NaN
 
fltp04 m_background_opacity = 1.0f
 
ButtonState m_state = ButtonState::e_large
 
bool m_ignore_clicks = false
 
bool m_fixed_state_requested = false
 
bool m_has_custom_background_color = false
 
bool m_focus_on_press = true
 
Qt::Alignment m_alignment
 
RGBColor m_icon_color
 
QPushButton * m_push_button = nullptr
 
bool m_is_default_button = false
 
bool m_is_auto_default_button = false
 
fltp04 m_font_multiplier = 1.0f
 
bool m_is_bold = false
 

Additional Inherited Members

- Public Types inherited from Button
enum  ButtonState {
  e_large , e_medium , e_medium_centered , e_small ,
  e_circular , e_circular_small , e_push_button , e_none
}
 
- Static Public Attributes inherited from Button
static String s_default_sound = "tap-warm"
 
- Protected Member Functions inherited from Toggle
void setupToggle ()
 
void paintEvent (QPaintEvent *) override
 
void mouseReleaseEvent (QMouseEvent *) override
 
int sliderWidth () const
 
int sliderHeight () const
 
int spacing () const
 
QRect sliderRect () const
 
- Protected Member Functions inherited from Button
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)
 
- Properties inherited from Toggle
float offset
 

Constructor & Destructor Documentation

◆ DesignObjectToggleWidget()

DesignObjectToggleWidget ( QWidget * parent = nullptr)
inline

Member Function Documentation

◆ clearTarget()

void clearTarget ( )
inline

◆ onObjectDeletedSlot

void onObjectDeletedSlot ( )
inlineprotectedslot

◆ onObjectUpdatedSlot

void onObjectUpdatedSlot ( )
inlineprotectedslot

◆ sendCommand

void sendCommand ( )
inlineprotectedslot

◆ setDesignProperty()

void setDesignProperty ( DesignObject::DesignProperty property)
inline

◆ setTarget() [1/2]

void setTarget ( const DynamicPointer< QTDesignObject > & object)
inline

◆ setTarget() [2/2]

void setTarget ( DesignObject::DesignProperty property,
const DynamicPointer< QTDesignObject > & object )
inline

◆ setupForMetadata() [1/2]

void setupForMetadata ( const String & metadata)
inline

◆ setupForMetadata() [2/2]

void setupForMetadata ( const TranslatedString & title,
String meta_data )
inline

Member Data Documentation

◆ m_meta_data

String m_meta_data
protected

◆ m_property

DesignObject::DesignProperty m_property
protected

◆ m_target

DynamicPointer<QTDesignObject> m_target
protected

◆ m_title

TranslatedString m_title
protected

The documentation for this class was generated from the following file: