Stellarium
24.3
|
Wrapper around an argumentless QObject slot or a bool Q_PROPERTY with WRITE method, allowing the slot to be called/property to be toggled using this action object. More...
#include <StelActionMgr.hpp>
Public Slots | |
void | setChecked (bool) |
void | trigger () |
If the action is checkable, toggle() is called. More... | |
void | toggle () |
If the action is checkable, this toggles the value of the connected boolean property. More... | |
Signals | |
void | toggled (bool) |
Emitted when the boolean state of this StelAction changes. More... | |
void | triggered () |
Emitted after an argumentless slot has been called. | |
void | changed () |
Emitted when additional data associated with this action changed (i.e. shortcuts, text,...) | |
Public Member Functions | |
bool | isCheckable () const |
bool | isChecked () const |
bool | isGlobal () const |
void | setShortcut (const QString &key) |
Defines the key-combination used to call this action. | |
void | setAltShortcut (const QString &key) |
Defines an alternative key-combination. | |
QKeySequence::SequenceMatch | matches (const QKeySequence &seq) const |
QString | getId () const |
The ID of this action. Must be unique. | |
QString | getGroup () const |
const QKeySequence | getShortcut () const |
const QKeySequence | getAltShortcut () const |
QString | getText () const |
void | setText (const QString &value) |
Properties | |
bool | checked |
When the StelAction is checkable, this may be used to get/set the current value. More... | |
bool | checkable |
If this is true, this StelAction can be toggled. More... | |
Friends | |
class | StelActionMgr |
Wrapper around an argumentless QObject slot or a bool Q_PROPERTY with WRITE method, allowing the slot to be called/property to be toggled using this action object.
The action object can be identified by a unique string, and found through StelActionMgr::findAction. Use StelActionMgr::addAction to define a new action. In StelModule subclasses, one can also use StelModule::addAction for convenience.
StelAction objects are intended for user interaction. They automatically show up in the hotkey configuration dialog (ShortcutsDialog), and can be bound to interface buttons (StelButton).
StelAction internally uses a StelProperty, if connected to a property. A new StelProperty with the name of the action is registered automatically in this case. A NOTIFY signal should be provided, though not strictly necessary, it is really recommended.
|
inline |
|
inline |
|
slot |
|
slot |
If the action is checkable, this toggles the value of the connected boolean property.
|
signal |
Emitted when the boolean state of this StelAction changes.
When the action is connected to a StelProperty, this is equivalent to the StelProperty::valueChanged signal. In the other cases, this state may not always be emitted correctly (i.e. when the state changes through other mechanisms than StelAction)
|
slot |
|
read |
If this is true, this StelAction can be toggled.
This is the case when connected to a boolean Q_PROPERTY. This means the checked property as well as the toggle() function may be used If false, the StelAction represents a simple argumentless slot call. Using checked or toggle() may result in an error.
|
readwrite |
When the StelAction is checkable, this may be used to get/set the current value.
Note that the toggled signal may not be emitted on all changes of the connected property