Skip to content

PythonQt.QtGui.QScreen · declarations 001

Back to PythonQt.QtGui.QScreen

angleBetween

angleBetween(a: Any, b: Any) -> int

X.angleBetween(a, b) -> int

Supplemental documentation: Qt 5 reference:

int QScreen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b) const

Convenience function to compute the angle of rotation to get from rotation a to rotation b.

The result will be 0, 90, 180, or 270.

Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().

Upstream PySide2 reference signatures (binding differences may apply):

angleBetween(self, a: PySide2.QtCore.Qt.ScreenOrientation, b: PySide2.QtCore.Qt.ScreenOrientation) -> int

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#angleBetween

availableGeometry instance-attribute

availableGeometry: QRect

Qt 5 reference:

availableGeometry : const QRect

This property holds the screen's available geometry in pixels

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

Note, on X11 this will return the true available geometry only on systems with one monitor and if window manager has set _NET_WORKAREA atom. In all other cases this is equal to geometry(). This is a limitation in X11 window manager specification.

Access functions:

QRect availableGeometry() const

Notifier signal:

void availableGeometryChanged(const QRect \&geometry)

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#availableGeometry

availableGeometryChanged

availableGeometryChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.availableGeometryChanged; argument details are not documented.

availableSize instance-attribute

availableSize: QSize

Qt 5 reference:

availableSize : const QSize

This property holds the screen's available size in pixels

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

Access functions:

QSize availableSize() const

Notifier signal:

void availableGeometryChanged(const QRect \&geometry)

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#availableSize

availableVirtualGeometry instance-attribute

availableVirtualGeometry: QRect

Qt 5 reference:

availableVirtualGeometry : const QRect

This property holds the available geometry of the virtual desktop to which this screen belongs

Returns the available geometry of the virtual desktop corresponding to this screen.

This is the union of the virtual siblings' individual available geometries.

Access functions:

QRect availableVirtualGeometry() const

Notifier signal:

void virtualGeometryChanged(const QRect \&rect)

See also availableGeometry() and virtualSiblings().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#availableVirtualGeometry

availableVirtualSize instance-attribute

availableVirtualSize: QSize

Qt 5 reference:

availableVirtualSize : const QSize

This property holds the available size of the virtual desktop to which this screen belongs

Returns the available pixel size of the virtual desktop corresponding to this screen.

This is the combined size of the virtual siblings' individual available geometries.

Access functions:

QSize availableVirtualSize() const

Notifier signal:

void virtualGeometryChanged(const QRect \&rect)

See also availableSize() and virtualSiblings().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#availableVirtualSize

depth instance-attribute

depth: int

Qt 5 reference:

depth : const int

This property holds the color depth of the screen

Access functions:

int depth() const

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#depth

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.destroyed; argument details are not documented.

devicePixelRatio instance-attribute

devicePixelRatio: float

Qt 5 reference:

devicePixelRatio : const qreal

This property holds the screen's ratio between physical pixels and device-independent pixels

Returns the ratio between physical pixels and device-independent pixels for the screen.

Common values are 1.0 on normal displays and 2.0 on "retina" displays. Higher values are also possible.

This property was introduced in Qt 5.5.

Access functions:

qreal devicePixelRatio() const

Notifier signal:

void physicalDotsPerInchChanged(qreal dpi)

See also QWindow::devicePixelRatio() and QGuiApplication::devicePixelRatio().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#devicePixelRatio

geometry instance-attribute

geometry: QRect

Qt 5 reference:

geometry : const QRect

This property holds the screen's geometry in pixels

As an example this might return QRect(0, 0, 1280, 1024), or in a virtual desktop setting QRect(1280, 0, 1280, 1024).

Access functions:

QRect geometry() const

Notifier signal:

void geometryChanged(const QRect \&geometry)

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#geometry

geometryChanged

geometryChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.geometryChanged; argument details are not documented.

grabWindow

grabWindow(window: int, x: int, y: int, w: int, h: int) -> Any

X.grabWindow(window, x, y, w, h) -> PythonQt.QtGui.QPixmap

Supplemental documentation: Qt 5 reference:

QPixmap QScreen::grabWindow(WId window, int x \= 0, int y \= 0, int width \= -1, int height \= -1)

Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by QRect(x, y, width, height).

The arguments (x, y) specify the offset in the window, whereas (width, height) specify the area to be copied. If width is negative, the function copies everything to the right border of the window. If height is negative, the function copies everything to the bottom of the window.

The offset and size arguments are specified in device independent pixels. The returned pixmap may be larger than the requested size when grabbing from a high-DPI screen. Call QPixmap::devicePixelRatio() to determine if this is the case.

The window system identifier (WId) can be retrieved using the QWidget::winId() function. The rationale for using a window identifier and not a QWidget, is to enable grabbing of windows that are not part of the application, window system frames, and so on.

Warning: Grabbing windows that are not part of the application is not supported on systems such as iOS, where sandboxing/security prevents reading pixels of windows not owned by the application.

The grabWindow() function grabs pixels from the screen, not from the window, i.e. if there is another window partially or entirely over the one you grab, you get pixels from the overlying window, too. The mouse cursor is generally not grabbed.

Note on X11 that if the given window doesn't have the same depth as the root window, and another window partially or entirely obscures the one you grab, you will not get pixels from the overlying window. The contents of the obscured areas in the pixmap will be undefined and uninitialized.

On Windows Vista and above grabbing a layered window, which is created by setting the Qt::WA_TranslucentBackground attribute, will not work. Instead grabbing the desktop widget should work.

Warning: In general, grabbing an area outside the screen is not safe. This depends on the underlying window system.

Upstream PySide2 reference signatures (binding differences may apply):

grabWindow(self, window: int, x: int=..., y: int=..., w: int=..., h: int=...) -> PySide2.QtGui.QPixmap

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#grabWindow

isLandscape

isLandscape(orientation: Any) -> bool

X.isLandscape(orientation) -> bool

Supplemental documentation: Qt 5 reference:

bool QScreen::isLandscape(Qt::ScreenOrientation o) const

Convenience function that returns true if o is either landscape or inverted landscape; otherwise returns false.

Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().

Upstream PySide2 reference signatures (binding differences may apply):

isLandscape(self, orientation: PySide2.QtCore.Qt.ScreenOrientation) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#isLandscape

isPortrait

isPortrait(orientation: Any) -> bool

X.isPortrait(orientation) -> bool

Supplemental documentation: Qt 5 reference:

bool QScreen::isPortrait(Qt::ScreenOrientation o) const

Convenience function that returns true if o is either portrait or inverted portrait; otherwise returns false.

Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().

Upstream PySide2 reference signatures (binding differences may apply):

isPortrait(self, orientation: PySide2.QtCore.Qt.ScreenOrientation) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#isPortrait

logicalDotsPerInch instance-attribute

logicalDotsPerInch: float

Qt 5 reference:

logicalDotsPerInch : const qreal

This property holds the number of logical dots or pixels per inch

This value can be used to convert font point sizes to pixel sizes.

This is a convenience property that's simply the average of the logicalDotsPerInchX and logicalDotsPerInchY properties.

Access functions:

qreal logicalDotsPerInch() const

Notifier signal:

void logicalDotsPerInchChanged(qreal dpi)

See also logicalDotsPerInchX() and logicalDotsPerInchY().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#logicalDotsPerInch

logicalDotsPerInchChanged

logicalDotsPerInchChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.logicalDotsPerInchChanged; argument details are not documented.

logicalDotsPerInchX instance-attribute

logicalDotsPerInchX: float

Qt 5 reference:

logicalDotsPerInchX : const qreal

This property holds the number of logical dots or pixels per inch in the horizontal direction

This value is used to convert font point sizes to pixel sizes.

Access functions:

qreal logicalDotsPerInchX() const

Notifier signal:

void logicalDotsPerInchChanged(qreal dpi)

See also logicalDotsPerInchY().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#logicalDotsPerInchX

logicalDotsPerInchY instance-attribute

logicalDotsPerInchY: float

Qt 5 reference:

logicalDotsPerInchY : const qreal

This property holds the number of logical dots or pixels per inch in the vertical direction

This value is used to convert font point sizes to pixel sizes.

Access functions:

qreal logicalDotsPerInchY() const

Notifier signal:

void logicalDotsPerInchChanged(qreal dpi)

See also logicalDotsPerInchX().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#logicalDotsPerInchY

manufacturer instance-attribute

manufacturer: str

Qt 5 reference:

manufacturer : const QString

This property holds the manufacturer of the screen

This property was introduced in Qt 5.9.

Access functions:

QString manufacturer() const

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#manufacturer

mapBetween

mapBetween(a: Any, b: Any, rect: Any) -> Any

X.mapBetween(a, b, rect) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRect QScreen::mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect \&rect) const

Maps the rect between two screen orientations.

This will flip the x and y dimensions of the rectangle rect if the orientation a is Qt::PortraitOrientation or Qt::InvertedPortraitOrientation and orientation b is Qt::LandscapeOrientation or Qt::InvertedLandscapeOrientation, or vice versa.

Qt::PrimaryOrientation is interpreted as the screen's primaryOrientation().

Upstream PySide2 reference signatures (binding differences may apply):

mapBetween(self, a: PySide2.QtCore.Qt.ScreenOrientation, b: PySide2.QtCore.Qt.ScreenOrientation, rect: PySide2.QtCore.QRect) -> PySide2.QtCore.QRect

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#mapBetween

model instance-attribute

model: str

Qt 5 reference:

model : const QString

This property holds the model of the screen

This property was introduced in Qt 5.9.

Access functions:

QString model() const

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#model

name instance-attribute

name: str

Qt 5 reference:

name : const QString

This property holds a user presentable string representing the screen

For example, on X11 these correspond to the XRandr screen names, typically "VGA1", "HDMI1", etc.

Access functions:

QString name() const

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#name

nativeOrientation instance-attribute

nativeOrientation: Any

Qt 5 reference:

nativeOrientation : const Qt::ScreenOrientation

This property holds the native screen orientation

The native orientation of the screen is the orientation where the logo sticker of the device appears the right way up, or Qt::PrimaryOrientation if the platform does not support this functionality.

The native orientation is a property of the hardware, and does not change.

This property was introduced in Qt 5.2.

Access functions:

Qt::ScreenOrientation nativeOrientation() const

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#nativeOrientation

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.objectNameChanged; argument details are not documented.

orientation instance-attribute

orientation: Any

Qt 5 reference:

orientation : const Qt::ScreenOrientation

This property holds the screen orientation

The screen orientation represents the physical orientation of the display. For example, the screen orientation of a mobile device will change based on how it is being held. A change to the orientation might or might not trigger a change to the primary orientation of the screen.

Changes to this property will be filtered by orientationUpdateMask(), so in order to receive orientation updates the application must first call setOrientationUpdateMask() with a mask of the orientations it wants to receive.

Qt::PrimaryOrientation is never returned.

Access functions:

Qt::ScreenOrientation orientation() const

Notifier signal:

void orientationChanged(Qt::ScreenOrientation orientation)

See also primaryOrientation().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#orientation

orientationChanged

orientationChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.orientationChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QScreen::orientationChanged(Qt::ScreenOrientation orientation)

This signal is emitted when the orientation of the screen changes with orientation as an argument.

Note: Notifier signal for property orientation.

See also orientation().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#orientationChanged

orientationUpdateMask

orientationUpdateMask() -> Any

X.orientationUpdateMask()

Supplemental documentation: Qt 5 reference:

Qt::ScreenOrientations QScreen::orientationUpdateMask() const

Returns the currently set orientation update mask.

See also setOrientationUpdateMask().

Upstream PySide2 reference signatures (binding differences may apply):

orientationUpdateMask(self) -> PySide2.QtCore.Qt.ScreenOrientations

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#orientationUpdateMask

physicalDotsPerInch instance-attribute

physicalDotsPerInch: float

Qt 5 reference:

physicalDotsPerInch : const qreal

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.

This is a convenience property that's simply the average of the physicalDotsPerInchX and physicalDotsPerInchY properties.

Access functions:

qreal physicalDotsPerInch() const

Notifier signal:

void physicalDotsPerInchChanged(qreal dpi)

See also physicalDotsPerInchX() and physicalDotsPerInchY().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#physicalDotsPerInch

physicalDotsPerInchChanged

physicalDotsPerInchChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.physicalDotsPerInchChanged; argument details are not documented.

physicalDotsPerInchX instance-attribute

physicalDotsPerInchX: float

Qt 5 reference:

physicalDotsPerInchX : const qreal

This property holds the number of physical dots or pixels per inch in the horizontal direction

