Merge pull request #620 from turtletooth/shortcutwindow
Fixed remove shortcut not updating, added focus when item selected
This commit is contained in:
commit
b2a562cb68
1 changed files with 2 additions and 3 deletions
|
@ -49,8 +49,7 @@ public:
|
||||||
text.remove("&");
|
text.remove("&");
|
||||||
setText(0, text);
|
setText(0, text);
|
||||||
QString shortcut = m_action->shortcut().toString();
|
QString shortcut = m_action->shortcut().toString();
|
||||||
if (shortcut != "")
|
setText(1, shortcut);
|
||||||
setText(1, shortcut);
|
|
||||||
}
|
}
|
||||||
QAction *getAction() const { return m_action; }
|
QAction *getAction() const { return m_action; }
|
||||||
};
|
};
|
||||||
|
@ -90,6 +89,7 @@ void ShortcutViewer::paintEvent(QPaintEvent *) {
|
||||||
void ShortcutViewer::setAction(QAction *action) {
|
void ShortcutViewer::setAction(QAction *action) {
|
||||||
m_action = action;
|
m_action = action;
|
||||||
update();
|
update();
|
||||||
|
setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -171,7 +171,6 @@ void ShortcutViewer::enterEvent(QEvent *event) {
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void ShortcutViewer::leaveEvent(QEvent *event) {
|
void ShortcutViewer::leaveEvent(QEvent *event) {
|
||||||
clearFocus();
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue