Class: QgsScreenHelper

A utility class for dynamic handling of changes to screen properties.

Added in version 3.28.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsScreenHelper

Base classes

QObject

Methods

availableGeometry

Returns the current screen available geometry in pixels.

screen

Returns the screen that the parent widget appears on, or None.

screenDpi

Returns the current screen DPI for the screen that the parent widget appears on.

windowHandle

Returns the window handle for the window the parent widget is associated with, or None.

Signals

availableGeometryChanged

Emitted whenever the available geometry of the screen associated with the widget is changed.

screenDpiChanged

Emitted whenever the screen dpi associated with the widget is changed.

class qgis.gui.QgsScreenHelper[source]

Bases: QObject

__init__(parent: QWidget | None)

Constructor for QgsScreenHelper for the specified parent widget.

Parameters:

parent (Optional[QWidget])

availableGeometry(self) QRect[source]

Returns the current screen available geometry in pixels.

The available geometry is the geometry excluding window manager reserved areas such as task bars and system menus.

Return type:

QRect

signal availableGeometryChanged(geometry: QRect)[source]

Emitted whenever the available geometry of the screen associated with the widget is changed.

Parameters:

geometry (QRect)

screen(self) QScreen | None[source]

Returns the screen that the parent widget appears on, or None.

Return type:

Optional[QScreen]

screenDpi(self) float[source]

Returns the current screen DPI for the screen that the parent widget appears on.

Return type:

float

signal screenDpiChanged(dpi: float)[source]

Emitted whenever the screen dpi associated with the widget is changed.

See also

screenDpi()

Parameters:

dpi (float)

windowHandle(self) QWindow | None[source]

Returns the window handle for the window the parent widget is associated with, or None.

Return type:

Optional[QWindow]