Clear Hotkeys on Exit
This commit is contained in:
parent
d3d3f1e833
commit
aa77c14a51
@ -41,6 +41,13 @@ void hotkeying::load(QString seqName, std::function<void()> func, QString def) {
|
||||
;
|
||||
}
|
||||
|
||||
void hotkeying::clearAll() {
|
||||
for(QString e : hotkeys.keys()) {
|
||||
QHotkey *hk = hotkeys.value(e);
|
||||
hk->setRegistered(false);
|
||||
}
|
||||
}
|
||||
|
||||
bool hotkeying::valid(QString seq) {
|
||||
return seq.isEmpty() || !QKeySequence(seq).toString().isEmpty();
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ namespace hotkeying {
|
||||
void hotkey(QString seqName, QKeySequence seq, std::function<void()> func);
|
||||
bool valid(QString seq);
|
||||
void load(QString seqName, std::function<void()> func, QString def = QString());
|
||||
void clearAll();
|
||||
QString sequence(QString seqName);
|
||||
} // namespace hotkeying
|
||||
|
||||
|
@ -205,6 +205,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
}
|
||||
|
||||
void MainWindow::quit() {
|
||||
hotkeying::clearAll();
|
||||
QApplication::quit();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user