QtBase  v6.3.1
Signals | Public Member Functions | Properties | Friends | List of all members
QScreen Class Reference

The QScreen class is used to query screen properties. \inmodule QtGui. More...

#include <qscreen.h>

Inheritance diagram for QScreen:
Inheritance graph
[legend]
Collaboration diagram for QScreen:
Collaboration graph
[legend]

Signals

void geometryChanged (const QRect &geometry)
 
void availableGeometryChanged (const QRect &geometry)
 
void physicalSizeChanged (const QSizeF &size)
 
void physicalDotsPerInchChanged (qreal dpi)
 
void logicalDotsPerInchChanged (qreal dpi)
 
void virtualGeometryChanged (const QRect &rect)
 
void primaryOrientationChanged (Qt::ScreenOrientation orientation)
 
void orientationChanged (Qt::ScreenOrientation orientation)
 
void refreshRateChanged (qreal refreshRate)
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 

Public Member Functions

 ~QScreen ()
 
QPlatformScreenhandle () const
 
QString name () const
 
QString manufacturer () const
 
QString model () const
 
QString serialNumber () const
 
int depth () const
 
QSize size () const
 
QRect geometry () const
 
QSizeF physicalSize () const
 
qreal physicalDotsPerInchX () const
 
qreal physicalDotsPerInchY () const
 
qreal physicalDotsPerInch () const
 
qreal logicalDotsPerInchX () const
 
qreal logicalDotsPerInchY () const
 
qreal logicalDotsPerInch () const
 
qreal devicePixelRatio () const
 
QSize availableSize () const
 
QRect availableGeometry () const
 
QList< QScreen * > virtualSiblings () const
 
QScreenvirtualSiblingAt (QPoint point)
 
QSize virtualSize () const
 
QRect virtualGeometry () const
 
QSize availableVirtualSize () const
 
QRect availableVirtualGeometry () const
 
Qt::ScreenOrientation primaryOrientation () const
 
Qt::ScreenOrientation orientation () const
 
Qt::ScreenOrientation nativeOrientation () const
 
int angleBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b) const
 
QTransform transformBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) const
 
QRect mapBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) const
 
bool isPortrait (Qt::ScreenOrientation orientation) const
 
bool isLandscape (Qt::ScreenOrientation orientation) const
 
QPixmap grabWindow (WId window=0, int x=0, int y=0, int w=-1, int h=-1)
 
qreal refreshRate () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 
virtual ~QObject ()
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
QString objectName () const
 
void setObjectName (const QString &name)
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const noexcept
 
bool blockSignals (bool b) noexcept
 
QThreadthread () const
 
void moveToThread (QThread *thread)
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 
template<typename T >
T findChild (const QString &aName=QString(), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<typename T >
QList< TfindChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
const QObjectListchildren () const
 
void setParent (QObject *parent)
 
void installEventFilter (QObject *filterObj)
 
void removeEventFilter (QObject *obj)
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 
void dumpObjectInfo () const
 
bool setProperty (const char *name, const QVariant &value)
 
QVariant property (const char *name) const
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 
bool inherits (const char *classname) const
 

Properties

QString name
 a user presentable string representing the screen More...
 
QString manufacturer
 the manufacturer of the screen More...
 
QString model
 the model of the screen More...
 
QString serialNumber
 the serial number of the screen More...
 
int depth
 the color depth of the screen More...
 
QSize size
 the pixel resolution of the screen More...
 
QSize availableSize
 the screen's available size in pixels More...
 
QSize virtualSize
 the pixel size of the virtual desktop to which this screen belongs More...
 
QSize availableVirtualSize
 the available size of the virtual desktop to which this screen belongs More...
 
QRect geometry
 the screen's geometry in pixels More...
 
QRect availableGeometry
 the screen's available geometry in pixels More...
 
QRect virtualGeometry
 the pixel geometry of the virtual desktop to which this screen belongs More...
 
QRect availableVirtualGeometry
 the available geometry of the virtual desktop to which this screen belongs More...
 
QSizeF physicalSize
 the screen's physical size (in millimeters) More...
 
qreal physicalDotsPerInchX
 the number of physical dots or pixels per inch in the horizontal direction More...
 
qreal physicalDotsPerInchY
 the number of physical dots or pixels per inch in the vertical direction More...
 
qreal physicalDotsPerInch
 the number of physical dots or pixels per inch More...
 
qreal logicalDotsPerInchX
 the number of logical dots or pixels per inch in the horizontal direction More...
 
qreal logicalDotsPerInchY
 the number of logical dots or pixels per inch in the vertical direction More...
 
qreal logicalDotsPerInch
 the number of logical dots or pixels per inch More...
 
qreal devicePixelRatio
 the screen's ratio between physical pixels and device-independent pixels More...
 
Qt::ScreenOrientation primaryOrientation
 the primary screen orientation More...
 
Qt::ScreenOrientation orientation
 the screen orientation More...
 
Qt::ScreenOrientation nativeOrientation
 the native screen orientation More...
 
qreal refreshRate
 the approximate vertical refresh rate of the screen in Hz More...
 
- Properties inherited from QObject
QString objectName
 the name of this object More...
 

Friends

class QGuiApplicationPrivate
 
class QPlatformIntegration
 
class QPlatformScreen
 
class QHighDpiScaling
 
class QWindowSystemInterface
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
static QMetaObject::Connection ::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 slot)
 
