| 47 | } |
| 48 | |
| 49 | bool ZoomEventWatcher::eventFilter(QObject *obj, QEvent *event) |
| 50 | { |
| 51 | if (event->type() == QEvent::Wheel) { |
| 52 | QWheelEvent *wheelEvent = static_cast<QWheelEvent *>(event); |
| 53 | |
| 54 | if (!isWheelEventHorizontal(wheelEvent)) { |
| 55 | if (QApplication::keyboardModifiers() & Qt::ControlModifier) { |
| 56 | if (wheelEventYDelta(wheelEvent) > 0) { |
| 57 | emit zoomIn(); |
| 58 | } else { |
| 59 | emit zoomOut(); |
| 60 | } |
| 61 | return true; |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | return QObject::eventFilter(obj, event); |
| 67 | } |
nothing calls this directly
no test coverage detected