|
QGIS API Documentation 4.3.0-Master (3b7b3208a79)
|
QWidgetAction for adding toolbuttons/actions to the toolbars which are not children of QMainWindow. More...
#include <qgstoolbuttonaction.h>

Public Member Functions | |
| QgsToolButtonAction (QObject *parent=nullptr) | |
| Constructor for QgsToolButtonAction. | |
| void | addActions (const QList< QAction * > &actions) |
| Appends actions to the button's list of actions. | |
| QAction * | defaultAction () const |
| Returns the default action. | |
| void | setAutoRaise (bool autoRaise) |
| Sets whether auto-raise is enabled. | |
| void | setDefaultAction (QAction *action) |
| Sets the default action to action. | |
| void | setMenu (QMenu *menu) |
| Associates a menu with this tool button. | |
| void | setPopupMode (QToolButton::ToolButtonPopupMode mode) |
| Sets the popup mode to use for button's popup menu. | |
| void | setToolButtonStyle (Qt::ToolButtonStyle style) |
| Sets the toolbutton style, e.g. | |
Protected Member Functions | |
| QWidget * | createWidget (QWidget *parent) override |
QWidgetAction for adding toolbuttons/actions to the toolbars which are not children of QMainWindow.
QgsToolButtonAction should be used to add buttons with dropdown menus to make them available in the toolbar extension popup.
Definition at line 40 of file qgstoolbuttonaction.h.
|
explicit |
Constructor for QgsToolButtonAction.
| parent | parent widget |
Definition at line 25 of file qgstoolbuttonaction.cpp.
| void QgsToolButtonAction::addActions | ( | const QList< QAction * > & | actions | ) |
Appends actions to the button's list of actions.
This is an alternative to setMenu(), the buttons build their popup menu from these actions. If a menu was set with setMenu() it takes precedence.
Definition at line 88 of file qgstoolbuttonaction.cpp.
|
overrideprotected |
Definition at line 129 of file qgstoolbuttonaction.cpp.
| QAction * QgsToolButtonAction::defaultAction | ( | ) | const |
Returns the default action.
Definition at line 124 of file qgstoolbuttonaction.cpp.
| void QgsToolButtonAction::setAutoRaise | ( | bool | autoRaise | ) |
Sets whether auto-raise is enabled.
Definition at line 32 of file qgstoolbuttonaction.cpp.
| void QgsToolButtonAction::setDefaultAction | ( | QAction * | action | ) |
Sets the default action to action.
The buttons mirror the default action's icon, text, tooltip and state, and clicking a button triggers it.
Ownership of the action is not transferred.
Definition at line 105 of file qgstoolbuttonaction.cpp.
| void QgsToolButtonAction::setMenu | ( | QMenu * | menu | ) |
Associates a menu with this tool button.
The menu will be shown according to the button's popup mode. Ownership of the menu is not transferred.
Definition at line 74 of file qgstoolbuttonaction.cpp.
| void QgsToolButtonAction::setPopupMode | ( | QToolButton::ToolButtonPopupMode | mode | ) |
Sets the popup mode to use for button's popup menu.
Definition at line 46 of file qgstoolbuttonaction.cpp.
| void QgsToolButtonAction::setToolButtonStyle | ( | Qt::ToolButtonStyle | style | ) |
Sets the toolbutton style, e.g.
icon only, text only, or text beside/below the icon.
Definition at line 60 of file qgstoolbuttonaction.cpp.