template<typename Func1 , typename Func2 >
static std::enable_if< QtPrivate::FunctionPointer< Func2 >::ArgumentCount==-1 &&!std::is_convertible_v< Func2, const char * >, QMetaObject::Connection >::type connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 
virtual void childEvent (QChildEvent *event)
 
virtual void customEvent (QEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Detailed Description

The QScreen class is used to query screen properties. \inmodule QtGui.

Since
5.0

A note on logical vs physical dots per inch: physical DPI is based on the actual physical pixel sizes when available, and is useful for print preview and other cases where it's desirable to know the exact physical dimensions of screen displayed contents.

Logical dots per inch are used to convert font and user interface elements from point sizes to pixel sizes, and might be different from the physical dots per inch. The logical dots per inch are sometimes user-settable in the desktop environment's settings panel, to let the user globally control UI and font sizes in different applications.

Note
Both physical and logical DPI are expressed in device-independent dots. Multiply by QScreen::devicePixelRatio() to get device-dependent density.

\inmodule QtGui

Definition at line 67 of file qscreen.h.

Constructor & Destructor Documentation

◆ ~QScreen()

QScreen::~QScreen ( )

Destroys the screen.

Definition at line 132 of file qscreen.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ angleBetween()

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().

Definition at line 606 of file qscreen.cpp.

Here is the call graph for this function:

◆ availableGeometry()

QRect QScreen::availableGeometry ( ) const

Definition at line 434 of file qscreen.cpp.

◆ availableGeometryChanged

void QScreen::availableGeometryChanged ( const QRect geometry)
signal

◆ availableSize()

QSize QScreen::availableSize ( ) const

Definition at line 404 of file qscreen.cpp.

◆ availableVirtualGeometry()

QRect QScreen::availableVirtualGeometry ( ) const

Definition at line 517 of file qscreen.cpp.

Here is the call graph for this function:

◆ availableVirtualSize()

QSize QScreen::availableVirtualSize ( ) const

Definition at line 502 of file qscreen.cpp.

Here is the call graph for this function:

◆ depth()

int QScreen::depth ( ) const

Definition at line 236 of file qscreen.cpp.

◆ devicePixelRatio()

qreal QScreen::devicePixelRatio ( ) const

Definition at line 375 of file qscreen.cpp.

Here is the call graph for this function:

◆ geometry()

QRect QScreen::geometry ( ) const

Definition at line 417 of file qscreen.cpp.

◆ geometryChanged

void QScreen::geometryChanged ( const QRect geometry)
signal

◆ grabWindow()

QPixmap QScreen::grabWindow ( WId  window = 0,
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). If window is 0, then the entire screen will be grabbed.

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.

Definition at line 772 of file qscreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle()

QPlatformScreen * QScreen::handle ( ) const

Get the platform screen handle.

See also
{Qt Platform Abstraction}{Qt Platform Abstraction (QPA)}

Definition at line 177 of file qscreen.cpp.

Here is the caller graph for this function:

◆ isLandscape()

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().

Definition at line 678 of file qscreen.cpp.

Here is the caller graph for this function:

◆ isPortrait()

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().

Definition at line 666 of file qscreen.cpp.

◆ logicalDotsPerInch()

qreal QScreen::logicalDotsPerInch ( ) const

Definition at line 356 of file qscreen.cpp.

Here is the call graph for this function:

◆ logicalDotsPerInchChanged

void QScreen::logicalDotsPerInchChanged ( qreal  dpi)
signal

◆ logicalDotsPerInchX()

qreal QScreen::logicalDotsPerInchX ( ) const

Definition at line 320 of file qscreen.cpp.

Here is the call graph for this function:

◆ logicalDotsPerInchY()

qreal QScreen::logicalDotsPerInchY ( ) const

Definition at line 336 of file qscreen.cpp.

Here is the call graph for this function:

◆ manufacturer()

QString QScreen::manufacturer ( ) const

Definition at line 202 of file qscreen.cpp.

◆ mapBetween()

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().

Definition at line 649 of file qscreen.cpp.

Here is the call graph for this function:

◆ model()

QString QScreen::model ( ) const

Definition at line 214 of file qscreen.cpp.

◆ name()

QString QScreen::name ( ) const

Definition at line 190 of file qscreen.cpp.

Here is the caller graph for this function:

◆ nativeOrientation()

Qt::ScreenOrientation QScreen::nativeOrientation ( ) const

Definition at line 592 of file qscreen.cpp.

◆ orientation()

Qt::ScreenOrientation QScreen::orientation ( ) const

Definition at line 541 of file qscreen.cpp.

◆ orientationChanged

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

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

See also
orientation()
Here is the caller graph for this function:

◆ physicalDotsPerInch()

qreal QScreen::physicalDotsPerInch ( ) const

Definition at line 305 of file qscreen.cpp.

Here is the call graph for this function:

◆ physicalDotsPerInchChanged

void QScreen::physicalDotsPerInchChanged ( qreal  dpi)
signal

◆ physicalDotsPerInchX()

qreal QScreen::physicalDotsPerInchX ( ) const

Definition at line 265 of file qscreen.cpp.

Here is the call graph for this function:

◆ physicalDotsPerInchY()

qreal QScreen::physicalDotsPerInchY ( ) const

Definition at line 283 of file qscreen.cpp.

Here is the call graph for this function:

◆ physicalSize()

QSizeF QScreen::physicalSize ( ) const

Definition at line 391 of file qscreen.cpp.

◆ physicalSizeChanged

void QScreen::physicalSizeChanged ( const QSizeF size)
signal

◆ primaryOrientation()

Qt::ScreenOrientation QScreen::primaryOrientation ( ) const

Definition at line 575 of file qscreen.cpp.

◆ primaryOrientationChanged

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

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

See also
primaryOrientation()

◆ refreshRate()

qreal QScreen::refreshRate ( ) const

Definition at line 556 of file qscreen.cpp.

◆ refreshRateChanged

void QScreen::refreshRateChanged ( qreal  refreshRate)
signal

◆ serialNumber()

QString QScreen::serialNumber ( ) const

Definition at line 226 of file qscreen.cpp.

◆ size()

QSize QScreen::size ( ) const

Definition at line 246 of file qscreen.cpp.

◆ transformBetween()

QTransform QScreen::transformBetween ( Qt::ScreenOrientation  a,
Qt::ScreenOrientation  b,
const QRect target 
) const

Convenience function to compute a transform that maps from the coordinate system defined by orientation a into the coordinate system defined by orientation b and target dimensions target.

Example, a is Qt::Landscape, b is Qt::Portrait, and target is QRect(0, 0, w, h) the resulting transform will be such that the point QPoint(0, 0) is mapped to QPoint(0, w), and QPoint(h, w) is mapped to QPoint(0, h). Thus, the landscape coordinate system QRect(0, 0, h, w) is mapped (with a 90 degree rotation) into the portrait coordinate system QRect(0, 0, w, h).

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

Definition at line 629 of file qscreen.cpp.

Here is the call graph for this function:

◆ virtualGeometry()

QRect QScreen::virtualGeometry ( ) const

Definition at line 483 of file qscreen.cpp.

Here is the call graph for this function:

◆ virtualGeometryChanged

void QScreen::virtualGeometryChanged ( const QRect rect)
signal

◆ virtualSiblingAt()

QScreen * QScreen::virtualSiblingAt ( QPoint  point)

Returns the screen at point within the set of \l QScreen::virtualSiblings(), or nullptr if outside of any screen.

The point is in relation to the virtualGeometry() of each set of virtual siblings.

Since
5.15

Definition at line 716 of file qscreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ virtualSiblings()

QList< QScreen * > QScreen::virtualSiblings ( ) const

Get the screen's virtual siblings.

The virtual siblings are the screen instances sharing the same virtual desktop. They share a common coordinate system, and windows can freely be moved or positioned across them without having to be re-created.

Definition at line 447 of file qscreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ virtualSize()

QSize QScreen::virtualSize ( ) const

Definition at line 468 of file qscreen.cpp.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ QGuiApplicationPrivate

friend class QGuiApplicationPrivate
friend

Definition at line 173 of file qscreen.h.

◆ QHighDpiScaling

friend class QHighDpiScaling
friend

Definition at line 176 of file qscreen.h.

◆ QPlatformIntegration

friend class QPlatformIntegration
friend

Definition at line 174 of file qscreen.h.

◆ QPlatformScreen

friend class QPlatformScreen
friend

Definition at line 175 of file qscreen.h.

◆ QWindowSystemInterface

friend class QWindowSystemInterface
friend

Definition at line 177 of file qscreen.h.

Property Documentation

◆ availableGeometry

QScreen::availableGeometry
read

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.

Definition at line 184 of file qscreen.h.

◆ availableSize

QScreen::availableSize
read

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.

Definition at line 184 of file qscreen.h.

◆ availableVirtualGeometry

QScreen::availableVirtualGeometry
read

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.

See also
availableGeometry(), virtualSiblings()

Definition at line 184 of file qscreen.h.

◆ availableVirtualSize

QScreen::availableVirtualSize
read

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.

See also
availableSize(), virtualSiblings()

Definition at line 184 of file qscreen.h.

◆ depth

QScreen::depth
read

the color depth of the screen

Definition at line 184 of file qscreen.h.

◆ devicePixelRatio

QScreen::devicePixelRatio
read

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

Since
5.5

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.

See also
QWindow::devicePixelRatio(), QGuiApplication::devicePixelRatio()

Definition at line 184 of file qscreen.h.

◆ geometry

QScreen::geometry
read

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).

Definition at line 184 of file qscreen.h.

◆ logicalDotsPerInch

QScreen::logicalDotsPerInch
read

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.

See also
logicalDotsPerInchX()
logicalDotsPerInchY()

Definition at line 184 of file qscreen.h.

◆ logicalDotsPerInchX

QScreen::logicalDotsPerInchX
read

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.

See also
logicalDotsPerInchY()

Definition at line 184 of file qscreen.h.

◆ logicalDotsPerInchY

QScreen::logicalDotsPerInchY
read

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.

See also
logicalDotsPerInchX()

Definition at line 184 of file qscreen.h.

◆ manufacturer

QScreen::manufacturer
read

the manufacturer of the screen

Since
5.9

Definition at line 184 of file qscreen.h.

◆ model

QScreen::model
read

the model of the screen

Since
5.9

Definition at line 184 of file qscreen.h.

◆ name

QScreen::name
read

a user presentable string representing the screen

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

Definition at line 184 of file qscreen.h.

◆ nativeOrientation

QScreen::nativeOrientation
read

the native screen orientation

Since
5.2

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.

Definition at line 184 of file qscreen.h.

◆ orientation

QScreen::orientation
read

the screen orientation

The orientation property tells the orientation of the screen from the window system perspective.

Most mobile devices and tablet computers contain accelerometer sensors. The Qt Sensors module provides the ability to read this sensor directly. However, the windowing system may rotate the entire screen automatically based on how it is being held; in that case, this orientation property will change.

See also
primaryOrientation(), QWindow::contentOrientation()

Definition at line 184 of file qscreen.h.

◆ physicalDotsPerInch

QScreen::physicalDotsPerInch
read

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.

Note
Physical DPI is expressed in device-independent dots. Multiply by QScreen::devicePixelRatio() to get device-dependent density.
See also
physicalDotsPerInchX()
physicalDotsPerInchY()

Definition at line 184 of file qscreen.h.

◆ physicalDotsPerInchX

QScreen::physicalDotsPerInchX
read

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.

Note
Physical DPI is expressed in device-independent dots. Multiply by QScreen::devicePixelRatio() to get device-dependent density.
See also
physicalDotsPerInchY()

Definition at line 184 of file qscreen.h.

◆ physicalDotsPerInchY

QScreen::physicalDotsPerInchY
read

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.

Note
Physical DPI is expressed in device-independent dots. Multiply by QScreen::devicePixelRatio() to get device-dependent density.
See also
physicalDotsPerInchX()

Definition at line 184 of file qscreen.h.

◆ physicalSize

QScreen::physicalSize
read

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.

Definition at line 184 of file qscreen.h.

◆ primaryOrientation

QScreen::primaryOrientation
read

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.

Definition at line 184 of file qscreen.h.

◆ refreshRate

QScreen::refreshRate
read

the approximate vertical refresh rate of the screen in Hz

Warning
Avoid using the screen's refresh rate to drive animations via a timer such as QTimer. Instead use QWindow::requestUpdate().
See also
QWindow::requestUpdate()

Definition at line 184 of file qscreen.h.

◆ serialNumber

QScreen::serialNumber
read

the serial number of the screen

Since
5.9

Definition at line 184 of file qscreen.h.

◆ size

QScreen::size
read

the pixel resolution of the screen

Definition at line 184 of file qscreen.h.

◆ virtualGeometry

QScreen::virtualGeometry
read

the pixel geometry of the virtual desktop to which this screen belongs

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

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

See also
virtualSiblings()

Definition at line 184 of file qscreen.h.

◆ virtualSize

QScreen::virtualSize
read

the pixel size of the virtual desktop to which this screen belongs

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

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

See also
virtualSiblings()

Definition at line 184 of file qscreen.h.


The documentation for this class was generated from the following files: