LibrePCB Developers Documentation
|
The ExclusiveActionGroup class groups multiple QAction's together. More...
#include <exclusiveactiongroup.h>
Inherits QObject.
Signals | |
void | actionTriggered (int id, const QVariant &mode) |
Public Member Functions | |
ExclusiveActionGroup () noexcept | |
ExclusiveActionGroup (const ExclusiveActionGroup &other)=delete | |
~ExclusiveActionGroup () noexcept | |
void | reset () noexcept |
void | setEnabled (bool enabled) noexcept |
void | addAction (QPointer< QAction > action, int id, const QVariant &mode=QVariant()) noexcept |
void | setActionEnabled (int id, bool enabled) noexcept |
void | setCurrentAction (int id) noexcept |
ExclusiveActionGroup & | operator= (const ExclusiveActionGroup &rhs)=delete |
Private Member Functions | |
void | actionTriggeredSlot () noexcept |
Private Attributes | |
QHash< int, QVector< std::pair< QPointer< QAction >, QVariant > > > | mActions |
The ExclusiveActionGroup class groups multiple QAction's together.
This class is basically the same as QActionGroup (http://doc.qt.io/qt-5/qactiongroup.html). But there is one important difference: When the user clicks on a QAction, that action won't be checked instantly. Instead, this class only emits the signal actionTriggered(). Whether the triggered action actually gets checked or the request is rejected can be decided from outside this class (typically by the state machine of an editor window). To change the selected action, setCurrentAction() needs to be called.
In addition, this class provides support for "nested" actions, used to create tools which can be entered in different modes.
|
noexcept |
|
delete |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
delete |
|
signal |
|
privatenoexcept |
|
private |