mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
21 lines
440 B
C++
21 lines
440 B
C++
#include "mruqmenu.hh"
|
|
#include <QKeyEvent>
|
|
|
|
MRUQMenu::MRUQMenu(const QString title, QWidget *parent):
|
|
QMenu(title,parent)
|
|
{}
|
|
|
|
void MRUQMenu::keyReleaseEvent (QKeyEvent * kev){
|
|
if (kev->key() == Qt::Key_Control && actions().size() > 1){
|
|
QAction *act = activeAction();
|
|
if( act == nullptr ){
|
|
act = actions().at( 1 );
|
|
}
|
|
emit requestTabChange( act->data().toInt() );
|
|
hide();
|
|
}
|
|
else {
|
|
kev->ignore();
|
|
}
|
|
};
|