|
Canorus
0.0
|
Tool button with a menu at the side and a button box when clicked on. More...
#include <menutoolbutton.h>

Public Slots | |
| void | onButtonPressed (int) |
Public Member Functions | |
| CAMenuToolButton (QString title, int numIconsRow=4, QWidget *parent=0) | |
| ~CAMenuToolButton () | |
| void | addButton (const QIcon icon, int buttonId, const QString toolTip="") |
| QAbstractButton * | getButton (int buttonId) |
| const QList< QToolButton * > & | buttonList () const |
| int | spacing () |
| int | layoutMargin () |
| int | margin () |
| int | numIconsPerRow () |
| void | setSpacing (int spacing) |
| void | setLayoutMargin (int margin) |
| void | setMargin (int margin) |
| void | setNumIconsPerRow (int numIconsRow) |
| void | setCurrentId (int id, bool triggerSignal=false) |
| void | showButtons () |
Public Member Functions inherited from CAToolButton | |
| CAToolButton (QWidget *parent) | |
| virtual | ~CAToolButton () |
| int | currentId () |
| virtual void | setCurrentId (int id) |
| bool | buttonsVisible () |
| void | setDefaultAction (QAction *) |
| virtual void | hideButtons () |
Private Member Functions | |
| void | wheelEvent (QWheelEvent *) |
Private Attributes | |
| QButtonGroup * | _buttonGroup |
| QGroupBox * | _groupBox |
| QGridLayout * | _boxLayout |
| QGridLayout * | _menuLayout |
| QList< QToolButton * > | _buttonList |
| QHash< QString, int > | _buttonIds |
| int | _buttonXPos |
| int | _buttonYPos |
| int | _numIconsRow |
| int | _spacing |
| int | _margin |
| int | _layoutMargin |
Additional Inherited Members | |
Signals inherited from CAToolButton | |
| void | toggled (bool checked, int id) |
Protected Member Functions inherited from CAToolButton | |
| CAMainWin * | mainWin () |
| void | setMainWin (CAMainWin *m) |
| void | setPopupWidget (QWidget *w) |
| void | mousePressEvent (QMouseEvent *) |
| QPoint | calculateTopLeft (QSize widgetSize) |
Protected Attributes inherited from CAToolButton | |
| CAMainWin * | _mainWin |
| int | _currentId |
| CAToolButtonPopup * | _popupWidget |
Tool button with a menu at the side and a button box when clicked on.
This widget looks like a button with a small dropdown arrow at the side which opens a button group box of various elements. User can add buttons by calling addButton(QIcon icon, int Id). When the element is selected, the action's icon is switched to the selected element's and a signal toggled(bool checked, int id) is emitted.
The class primarily consists of 3 elements:
| CAMenuToolButton::CAMenuToolButton | ( | QString | title, |
| int | numIconsRow = 4, |
||
| QWidget * | parent = 0 |
||
| ) |
Constructs the button menu with the given title and parent.
References _boxLayout, _buttonGroup, _buttonXPos, _buttonYPos, _groupBox, layoutMargin(), onButtonPressed(), setLayoutMargin(), setMargin(), setNumIconsPerRow(), CAToolButton::setPopupWidget(), setSpacing(), and spacing().

| CAMenuToolButton::~CAMenuToolButton | ( | ) |
Destructs the button menu.
References _buttonGroup, _buttonList, and _groupBox.
Adds a Tool button to the menu with the given icon and buttonId.
References _boxLayout, _buttonGroup, _buttonList, _buttonXPos, _buttonYPos, _groupBox, _margin, _spacing, and numIconsPerRow().
Referenced by CAMainWin::createCustomActions().


|
inline |
|
inline |
References _buttonGroup.
|
inline |
References _layoutMargin.
Referenced by CAMenuToolButton().

|
inline |
References _margin.
Referenced by setLayoutMargin(), and setMargin().

|
inline |
|
slot |
Hides the buttons menu, changes the current id and emits the toggled() signal.
References _buttonGroup, CAToolButton::hideButtons(), setCurrentId(), and CAToolButton::toggled().
Referenced by CAMenuToolButton().


| void CAMenuToolButton::setCurrentId | ( | int | id, |
| bool | triggerSignal = false |
||
| ) |
Sets the currently selected item by passing the item index. The current icon of the button is changed to the item ones. The current tool tip is also changed.
Does not change the current item, if the item is not part of the button box. If triggerSignal is False (default) it doesn't emit toggled(), otherwise it does.
References _buttonGroup, CAToolButton::setCurrentId(), and CAToolButton::toggled().
Referenced by CAMainWin::on_uiDynamicCustomText_returnPressed(), CAMainWin::on_uiTimeSigBeat_valueChanged(), CAMainWin::on_uiTimeSigBeats_valueChanged(), onButtonPressed(), CAMainWin::scoreViewKeyPress(), CAMainWin::setupCustomUi(), CAMainWin::updateDynamicToolBar(), CAMainWin::updateFBMToolBar(), CAMainWin::updateFermataToolBar(), CAMainWin::updateFingeringToolBar(), CAMainWin::updateFMToolBar(), CAMainWin::updatePlayableToolBar(), CAMainWin::updateRepeatMarkToolBar(), CAMainWin::updateTempoToolBar(), CAMainWin::updateVoiceToolBar(), and wheelEvent().


|
inline |
References _layoutMargin, and margin().
Referenced by CAMenuToolButton().


|
inline |
References _margin, and margin().
Referenced by CAMenuToolButton().


|
inline |
References _numIconsRow.
Referenced by CAMenuToolButton().

|
inline |
References _spacing, and spacing().
Referenced by CAMenuToolButton().


|
virtual |
Set the current button, then show the popup widget.
Reimplemented from CAToolButton.
References _buttonGroup, CAToolButton::currentId(), and CAToolButton::showButtons().

|
inline |
References _spacing.
Referenced by CAMenuToolButton(), and setSpacing().

|
privatevirtual |
Cycle through properties using the mouse wheel.
Implements CAToolButton.
References _buttonGroup, buttonList(), CAToolButton::currentId(), setCurrentId(), and CAToolButton::toggled().

|
private |
Referenced by addButton(), and CAMenuToolButton().
|
private |
Referenced by addButton(), CAMenuToolButton(), getButton(), onButtonPressed(), setCurrentId(), showButtons(), wheelEvent(), and ~CAMenuToolButton().
|
private |
|
private |
Referenced by addButton(), buttonList(), and ~CAMenuToolButton().
|
private |
Referenced by addButton(), and CAMenuToolButton().
|
private |
Referenced by addButton(), and CAMenuToolButton().
|
private |
Referenced by addButton(), CAMenuToolButton(), and ~CAMenuToolButton().
|
private |
Referenced by layoutMargin(), and setLayoutMargin().
|
private |
Referenced by addButton(), margin(), and setMargin().
|
private |
|
private |
Referenced by numIconsPerRow(), and setNumIconsPerRow().
|
private |
Referenced by addButton(), setSpacing(), and spacing().