![]() |
Qt 6.x
The Qt SDK
|
#include <qcocoascreen.h>
Public Member Functions | |
~QCocoaScreen () | |
QPixmap | grabWindow (WId window, int x, int y, int width, int height) const override |
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. | |
QColorSpace | colorSpace () const override |
qreal | devicePixelRatio () const override |
Reimplement this function in subclass to return the device pixel ratio for the screen. | |
QSizeF | physicalSize () const override |
Reimplement this function in subclass to return the physical size of the screen, in millimeters. | |
QDpi | logicalBaseDpi () const override |
Reimplement to return the base logical DPI for the platform. | |
qreal | refreshRate () const override |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz. | |
QString | name () const override |
QPlatformCursor * | cursor () const override |
Reimplement this function in subclass to return the cursor of the screen. | |
QWindow * | topLevelAt (const QPoint &point) const override |
Return the given top level window for a given position. | |
QList< QPlatformScreen * > | virtualSiblings () const override |
Returns a list of all the platform screens that are part of the same virtual desktop. | |
QPlatformScreen::SubpixelAntialiasingType | subpixelAntialiasingTypeHint () const override |
Returns a hint about this screen's subpixel layout structure. | |
NSScreen * | nativeScreen () const |
bool | requestUpdate () |
void | deliverUpdateRequests () |
bool | isRunningDisplayLink () 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. | |
Friends | |
class | QCocoaIntegration |
class | QCocoaWindow |
QDebug | operator<< (QDebug debug, const QCocoaScreen *screen) |
Additional Inherited Members | |
![]() | |
enum | SubpixelAntialiasingType { Subpixel_None , Subpixel_RGB , Subpixel_BGR , Subpixel_VRGB , Subpixel_VBGR } |
enum | PowerState { PowerStateOn , PowerStateStandby , PowerStateSuspend , PowerStateOff } |
![]() | |
void | resizeMaximizedWindows () |
Convenience method to resize all the maximized and fullscreen windows of this platform screen. | |
![]() | |
QScopedPointer< QPlatformScreenPrivate > | d_ptr |
Definition at line 22 of file qcocoascreen.h.
QCocoaScreen::~QCocoaScreen | ( | ) |
Definition at line 188 of file qcocoascreen.mm.
References Q_ASSERT_X, and QPlatformScreen::screen().
|
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 31 of file qcocoascreen.h.
Referenced by QCocoaMenu::showPopup().
|
inlineoverridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 34 of file qcocoascreen.h.
|
inlineoverridevirtual |
Reimplement this function in subclass to return the cursor of the screen.
The default implementation returns \nullptr.
Reimplemented from QPlatformScreen.
Definition at line 40 of file qcocoascreen.h.
void QCocoaScreen::deliverUpdateRequests | ( | ) |
Definition at line 398 of file qcocoascreen.mm.
References QGuiApplication::allWindows(), QList< T >::at(), deliverUpdateRequests(), QBasicAtomicInteger< T >::fetchAndStoreRelaxed(), DeferredDebugHelper::flushOutput(), i, QSurface::MetalSurface, pool, qCDebug, qCWarning, qDeferredDebug, qEnvironmentVariableIsSet(), QPlatformScreen::screen(), QList< T >::size(), QSurface::VulkanSurface, window(), and QPlatformScreen::windows().
Referenced by deliverUpdateRequests(), and requestUpdate().
|
inlineoverridevirtual |
Reimplement in subclass to return current depth of the screen.
Implements QPlatformScreen.
Definition at line 32 of file qcocoascreen.h.
|
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 35 of file qcocoascreen.h.
|
inlineoverridevirtual |
Reimplement in subclass to return the image format which corresponds to the screen format.
Implements QPlatformScreen.
Definition at line 33 of file qcocoascreen.h.
|
inlineoverridevirtual |
Reimplement in subclass to return the pixel geometry of the screen.
Implements QPlatformScreen.
Definition at line 30 of file qcocoascreen.h.
Referenced by grabWindow().
|
static |
Definition at line 740 of file qcocoascreen.mm.
References QScreen::handle(), Q_ASSERT, QPlatformScreen::screen(), and QGuiApplication::screens().
|
static |
Definition at line 729 of file qcocoascreen.mm.
References QScreen::handle(), QPlatformScreen::screen(), and QGuiApplication::screens().
|
static |
Definition at line 714 of file qcocoascreen.mm.
References get(), and qCWarning.
Referenced by QCocoaWindow::createNSWindow(), and get().
|
overridevirtual |
Coordinates are in screen coordinates if view is 0, otherwise they are in view coordinates.
Reimplemented from QPlatformScreen.
Definition at line 569 of file qcocoascreen.mm.
References QList< T >::append(), QList< T >::at(), QPixmap::devicePixelRatio(), dpr(), QPainter::drawPixmap(), QPixmap::fill(), QPixmap::fromImage(), geometry(), i, QRect::intersected(), QRect::isNull(), QRect::isValid(), mapFromNative(), nativeScreenForDisplayId(), painter, pixmap, position(), qCDebug, qMax(), qt_mac_toQImage(), QPixmap::setDevicePixelRatio(), QPixmap::size(), QRect::size(), QRect::topLeft(), QPointF::toPoint(), QRect::translate(), Qt::transparent, and view.
bool QCocoaScreen::isRunningDisplayLink | ( | ) | const |
Definition at line 507 of file qcocoascreen.mm.
|
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 37 of file qcocoascreen.h.
|
static |
Definition at line 787 of file qcocoascreen.mm.
References QScreen::geometry, pos, Q_ASSERT, qt_mac_flip(), and QPlatformScreen::screen().
Referenced by QCocoaWindow::geometry(), grabWindow(), QCocoaWindow::handleGeometryChange(), QCocoaCursor::pos(), and QCocoaWindow::setupPopupMonitor().
|
static |
Definition at line 793 of file qcocoascreen.mm.
References QScreen::geometry, Q_ASSERT, qt_mac_flip(), rect, and QPlatformScreen::screen().
|
static |
Definition at line 775 of file qcocoascreen.mm.
References QScreen::geometry, pos, Q_ASSERT, qt_mac_flip(), and QPlatformScreen::screen().
Referenced by QCocoaWindow::createNSWindow(), QCocoaWindow::setCocoaGeometry(), and topLevelAt().
|
static |
Definition at line 781 of file qcocoascreen.mm.
References QScreen::geometry, Q_ASSERT, qt_mac_flip(), rect, and QPlatformScreen::screen().
|
inlineoverridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 39 of file qcocoascreen.h.
NSScreen * QCocoaScreen::nativeScreen | ( | ) | const |
Definition at line 767 of file qcocoascreen.mm.
References nativeScreenForDisplayId().
|
static |
Definition at line 758 of file qcocoascreen.mm.
References QPlatformScreen::screen().
Referenced by grabWindow(), and nativeScreen().
|
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 36 of file qcocoascreen.h.
|
static |
The screen used as a reference for global window geometry.
Definition at line 695 of file qcocoascreen.mm.
References QScreen::handle(), and QGuiApplication::primaryScreen.
|
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 38 of file qcocoascreen.h.
bool QCocoaScreen::requestUpdate | ( | ) |
Definition at line 292 of file qcocoascreen.mm.
References deliverUpdateRequests(), Q_ASSERT, Q_UNUSED, qCDebug, qCWarning, and queue.
Referenced by QCocoaWindow::requestUpdate().
|
overridevirtual |
Returns a hint about this screen's subpixel layout structure.
The default implementation queries the {QT_SUBPIXEL_AA_TYPE} env variable. This is just a hint because most platforms don't have a way to retrieve the correct value from hardware and instead rely on font configurations.
Reimplemented from QPlatformScreen.
Definition at line 514 of file qcocoascreen.mm.
References QPlatformScreen::Subpixel_None, QPlatformScreen::Subpixel_RGB, and QPlatformScreen::subpixelAntialiasingTypeHint().
Return the given top level window for a given position.
Default implementation retrieves a list of all top level windows and finds the first window which contains point pos
Reimplemented from QPlatformScreen.
Definition at line 524 of file qcocoascreen.mm.
References mapToNative(), qnsview_cast(), window(), and QPlatformWindow::window().
|
overridevirtual |
Returns a list of all the platform screens that are part of the same virtual desktop.
Screens part of the same virtual desktop share a common coordinate system, and windows can be freely moved between them.
Reimplemented from QPlatformScreen.
Definition at line 703 of file qcocoascreen.mm.
References QScreen::handle(), QPlatformScreen::screen(), and QGuiApplication::screens().
|
friend |
Definition at line 800 of file qcocoascreen.mm.
|
friend |
Definition at line 98 of file qcocoascreen.h.
|
friend |
Definition at line 99 of file qcocoascreen.h.