Class sh::ui::qt::QtToolbarButton

class sh::ui::qt::QtToolbarButton : public QToolButton

A qt toolbar button implementation with optional submenu.

Public Types

enum Position

Values:

enumerator LEFT
enumerator RIGHT
enumerator TOP
enumerator BOTTOM

Public Functions

QtToolbarButton(QWidget *parent = 0)
void setText(const QString &text)
QString text() const
void setIcon(const QIcon &icon)
QIcon icon()
QSize sizeHint() const
void setButtonText(QString v)
QString buttonText()
void setButtonIcon(QIcon v)
QIcon buttonIcon()
void setButtonEnabled(bool v)
bool isButtonEnabled()
bool hasExpander()
void setSubmenu(QtActionMenu *menu)
QtActionMenu *submenu()
void setLocation(Position location)
void setClickAction(std::function<void()> action)
void unsetClickAction()
void trigger()
void openMenu()

Private Functions

void _calcDims()
void computeArrowAndDividerLineCoordinates()

Private Members

QString _text
QString _text1
QString _textWithoutMnemonic1
QString _text2
QString _textWithoutMnemonic2
QIcon _icon
bool _drawIconOnly = false
bool _hovered = false
bool _arrowhovered = false
sh::ui::qt::QtActionMenu *_menu = 0
std::function<void()> _clickAction
Position location
int tw1
int tworig1
int tw2
int tworig2
int twmax
int tworigmax
int th
int thorig
int iw
int ih
int iedim
int ew
int eh
const int textpad = 20
const int opad = 3
int expx1
int expx2
int expy1
int expy2
int xt
int yt1
int yt2
int xi
int yi
QPainterPath arrow
bool _drawmnemonics = false

Private Slots

void slot_clicked()

Friends

friend class sh::actions::ActionsManager