35 if (event->type() == QEvent::KeyPress)
37 QKeyEvent* keyEvent =
static_cast<QKeyEvent*
>(event);
39 int keyInt = keyEvent->key();
40 Qt::Key key =
static_cast<Qt::Key
>(keyInt);
42 if (key == Qt::Key_unknown)
48 if (key == Qt::Key_Control ||
49 key == Qt::Key_Shift ||
57 Qt::KeyboardModifiers modifiers = keyEvent->modifiers();
58 QString keyText = keyEvent->text();
61 QList<Qt::Key> modifiersList;
63 if (modifiers & Qt::ShiftModifier)
68 if (modifiers & Qt::ControlModifier)
73 if (modifiers & Qt::AltModifier)
78 if (modifiers & Qt::MetaModifier)
83 this->setText(QKeySequence(keyInt).
toString(QKeySequence::NativeText));