LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExclusiveActionGroup Class Referencefinal

The ExclusiveActionGroup class groups multiple QAction's together. More...

#include <exclusiveactiongroup.h>

Inherits QObject.

+ Collaboration diagram for ExclusiveActionGroup:

Signals

void changeRequestTriggered (const QVariant &key)
 

Public Member Functions

 ExclusiveActionGroup () noexcept
 
 ExclusiveActionGroup (const ExclusiveActionGroup &other)=delete
 
 ~ExclusiveActionGroup () noexcept
 
void reset () noexcept
 
void setEnabled (bool enabled) noexcept
 
void addAction (const QVariant &key, QAction *action) noexcept
 
void setActionEnabled (const QVariant &key, bool enabled) noexcept
 
void setCurrentAction (const QVariant &key) noexcept
 
const QVariant & getCurrentAction () const noexcept
 
ExclusiveActionGroupoperator= (const ExclusiveActionGroup &rhs)=delete
 

Private Member Functions

void actionTriggered () noexcept
 

Private Attributes

QVariant mCurrentAction
 
QMap< QVariant, QAction * > mActions
 

Detailed Description

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 changeRequestTriggered(). 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.

Author
ubruhin
Date
2016-11-29

Constructor & Destructor Documentation

ExclusiveActionGroup ( )
noexcept
ExclusiveActionGroup ( const ExclusiveActionGroup other)
delete
~ExclusiveActionGroup ( )
noexcept

Member Function Documentation

void reset ( )
noexcept

+ Here is the call graph for this function:

void setEnabled ( bool  enabled)
noexcept

+ Here is the caller graph for this function:

void addAction ( const QVariant &  key,
QAction *  action 
)
noexcept

+ Here is the call graph for this function:

void setActionEnabled ( const QVariant &  key,
bool  enabled 
)
noexcept
void setCurrentAction ( const QVariant &  key)
noexcept

+ Here is the caller graph for this function:

const QVariant& getCurrentAction ( ) const
inlinenoexcept
ExclusiveActionGroup& operator= ( const ExclusiveActionGroup rhs)
delete
void changeRequestTriggered ( const QVariant &  key)
signal

+ Here is the caller graph for this function:

void actionTriggered ( )
privatenoexcept

+ Here is the caller graph for this function:

Member Data Documentation

QVariant mCurrentAction
private
QMap<QVariant, QAction*> mActions
private

The documentation for this class was generated from the following files: