|
Canorus
0.0
|
Tool button with a menu at the side. More...
#include <toolbutton.h>

Signals | |
| void | toggled (bool checked, int id) |
Public Member Functions | |
| CAToolButton (QWidget *parent) | |
| virtual | ~CAToolButton () |
| int | currentId () |
| virtual void | setCurrentId (int id) |
| bool | buttonsVisible () |
| void | setDefaultAction (QAction *) |
| virtual void | showButtons () |
| virtual void | hideButtons () |
Protected Member Functions | |
| CAMainWin * | mainWin () |
| void | setMainWin (CAMainWin *m) |
| void | setPopupWidget (QWidget *w) |
| virtual void | wheelEvent (QWheelEvent *)=0 |
| void | mousePressEvent (QMouseEvent *) |
| QPoint | calculateTopLeft (QSize widgetSize) |
Protected Attributes | |
| CAMainWin * | _mainWin |
| int | _currentId |
| CAToolButtonPopup * | _popupWidget |
Private Slots | |
| void | handleToggled (bool checked) |
| void | handleTriggered () |
Tool button with a menu at the side.
Copyright (c) 2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See COPYING for details.
This widget looks like a button with a small dropdown arrow at the side which opens a custom widget (also called "buttons") where user chooses from various actions then. When the element is selected, the action's icon is replaced with the previous icon on the toolbutton and a signal toggled(bool checked, int id) is emitted.
| CAToolButton::CAToolButton | ( | QWidget * | parent | ) |
|
virtual |
References _popupWidget.
|
inline |
References _popupWidget.
Referenced by mousePressEvent().

|
protected |
This function returns the absolute top-left coordinate where the popup menu or whichever widget should appear when the users clicks on the button.
The problem is that the popup widget should be completely visible in whichever part of the screen the toolbutton is located. Popup widget should also always stick to one corner of the toolbutton.
Parameter size is the width and height needed for the whole widget to appear.
References mainWin().
Referenced by showButtons().


|
inline |
References _currentId.
Referenced by handleToggled(), handleTriggered(), CAMainWin::on_uiFBMAccs_toggled(), CAMainWin::on_uiFBMNumber_toggled(), CAMainWin::on_uiInsertPlayable_toggled(), CAMainWin::scoreViewMousePress(), CAMenuToolButton::showButtons(), CAMainWin::updateDynamicToolBar(), CAMainWin::updateFermataToolBar(), CAMainWin::updateFingeringToolBar(), CAMainWin::updateInstrumentToolBar(), CAMainWin::updatePlayableToolBar(), CAMainWin::updateRepeatMarkToolBar(), CAMainWin::updateTempoToolBar(), and CAMenuToolButton::wheelEvent().

|
privateslot |
Emits toggled( bool, int ) signal.
References currentId(), and toggled().
Referenced by setDefaultAction().


|
privateslot |
Emits toggled( bool, int ) signal.
References currentId(), and toggled().
Referenced by setDefaultAction().


|
virtual |
Hides the popup widget if it's set
References _popupWidget.
Referenced by mousePressEvent(), CAMenuToolButton::onButtonPressed(), and CAUndoToolButton::onListWidgetItemClicked().

|
inlineprotected |
References _mainWin.
Referenced by calculateTopLeft(), and CAUndoToolButton::showButtons().

|
protected |
This function is overriden here in order to show buttons when clicked on the arrow.
References buttonsVisible(), hideButtons(), and showButtons().

|
inlinevirtual |
References _currentId.
Referenced by CAUndoToolButton::CAUndoToolButton(), and CAMenuToolButton::setCurrentId().

| void CAToolButton::setDefaultAction | ( | QAction * | a | ) |
Sets the new default action a and connects some signals to custom slots made by CAMenuToolButton. Also calls QToolButton::setDefaultAction().
References handleToggled(), handleTriggered(), and toggled().
Referenced by CAUndoToolButton::setDefaultAction(), and CAMainWin::setupCustomUi().


|
inlineprotected |
|
inlineprotected |
References _popupWidget, and CAToolButtonPopup::setWidget().
Referenced by CAMenuToolButton::CAMenuToolButton(), and CAUndoToolButton::CAUndoToolButton().


|
virtual |
Shows the popup widget if it's set
Reimplemented in CAUndoToolButton, and CAMenuToolButton.
References _popupWidget, calculateTopLeft(), and CAToolButtonPopup::sizeHint().
Referenced by mousePressEvent(), CAMenuToolButton::showButtons(), and CAUndoToolButton::showButtons().


|
signal |
Referenced by handleToggled(), handleTriggered(), CAMenuToolButton::onButtonPressed(), CAUndoToolButton::onListWidgetItemClicked(), CAMenuToolButton::setCurrentId(), setDefaultAction(), and CAMenuToolButton::wheelEvent().

|
protectedpure virtual |
Implemented in CAUndoToolButton, and CAMenuToolButton.
|
protected |
Referenced by currentId(), and setCurrentId().
|
protected |
Referenced by mainWin(), and setMainWin().
|
protected |
Referenced by buttonsVisible(), CAToolButton(), hideButtons(), setPopupWidget(), showButtons(), and ~CAToolButton().