+ // in terms of video resolution:
+ x = (cam.videoResolution.width * x) / mouse.width;
+ width = (cam.videoResolution.width * width) / mouse.width;
+ y = (cam.videoResolution.height * y) / mouse.height;
+ height = (cam.videoResolution.height * height) / mouse.height;
+
+ // Translate to normalized coordinates (1x1 square) as expected by our C++ backend
+ x = x / cam.videoResolution.width;
+ width = width / cam.videoResolution.width;
+ y = y / cam.videoResolution.height;
+ height = height / cam.videoResolution.height;
+
+ cam.autoFocus.setRegionOfInterest(Qt.rect(x, y, width, height));
+ }
+
+ onReleased: {
+ moveToCenterIfNeeded(mouse.x, mouse.y);
+ setRegionOfInterest();
+ }
+
+ onPressed: {
+ moveReticle(mouse.x, mouse.y);