| 21 | } |
| 22 | |
| 23 | bool QQuickWindowScaled::event(QEvent *e) |
| 24 | { |
| 25 | // Scale any mouse event to the render target |
| 26 | QMouseEvent* mouse = dynamic_cast<QMouseEvent*>(e); |
| 27 | if (mouse && mouse->source() != Qt::MouseEventSynthesizedByApplication) |
| 28 | { |
| 29 | QSize rtSize = this->renderTargetSize(); |
| 30 | QPointF scalar(rtSize.width() / (float)this->width(), rtSize.height() / (float)this->height()); |
| 31 | QMouseEvent scaled(mouse->type(), mouse->localPos() * scalar, mouse->windowPos() * scalar, mouse->screenPos() * scalar, mouse->button(), |
| 32 | mouse->buttons(), mouse->modifiers(), mouse->source()); |
| 33 | return QQuickWindow::event(&scaled); |
| 34 | } |
| 35 | return QQuickWindow::event(e); |
| 36 | } |
nothing calls this directly
no outgoing calls
no test coverage detected