MCPcopy Create free account
hub / github.com/KDE/okular / routeTabletEvent

Method routeTabletEvent

part/pageviewannotator.cpp:1244–1266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1242}
1243
1244QRect PageViewAnnotator::routeTabletEvent(QTabletEvent *e, PageViewItem *item, const QPoint localOriginInGlobal)
1245{
1246 // Unlike routeMouseEvent, routeTabletEvent must explicitly ignore events it doesn't care about so that
1247 // the corresponding mouse event will later be delivered.
1248 if (!item) {
1249 e->ignore();
1250 return QRect();
1251 }
1252
1253 AnnotatorEngine::EventType eventType;
1254 AnnotatorEngine::Button button;
1255 AnnotatorEngine::Modifiers modifiers;
1256
1257 // figure out the event type and button
1258 AnnotatorEngine::decodeEvent(e, &eventType, &button);
1259
1260 // Constrain angle if action checked XOR shift button pressed.
1261 modifiers.constrainRatioAndAngle = (bool(constrainRatioAndAngleActive()) != bool(e->modifiers() & Qt::ShiftModifier));
1262
1263 const QPointF globalPosF = e->globalPosition();
1264 const QPointF localPosF = globalPosF - localOriginInGlobal;
1265 return performRouteMouseOrTabletEvent(eventType, button, modifiers, localPosF, item);
1266}
1267
1268bool PageViewAnnotator::routeKeyEvent(QKeyEvent *event)
1269{

Callers 1

tabletEventMethod · 0.80

Calls 1

QRectClass · 0.50

Tested by

no test coverage detected