Class: QgsScreenHelper

class qgis.gui.QgsScreenHelper

Bases: PyQt5.QtCore.QObject

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

New in version 3.28.

QgsScreenHelper(parent: QWidget) Constructor for QgsScreenHelper for the specified parent widget.

Methods

availableGeometry

Returns the current screen available geometry in pixels.

childEvent

connectNotify

customEvent

disconnectNotify

eventFilter

param watched

isSignalConnected

receivers

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.

sender

senderSignalIndex

timerEvent

windowHandle

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

Signals

availableGeometryChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

screenDpiChanged

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

availableGeometry(self) QRect

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

availableGeometryChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
eventFilter(self, watched: QObject, event: QEvent) bool
Parameters
  • watched (QObject) –

  • event (QEvent) –

Return type

bool

isSignalConnected(self, QMetaMethod) bool
receivers(self, PYQT_SIGNAL) int
screen(self) QScreen

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

Return type

QScreen

screenDpi(self) float

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

Return type

float

screenDpiChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type

PYQT_SIGNAL

sender(self) QObject
senderSignalIndex(self) int
timerEvent(self, QTimerEvent)
windowHandle(self) QWindow

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

Return type

QWindow