MCPcopy Create free account
hub / github.com/YACReader/yacreader / keyPressEvent

Method keyPressEvent

shortcuts_management/edit_shortcut_item_delegate.cpp:91–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void KeySequenceLineEdit::keyPressEvent(QKeyEvent *e)
92{
93 int key = e->key();
94
95 // if ( numKeys > 3 ||
96 if (key == Qt::Key_Control ||
97 key == Qt::Key_Shift ||
98 key == Qt::Key_Meta ||
99 key == Qt::Key_Alt)
100 return;
101
102 key |= translateModifiers(e->modifiers(), e->text());
103
104 /*switch (numKeys) {
105 case 0:
106 keys[0] = nextKey;
107 break;
108 case 1:
109 keys[1] = nextKey;
110 break;
111 case 2:
112 keys[2] = nextKey;
113 break;
114 case 3:
115 keys[3] = nextKey;
116 break;
117 default:
118 break;
119 }*/
120 // numKeys++;
121 QKeySequence keySequence = QKeySequence(key);
122 setText(keySequence.toString(QKeySequence::NativeText));
123 e->accept();
124}
125
126int KeySequenceLineEdit::translateModifiers(Qt::KeyboardModifiers state,
127 const QString &text)

Callers

nothing calls this directly

Calls 2

textMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected