goldendict-ng/src/ui/mruqmenu.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
455 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();
}
};