goldendict-ng/mruqmenu.cc

22 lines
484 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)
{
installEventFilter(this);
}
bool MRUQMenu::eventFilter(QObject *obj, QEvent *event)
{
2012-10-31 13:58:35 +00:00
(void) obj;
2011-11-02 23:37:50 +00:00
if (event->type() == QEvent::KeyRelease){
QKeyEvent *keyevent = static_cast<QKeyEvent*>(event);
if (keyevent->key() == Qt::Key_Control){
emit ctrlReleased();
return true;
}
}
return false;
}