MCPcopy Create free account
hub / github.com/KDAB/GammaRay / keyPressEvent

Method keyPressEvent

ui/remoteviewwidget.cpp:1180–1206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1178}
1179
1180void RemoteViewWidget::keyPressEvent(QKeyEvent *event)
1181{
1182 if (m_interactionMode != NoInteraction
1183 && m_interactionMode != ViewInteraction
1184 && event->key() == Qt::Key_Control) {
1185
1186 setCursor(Qt::OpenHandCursor);
1187 }
1188 switch (m_interactionMode) {
1189 case NoInteraction:
1190 case ViewInteraction:
1191 case ElementPicking:
1192 case Measuring:
1193 break;
1194 case InputRedirection:
1195 sendKeyEvent(event);
1196 break;
1197 case ColorPicking:
1198 if (event->matches(QKeySequence::Copy)) {
1199 QMimeData *data = new QMimeData();
1200 data->setColorData(m_trailingColorLabel->pickedColor());
1201 qApp->clipboard()->setMimeData(data);
1202 qApp->clipboard()->setText(m_trailingColorLabel->pickedColor().name());
1203 }
1204 }
1205 QWidget::keyPressEvent(event);
1206}
1207
1208void RemoteViewWidget::keyReleaseEvent(QKeyEvent *event)
1209{

Callers

nothing calls this directly

Calls 5

keyMethod · 0.80
matchesMethod · 0.80
pickedColorMethod · 0.80
setTextMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected