Hi Joachim!
To target the scene without moving upwards in your QML hierarchy using parent.parent… I suggest to give your scene an ID:
Scene {
id: myScene
// ...
}
You can then access e.g. myScene.xScaleForScene from any item within your scene.
In case you want to use your Canvas Item within multiple different scenes that have different identifiers, you can also add a property which you can set to the correct value when using your Canvas:
Scene {
id: scene
MyCanvasItem {
scaleFactor: scene.xScaleForScene
}
/*
MyCanvasItem must then define a property:
property real scaleFactor
which you can then use within the Canvas Item
*/
}
The uiScale does not affect the Scene scaling and only applies for items that use the scenes dp(…) or sp(…) functions to specify density-independent UI elements (e.g. items with a fixed width of dp(200) have the same size regardless of the device or actual scene scaling)). Changing the uiScale then allows making these elements bigger or smaller in your application. A uiScale of 2 is only the default value when testing the application on desktop. You can ignore this setting if you do not use the dp(…) or sp(…) functions in your project.
Based on your recent test on Windows I also assume that the issue is not related to scene scaling or the uiScale setting – maybe you’re right about the retina screen? You can also run a simple test with a plain Qt Quick Application (no Felgo) to see how the Qt Canvas behaves on different platforms / screens. If the issue persists, then this is definitely not Felgo related but a general Qt issue.
Best,
Günther