goldendict-ng/mruqmenu.cc
2012-02-17 00:00:00 +02:00

21 lines
468 B
C++

#include "mruqmenu.hh"
#include <QKeyEvent>
MRUQMenu::MRUQMenu(const QString title, QWidget *parent):
QMenu(title,parent)
{
installEventFilter(this);
}
bool MRUQMenu::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyRelease){
QKeyEvent *keyevent = static_cast<QKeyEvent*>(event);
if (keyevent->key() == Qt::Key_Control){
emit ctrlReleased();
return true;
}
}
return false;
}