20 #ifndef _STELACTIONMGR_HPP_
21 #define _STELACTIONMGR_HPP_
24 #include <QKeySequence>
32 Q_PROPERTY(
bool checked READ isChecked WRITE setChecked NOTIFY toggled)
48 const QString& groupId,
50 const QString& primaryKey=
"",
51 const QString& altKey=
"",
61 bool isCheckable()
const {
return checkable;}
62 bool isChecked()
const {
return checked;}
63 bool isGlobal()
const {
return global;}
64 void setShortcut(
const QString& key);
65 void setAltShortcut(
const QString& key);
66 QKeySequence::SequenceMatch matches(
const QKeySequence& seq)
const;
68 QString getId()
const {
return objectName();}
69 QString getGroup()
const {
return group;}
70 const QKeySequence getShortcut()
const {
return keySequence;}
71 const QKeySequence getAltShortcut()
const {
return altKeySequence;}
72 QString getText()
const;
73 void setText(
const QString& value) {text = value; emit changed();}
79 void setChecked(
bool);
83 void propertyChanged(
bool);
90 QKeySequence keySequence;
91 QKeySequence altKeySequence;
92 const QKeySequence defaultKeySequence;
93 const QKeySequence defaultAltKeySequence;
101 #ifndef USE_QUICKVIEW
105 class QAction* qAction;
128 QObject* target,
const char* slot,
129 const QString& shortcut=
"",
const QString& altShortcut=
"",
132 bool pushKey(
int key,
bool global=
false);
134 QStringList getGroupList()
const;
135 QList<StelAction*> getActionList(
const QString& group)
const;
149 QList<int> keySequence;
152 #endif // _STELACTIONMGR_HPP_
StelAction * addAction(const QString &id, const QString &groupId, const QString &text, QObject *target, const char *slot, const QString &shortcut="", const QString &altShortcut="", bool global=false)
Create and add a new StelAction, connected to an object property or slot.
StelAction(QObject *parent)
Don't use this constructor, this is just there to ease the migration from QAction.
void connectToObject(QObject *obj, const char *slot)
Connect the action to an object property or slot.
void setCheckable(bool value)
Don't use setCheckable, connectToObject can automatically determine if the action is checkable or not...
void restoreDefaultShortcuts()
Restore the default shortcuts combinations.
void saveShortcuts()
Save current shortcuts to file.
void setAllActionsEnabled(bool value)
Enable/disable all actions of application.