| 2194 | } |
| 2195 | |
| 2196 | void PageView::tabletEvent(QTabletEvent *e) |
| 2197 | { |
| 2198 | // Ignore tablet events that we don't care about |
| 2199 | if (!(e->type() == QEvent::TabletPress || e->type() == QEvent::TabletRelease || e->type() == QEvent::TabletMove)) { |
| 2200 | e->ignore(); |
| 2201 | return; |
| 2202 | } |
| 2203 | |
| 2204 | // Determine pen state |
| 2205 | bool penReleased = false; |
| 2206 | if (e->type() == QEvent::TabletPress) { |
| 2207 | d->penDown = true; |
| 2208 | } |
| 2209 | if (e->type() == QEvent::TabletRelease) { |
| 2210 | d->penDown = false; |
| 2211 | penReleased = true; |
| 2212 | } |
| 2213 | |
| 2214 | // If we're editing an annotation and the tablet pen is either down or just released |
| 2215 | // then dispatch event to annotator |
| 2216 | if (d->annotator && d->annotator->active() && (d->penDown || penReleased)) { |
| 2217 | // accept the event, otherwise it comes back as a mouse event |
| 2218 | e->accept(); |
| 2219 | |
| 2220 | const QPointF eventPos = contentAreaPoint(e->position()); |
| 2221 | PageViewItem *pageItem = pickItemOnPoint(eventPos.x(), eventPos.y()); |
| 2222 | const QPoint localOriginInGlobal = mapToGlobal(QPoint(0, 0)); |
| 2223 | |
| 2224 | // routeTabletEvent will accept or ignore event as appropriate |
| 2225 | d->annotator->routeTabletEvent(e, pageItem, localOriginInGlobal); |
| 2226 | } else { |
| 2227 | e->ignore(); |
| 2228 | } |
| 2229 | } |
| 2230 | |
| 2231 | void PageView::continuousZoom(double delta) |
| 2232 | { |
nothing calls this directly
no test coverage detected