Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
Windows screen. More...
#include <qwindowsscreen.h>
Public Types | |
using | CursorPtr = QScopedPointer<QPlatformCursor> |
Public Types inherited from QPlatformScreen | |
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 |
Public Member Functions inherited from QPlatformScreen | |
QPlatformScreen () | |
virtual | ~QPlatformScreen () |
virtual bool | isPlaceholder () const |
virtual QColorSpace | colorSpace () const |
virtual Qt::ScreenOrientation | nativeOrientation () const |
Reimplement this function in subclass to return the native orientation of the screen, e.g. | |
QWindowList | windows () const |
Return all windows residing on this screen. | |
const QPlatformScreen * | screenForPosition (const QPoint &point) const |
Find the sibling screen corresponding to globalPos. | |
QScreen * | screen () const |
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 Public Member Functions inherited from QPlatformScreen | |
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 | |
Protected Member Functions inherited from QPlatformScreen | |
void | resizeMaximizedWindows () |
Convenience method to resize all the maximized and fullscreen windows of this platform screen. | |
Protected Attributes inherited from QPlatformScreen | |
QScopedPointer< QPlatformScreenPrivate > | d_ptr |
Definition at line 48 of file qwindowsscreen.h.
|
explicit |
Definition at line 406 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 54 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 82 of file qwindowsscreen.h.
References QScopedPointer< T, Cleanup >::data().
|
inline |
Definition at line 83 of file qwindowsscreen.h.
|
inline |
Definition at line 88 of file qwindowsscreen.h.
|
inlineoverridevirtual |
Reimplement in subclass to return current depth of the screen.
Implements QPlatformScreen.
Definition at line 55 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 60 of file qwindowsscreen.h.
|
inlineoverridevirtual |
Reimplement in subclass to return the image format which corresponds to the screen format.
Implements QPlatformScreen.
Definition at line 56 of file qwindowsscreen.h.
References QWindowsScreenData::format.
|
inlineoverridevirtual |
Reimplement in subclass to return the pixel geometry of the screen.
Implements QPlatformScreen.
Definition at line 53 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 421 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 563 of file qwindowsscreen.cpp.
References QWindowsScreenData::hMonitor.
|
inline |
Notify QWindowSystemInterface about changes of a screen and synchronize data.
Definition at line 521 of file qwindowsscreen.cpp.
References QWindowsScreenData::availableGeometry, QWindowsScreenData::dpi, QWindowsScreenData::flags, QWindowsScreenData::geometry, QWindowSystemInterface::handlePrimaryScreenChanged(), QWindowSystemInterface::handleScreenGeometryChange(), QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(), QWindowSystemInterface::handleScreenOrientationChange(), QWindowsScreenData::hMonitor, QWindowsScreenData::name, QWindowsScreenData::orientation, QWindowsScreenData::physicalSizeMM, QWindowsScreenData::PrimaryScreen, 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 59 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 58 of file qwindowsscreen.h.
References QWindowsScreenData::dpi.
|
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 63 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 64 of file qwindowsscreen.h.
References QWindowsScreenData::model.
|
overridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 414 of file qwindowsscreen.cpp.
References arg, QWindowsScreenData::deviceIndex, QWindowsScreenData::name, and QString::number().
|
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 66 of file qwindowsscreen.h.
References QWindowsScreenData::orientation.
|
static |
Definition at line 601 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 57 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 61 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 65 of file qwindowsscreen.h.
References QWindowsScreenData::serialNumber.
|
static |
Definition at line 577 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 629 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 473 of file qwindowsscreen.cpp.
References child, qCDebug, QWindowsWindow::topLevelOf(), QWindowsContext::verbose, and windowAt().
|
static |
Definition at line 568 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 501 of file qwindowsscreen.cpp.
References QWindowsScreenData::flags, QWindowsContext::instance(), QPlatformScreen::screen(), and QWindowsScreenData::VirtualDesktop.
Definition at line 483 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 91 of file qwindowsscreen.h.
Referenced by QWindowsWindow::dpiRelativeScale(), and logicalBaseDpi().