goldendict-ng/mruqmenu.cc

21 lines
440 B
C++
Raw Normal View History

2011-11-02 23:37:50 +00:00
#include "mruqmenu.hh"
#include <QKeyEvent>
MRUQMenu::MRUQMenu(const QString title, QWidget *parent):
QMenu(title,parent)
{}
2011-11-02 23:37:50 +00:00
void MRUQMenu::keyReleaseEvent (QKeyEvent * kev){
if (kev->key() == Qt::Key_Control && actions().size() > 1){
QAction *act = activeAction();
if( act == nullptr ){
act = actions().at( 1 );
2011-11-02 23:37:50 +00:00
}
emit requestTabChange( act->data().toInt() );
hide();
}
else {
kev->ignore();
}
};