Skip to content
Snippets Groups Projects
Commit 59ecb9cf authored by Jarek Kobus's avatar Jarek Kobus
Browse files

Changing the command's shortcut updates its internal actions.

If the command's shortcut is changed all context actions are updated
accordingly. When the new context action is added its shortcut is
automatically updated (taken from command's shortcut).

Reviewed-by: con
Task-number: QTCREATORBUG-471
parent a8667254
No related branches found
No related tags found
No related merge requests found
...@@ -500,6 +500,7 @@ void OverrideableAction::addOverrideAction(QAction *action, const QList<int> &co ...@@ -500,6 +500,7 @@ void OverrideableAction::addOverrideAction(QAction *action, const QList<int> &co
m_contextActionMap.insert(k, action); m_contextActionMap.insert(k, action);
} }
} }
action->setShortcut(OverrideableAction::action()->shortcut());
} }
void OverrideableAction::actionChanged() void OverrideableAction::actionChanged()
...@@ -529,3 +530,14 @@ bool OverrideableAction::isActive() const ...@@ -529,3 +530,14 @@ bool OverrideableAction::isActive() const
{ {
return m_active; return m_active;
} }
void OverrideableAction::setKeySequence(const QKeySequence &key)
{
QMap<int, QPointer<QAction> >::const_iterator it = m_contextActionMap.constBegin();
QMap<int, QPointer<QAction> >::const_iterator itEnd = m_contextActionMap.constEnd();
while (it != itEnd) {
it.value()->setShortcut(key);
++it;
}
Action::setKeySequence(key);
}
...@@ -143,6 +143,7 @@ public: ...@@ -143,6 +143,7 @@ public:
bool setCurrentContext(const QList<int> &context); bool setCurrentContext(const QList<int> &context);
void addOverrideAction(QAction *action, const QList<int> &context); void addOverrideAction(QAction *action, const QList<int> &context);
bool isActive() const; bool isActive() const;
void setKeySequence(const QKeySequence &key);
private slots: private slots:
void actionChanged(); void actionChanged();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment