mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
22 lines
484 B
C++
22 lines
484 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)
|
|
{
|
|
(void) obj;
|
|
if (event->type() == QEvent::KeyRelease){
|
|
QKeyEvent *keyevent = static_cast<QKeyEvent*>(event);
|
|
if (keyevent->key() == Qt::Key_Control){
|
|
emit ctrlReleased();
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|