MCPcopy Create free account
hub / github.com/LibreVR/Revive / event

Method event

ReviveOverlay/qquickwindowscaled.cpp:23–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23bool 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected