![]() |
Qt 6.x
The Qt SDK
|
Windows screen. More...
#include <qwindowsscreen.h>
Public Types | |
using | CursorPtr = QScopedPointer< QPlatformCursor > |
![]() | |
enum | SubpixelAntialiasingType { Subpixel_None , Subpixel_RGB , Subpixel_BGR , Subpixel_VRGB , Subpixel_VBGR } |
enum | PowerState { PowerStateOn , PowerStateStandby , PowerStateSuspend , PowerStateOff } |
Public Member Functions | |
QWindowsScreen (const QWindowsScreenData &data) | |
QRect | geometry () const override |
Reimplement in subclass to return the pixel geometry of the screen. | |
QRect | availableGeometry () const override |
Reimplement in subclass to return the pixel geometry of the available space This normally is the desktop screen minus the task manager, global menubar etc. | |
int | depth () const override |
Reimplement in subclass to return current depth of the screen. | |
QImage::Format | format () const override |
Reimplement in subclass to return the image format which corresponds to the screen format. | |
QSizeF | physicalSize () const override |
Reimplement this function in subclass to return the physical size of the screen, in millimeters. | |
QDpi | logicalDpi () const override |
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch metrics of the screen. | |
QDpi | logicalBaseDpi () const override |
Reimplement to return the base logical DPI for the platform. | |
qreal | devicePixelRatio () const override |
Reimplement this function in subclass to return the device pixel ratio for the screen. | |
qreal | refreshRate () const override |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz. | |
QString | name () const override |
QString | manufacturer () const override |
Reimplement this function in subclass to return the manufacturer of this screen. | |
QString | model () const override |
Reimplement this function in subclass to return the model of this screen. | |
QString | serialNumber () const override |
Reimplement this function in subclass to return the serial number of this screen. | |
Qt::ScreenOrientation | orientation () const override |
Reimplement this function in subclass to return the current orientation of the screen, for example based on accelerometer data to determine the device orientation. | |
QList< QPlatformScreen * > | virtualSiblings () const override |
Determine siblings in a virtual desktop system. | |
QWindow * | topLevelAt (const QPoint &point) const override |
Find a top level window taking the flags of ChildWindowFromPointEx. | |
QPixmap | grabWindow (WId window, int qX, int qY, int qWidth, int qHeight) const override |
This function is called when Qt needs to be able to grab the content of a window. | |
QPlatformScreen::SubpixelAntialiasingType | subpixelAntialiasingTypeHint () const override |
Queries ClearType settings to check the pixel layout. | |
void | handleChanges (const QWindowsScreenData &newData) |
Notify QWindowSystemInterface about changes of a screen and synchronize data. | |
HMONITOR | handle () const override |
QPlatformCursor * | cursor () const override |
Reimplement this function in subclass to return the cursor of the screen. | |
const CursorPtr & | cursorPtr () const |
const QWindowsScreenData & | data () const |
![]() | |
QPlatformScreen () | |
virtual | ~QPlatformScreen () |
virtual bool | isPlaceholder () const |
virtual QPixmap | grabWindow (WId window, int x, int y, int width, int height) const |
This function is called when Qt needs to be able to grab the content of a window. | |
virtual QRect | geometry () const =0 |
Reimplement in subclass to return the pixel geometry of the screen. | |
virtual QRect | availableGeometry () const |
Reimplement in subclass to return the pixel geometry of the available space This normally is the desktop screen minus the task manager, global menubar etc. | |
virtual int | depth () const =0 |
Reimplement in subclass to return current depth of the screen. | |
virtual QImage::Format | format () const =0 |
Reimplement in subclass to return the image format which corresponds to the screen format. | |
virtual QColorSpace | colorSpace () const |
virtual QSizeF | physicalSize () const |
Reimplement this function in subclass to return the physical size of the screen, in millimeters. | |
virtual QDpi | logicalDpi () const |
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch metrics of the screen. | |
virtual QDpi | logicalBaseDpi () const |
Reimplement to return the base logical DPI for the platform. | |
virtual qreal | devicePixelRatio () const |
Reimplement this function in subclass to return the device pixel ratio for the screen. | |
virtual qreal | refreshRate () const |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz. | |
virtual Qt::ScreenOrientation | nativeOrientation () const |
Reimplement this function in subclass to return the native orientation of the screen, e.g. | |
virtual Qt::ScreenOrientation | orientation () const |
Reimplement this function in subclass to return the current orientation of the screen, for example based on accelerometer data to determine the device orientation. | |
virtual QWindow * | topLevelAt (const QPoint &point) const |
Return the given top level window for a given position. | |
QWindowList | windows () const |
Return all windows residing on this screen. | |
virtual QList< QPlatformScreen * > | virtualSiblings () const |
Returns a list of all the platform screens that are part of the same virtual desktop. | |
const QPlatformScreen * | screenForPosition (const QPoint &point) const |
Find the sibling screen corresponding to globalPos. | |
QScreen * | screen () const |
virtual QString | name () const |
virtual QString | manufacturer () const |
Reimplement this function in subclass to return the manufacturer of this screen. | |
virtual QString | model () const |
Reimplement this function in subclass to return the model of this screen. | |
virtual QString | serialNumber () const |
Reimplement this function in subclass to return the serial number of this screen. | |
virtual QPlatformCursor * | cursor () const |
Reimplement this function in subclass to return the cursor of the screen. | |
virtual SubpixelAntialiasingType | subpixelAntialiasingTypeHint () const |
Returns a hint about this screen's subpixel layout structure. | |
virtual PowerState | powerState () const |
Returns the current power state. | |
virtual void | setPowerState (PowerState state) |
Sets the power state for this screen. | |
virtual QList< Mode > | modes () const |
Reimplement this function in subclass to return the list of modes for this screen. | |
virtual int | currentMode () const |
Reimplement this function in subclass to return the index of the current mode from the modes list. | |
virtual int | preferredMode () const |
Reimplement this function in subclass to return the preferred mode index from the modes list. | |
Static Public Member Functions | |
static QWindow * | windowAt (const QPoint &point, unsigned flags) |
static Qt::ScreenOrientation | orientationPreference () |
static bool | setOrientationPreference (Qt::ScreenOrientation o) |
static QRect | virtualGeometry (const QPlatformScreen *screen) |
![]() | |
static QPlatformScreen * | platformScreenForWindow (const QWindow *window) |
static int | angleBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b) |
static QTransform | transformBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) |
static QRect | mapBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) |
static QDpi | overrideDpi (const QDpi &in) |
Static Public Attributes | |
static int | baseDpi = 96 |
Additional Inherited Members | |
![]() | |
void | resizeMaximizedWindows () |
Convenience method to resize all the maximized and fullscreen windows of this platform screen. | |
![]() | |
QScopedPointer< QPlatformScreenPrivate > | d_ptr |
Definition at line 50 of file qwindowsscreen.h.
|
explicit |
Definition at line 399 of file qwindowsscreen.cpp.
|
inlineoverridevirtual |
Reimplement in subclass to return the pixel geometry of the available space This normally is the desktop screen minus the task manager, global menubar etc.
Reimplemented from QPlatformScreen.
Definition at line 56 of file qwindowsscreen.h.
References QWindowsScreenData::availableGeometry.
|
inlineoverridevirtual |
Reimplement this function in subclass to return the cursor of the screen.
The default implementation returns \nullptr.
Reimplemented from QPlatformScreen.
Definition at line 84 of file qwindowsscreen.h.
References QScopedPointer< T, Cleanup >::data().
|
inline |
Definition at line 85 of file qwindowsscreen.h.
|
inline |
Definition at line 90 of file qwindowsscreen.h.
|
inlineoverridevirtual |
Reimplement in subclass to return current depth of the screen.
Implements QPlatformScreen.
Definition at line 57 of file qwindowsscreen.h.
References QWindowsScreenData::depth.
|
inlineoverridevirtual |
Reimplement this function in subclass to return the device pixel ratio for the screen.
This is the ratio between physical pixels and the device-independent pixels of the windowing system. The default implementation returns 1.0.
Reimplemented from QPlatformScreen.
Definition at line 62 of file qwindowsscreen.h.
|
inlineoverridevirtual |
Reimplement in subclass to return the image format which corresponds to the screen format.
Implements QPlatformScreen.
Definition at line 58 of file qwindowsscreen.h.
References QWindowsScreenData::format.
|
inlineoverridevirtual |
Reimplement in subclass to return the pixel geometry of the screen.
Implements QPlatformScreen.
Definition at line 55 of file qwindowsscreen.h.
References QWindowsScreenData::geometry.
Referenced by grabWindow().
|
overridevirtual |
This function is called when Qt needs to be able to grab the content of a window.
Returns the content of the window specified with the WId handle within the boundaries of QRect(x,y,width,height).
Reimplemented from QPlatformScreen.
Definition at line 414 of file qwindowsscreen.cpp.
References geometry(), QSize::height(), pixmap, qt_pixmapFromWinHBITMAP(), QRect::size(), QSize::width(), window(), QRect::x(), and QRect::y().
|
override |
Definition at line 550 of file qwindowsscreen.cpp.
References QWindowsScreenData::hMonitor.
|
inline |
Notify QWindowSystemInterface about changes of a screen and synchronize data.
Definition at line 514 of file qwindowsscreen.cpp.
References QWindowsScreenData::availableGeometry, QWindowsScreenData::dpi, QWindowsScreenData::geometry, QWindowSystemInterface::handleScreenGeometryChange(), QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(), QWindowSystemInterface::handleScreenOrientationChange(), QWindowsScreenData::hMonitor, QWindowsScreenData::name, QWindowsScreenData::orientation, QWindowsScreenData::physicalSizeMM, qCDebug, qFuzzyCompare(), and QPlatformScreen::screen().
|
inlineoverridevirtual |
Reimplement to return the base logical DPI for the platform.
This DPI value should correspond to a standard-DPI (1x) display. The default implementation returns 96.
QtGui will use this value (together with logicalDpi) to compute the scale factor when high-DPI scaling is enabled, as follows: factor = logicalDPI / baseDPI
Reimplemented from QPlatformScreen.
Definition at line 61 of file qwindowsscreen.h.
References baseDpi.
|
inlineoverridevirtual |
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch metrics of the screen.
The logical dots per inch metrics are used by Qt to scale the user interface.
The default implementation returns logicalBaseDpi(), which results in a UI scale factor of 1.0.
Reimplemented from QPlatformScreen.
Definition at line 60 of file qwindowsscreen.h.
References QWindowsScreenData::dpi.
Referenced by QWindowsWindow::checkForScreenChanged().
|
inlineoverridevirtual |
Reimplement this function in subclass to return the manufacturer of this screen.
The default implementation returns an empty string.
Reimplemented from QPlatformScreen.
Definition at line 65 of file qwindowsscreen.h.
References QWindowsScreenData::manufacturer.
|
inlineoverridevirtual |
Reimplement this function in subclass to return the model of this screen.
The default implementation returns an empty string.
Reimplemented from QPlatformScreen.
Definition at line 66 of file qwindowsscreen.h.
References QWindowsScreenData::model.
|
overridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 407 of file qwindowsscreen.cpp.
References arg, QWindowsScreenData::deviceIndex, QWindowsScreenData::name, and QString::number().
Referenced by QWindowsWindow::checkForScreenChanged().
|
inlineoverridevirtual |
Reimplement this function in subclass to return the current orientation of the screen, for example based on accelerometer data to determine the device orientation.
The default implementation returns Qt::PrimaryOrientation.
Reimplemented from QPlatformScreen.
Definition at line 68 of file qwindowsscreen.h.
References QWindowsScreenData::orientation.
|
static |
Definition at line 588 of file qwindowsscreen.cpp.
References Qt::InvertedLandscapeOrientation, Qt::InvertedPortraitOrientation, Qt::LandscapeOrientation, orientationPreference(), Qt::PortraitOrientation, and Qt::PrimaryOrientation.
Referenced by orientationPreference(), and setOrientationPreference().
|
inlineoverridevirtual |
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
The physical size represents the actual physical dimensions of the display.
The default implementation takes the pixel size of the screen, considers a resolution of 100 dots per inch, and returns the calculated physical size. A device with a screen that has different resolutions will need to be supported by a suitable reimplementation of this function.
Reimplemented from QPlatformScreen.
Definition at line 59 of file qwindowsscreen.h.
References QWindowsScreenData::physicalSizeMM.
|
inlineoverridevirtual |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz.
The default returns 60, a sensible default for modern displays.
Reimplemented from QPlatformScreen.
Definition at line 63 of file qwindowsscreen.h.
References QWindowsScreenData::refreshRateHz.
|
inlineoverridevirtual |
Reimplement this function in subclass to return the serial number of this screen.
The default implementation returns an empty string.
Reimplemented from QPlatformScreen.
Definition at line 67 of file qwindowsscreen.h.
References QWindowsScreenData::serialNumber.
|
static |
Definition at line 564 of file qwindowsscreen.cpp.
References Qt::InvertedLandscapeOrientation, Qt::InvertedPortraitOrientation, Qt::LandscapeOrientation, o, orientationPreference(), Qt::PortraitOrientation, and Qt::PrimaryOrientation.
|
overridevirtual |
Queries ClearType settings to check the pixel layout.
Reimplemented from QPlatformScreen.
Definition at line 616 of file qwindowsscreen.cpp.
References QSettings::NativeFormat, settings, QPlatformScreen::Subpixel_BGR, QPlatformScreen::Subpixel_None, QPlatformScreen::Subpixel_RGB, QPlatformScreen::subpixelAntialiasingTypeHint(), QVariant::toInt(), and QSettings::value().
Find a top level window taking the flags of ChildWindowFromPointEx.
Reimplemented from QPlatformScreen.
Definition at line 466 of file qwindowsscreen.cpp.
References child, qCDebug, QWindowsWindow::topLevelOf(), QWindowsContext::verbose, and windowAt().
|
static |
Definition at line 555 of file qwindowsscreen.cpp.
References QPlatformScreen::screen(), and QScreen::virtualSiblings().
Referenced by QWindowsTabletSupport::translateTabletPacketEvent().
|
overridevirtual |
Determine siblings in a virtual desktop system.
Self is by definition a sibling, else collect all screens within virtual desktop.
Reimplemented from QPlatformScreen.
Definition at line 494 of file qwindowsscreen.cpp.
References QWindowsScreenData::flags, QWindowsContext::instance(), QList< T >::push_back(), QPlatformScreen::screen(), QWindowsContext::screenManager(), QWindowsScreenManager::screens(), and QWindowsScreenData::VirtualDesktop.
Definition at line 476 of file qwindowsscreen.cpp.
References QWindowsContext::instance(), qCDebug, and QWindowsContext::verbose.
Referenced by getWindowUnderPointer(), redirectWheelEvent(), topLevelAt(), QWindowsMouseHandler::translateMouseEvent(), and QWindowsTabletSupport::translateTabletPacketEvent().
|
inlinestatic |
Definition at line 93 of file qwindowsscreen.h.
Referenced by QWindowsWindow::dpiRelativeScale(), logicalBaseDpi(), and QWindowsWindow::moveTransientChildren().