globalScaleProperty
When using high DPI devices (dots per inch), the scene needs to be scaled, otherwise all the controls will be too small to be usable. In this case, coordinates used in Node and Scene aren't pixels. Instead, 1 logical unit
is 1 physical pixel on a low DPI device, but is globalScale physical pixels on a high DPI device.
While this was primarily designed for high-DPI monitors, it can also to scale the entire application to aid the visually impaired
When an application is started globalScale is based on the first of these :
The value of the environment variable
GDK_SCALE
The value of the environment variable
QT_SCALE_FACTOR
A guess is made based on the size in pixels of the display. Anything over 2000 pixels wide, globalScale is set to : round(SCREEN_WIDTH / 2000)
Unless stated otherwise, glok uses LogicalPixels. If the documentation uses the word pixels
, consider that a shorthand for LogicalPixels.
NOTE. When using high DPI monitors, mouse events will return non-integer values. For drawing applications, this can give higher fidelity, but in most other cases, the values MouseEventBase.sceneX and MouseEventBase.sceneY should be rounded before use.