This value represents the actual horizontal pixel density on the screen's display. Depending on what information the underlying system provides the value might not be entirely accurate.

Access functions:

qreal physicalDotsPerInchX() const

Notifier signal:

void physicalDotsPerInchChanged(qreal dpi)

See also physicalDotsPerInchY().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#physicalDotsPerInchX

physicalDotsPerInchY instance-attribute

physicalDotsPerInchY: float

Qt 5 reference:

physicalDotsPerInchY : const qreal

This property holds the number of physical dots or pixels per inch in the vertical direction

This value represents the actual vertical pixel density on the screen's display. Depending on what information the underlying system provides the value might not be entirely accurate.

Access functions:

qreal physicalDotsPerInchY() const

Notifier signal:

void physicalDotsPerInchChanged(qreal dpi)

See also physicalDotsPerInchX().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#physicalDotsPerInchY

physicalSize instance-attribute

physicalSize: QSizeF

Qt 5 reference:

physicalSize : const QSizeF

This property holds the screen's physical size (in millimeters)

The physical size represents the actual physical dimensions of the screen's display.

Depending on what information the underlying system provides the value might not be entirely accurate.

Access functions:

QSizeF physicalSize() const

Notifier signal:

void physicalSizeChanged(const QSizeF \&size)

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#physicalSize

physicalSizeChanged

physicalSizeChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.physicalSizeChanged; argument details are not documented.

primaryOrientation instance-attribute

primaryOrientation: Any

Qt 5 reference:

primaryOrientation : const Qt::ScreenOrientation

This property holds the primary screen orientation

The primary screen orientation is Qt::LandscapeOrientation if the screen geometry's width is greater than or equal to its height, or Qt::PortraitOrientation otherwise. This property might change when the screen orientation was changed (i.e. when the display is rotated). The behavior is however platform dependent and can often be specified in an application manifest file.

Access functions:

Qt::ScreenOrientation primaryOrientation() const

Notifier signal:

void primaryOrientationChanged(Qt::ScreenOrientation orientation)

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#primaryOrientation

primaryOrientationChanged

primaryOrientationChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.primaryOrientationChanged; argument details are not documented.

Supplemental documentation: Qt 5 reference:

[signal] void QScreen::primaryOrientationChanged(Qt::ScreenOrientation orientation)

This signal is emitted when the primary orientation of the screen changes with orientation as an argument.

Note: Notifier signal for property primaryOrientation.

See also primaryOrientation().

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#primaryOrientationChanged

refreshRate instance-attribute

refreshRate: float

Qt 5 reference:

refreshRate : const qreal

This property holds the approximate vertical refresh rate of the screen in Hz

Access functions:

qreal refreshRate() const

Notifier signal:

void refreshRateChanged(qreal refreshRate)

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#refreshRate

refreshRateChanged

refreshRateChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QScreen.refreshRateChanged; argument details are not documented.

serialNumber instance-attribute

serialNumber: str

Qt 5 reference:

serialNumber : const QString

This property holds the serial number of the screen

This property was introduced in Qt 5.9.

Access functions:

QString serialNumber() const

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#serialNumber

setOrientationUpdateMask

setOrientationUpdateMask(mask: Any) -> None

X.setOrientationUpdateMask(mask)

Supplemental documentation: Qt 5 reference:

void QScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask)

Sets the orientations that the application is interested in receiving updates for in conjunction with this screen.

For example, to receive orientation() updates and thus have orientationChanged() signals being emitted for LandscapeOrientation and InvertedLandscapeOrientation, call setOrientationUpdateMask() with mask set to Qt::LandscapeOrientation | Qt::InvertedLandscapeOrientation.

The default, 0, means no orientationChanged() signals are fired.

See also orientationUpdateMask().

Upstream PySide2 reference signatures (binding differences may apply):

setOrientationUpdateMask(self, mask: PySide2.QtCore.Qt.ScreenOrientations) -> None

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#setOrientationUpdateMask

size instance-attribute

size: QSize

Qt 5 reference:

size : const QSize

This property holds the pixel resolution of the screen

Access functions:

QSize size() const

Notifier signal:

void geometryChanged(const QRect \&geometry)

Source: https://doc.qt.io/archives/qt-5.15/qscreen.html#size