Class: QgsScreenProperties¶
Stores properties relating to a screen.
This class is designed to be a publicly constructible, copyable store for the properties available from a QScreen object.
Added in version 3.32.
Methods
Returns the ratio between physical pixels and device-independent pixels for the screen. |
|
Returns |
|
This property holds the number of physical dots or pixels per inch. |
|
Sets the ratio between physical pixels and device-independent pixels for the screen. |
|
Sets number of physical dots or pixels per inch. |
|
Updates the settings in a render context to match the screen settings. |
- class qgis.core.QgsScreenProperties[source]¶
Bases:
object
- __init__()
Constructor for invalid properties.
- __init__(screen: QScreen | None)
Constructor for QgsScreenProperties, copying properties from the specified
screen
.- Parameters:
screen (Optional[QScreen])
- __init__(a0: QgsScreenProperties)
- Parameters:
a0 (QgsScreenProperties)
- devicePixelRatio(self) float [source]¶
Returns the ratio between physical pixels and device-independent pixels for the screen.
This property holds the screen’s ratio between physical pixels and device-independent pixels.
Common values are 1.0 on normal displays and 2.0 on “retina” displays. Higher values are also possible.
See also
- Return type:
float
- physicalDpi(self) float [source]¶
This property holds the number of physical dots or pixels per inch.
This value represents the pixel density on the screen’s display. Depending on what information the underlying system provides the value might not be entirely accurate.
Note
Physical DPI is expressed in device-independent dots. Multiply by
devicePixelRatio()
to get device-dependent density.See also
- Return type:
float
- setDevicePixelRatio(self, ratio: float)[source]¶
Sets the
ratio
between physical pixels and device-independent pixels for the screen.This property holds the screen’s ratio between physical pixels and device-independent pixels.
Common values are 1.0 on normal displays and 2.0 on “retina” displays. Higher values are also possible.
See also
- Parameters:
ratio (float)
- setPhysicalDpi(self, dpi: float)[source]¶
Sets number of physical dots or pixels per inch.
This value represents the pixel density on the screen’s display. Depending on what information the underlying system provides the value might not be entirely accurate.
Note
Physical DPI is expressed in device-independent dots. Multiply by
devicePixelRatio()
to get device-dependent density.See also
- Parameters:
dpi (float)
- updateRenderContextForScreen(self, context: QgsRenderContext)[source]¶
Updates the settings in a render
context
to match the screen settings.- Parameters:
context (QgsRenderContext)