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>.
Loading...
Searching...
No Matches
QOffscreenScreen Class Reference

#include <qoffscreencommon.h>

+ Inheritance diagram for QOffscreenScreen:
+ Collaboration diagram for QOffscreenScreen:

Public Member Functions

 QOffscreenScreen (const QOffscreenIntegration *integration)
 
QRect geometry () const override
 Reimplement in subclass to return the pixel geometry of the screen.
 
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.
 
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.
 
QString name () const override
 
QPlatformCursorcursor () const override
 Reimplement this function in subclass to return the cursor of the screen.
 
QList< QPlatformScreen * > virtualSiblings () const override
 Returns a list of all the platform screens that are part of the same virtual desktop.
 
QPixmap grabWindow (WId window, int x, int y, int width, int height) const override
 This function is called when Qt needs to be able to grab the content of a window.
 
- Public Member Functions inherited from QPlatformScreen
 QPlatformScreen ()
 
virtual ~QPlatformScreen ()
 
virtual bool isPlaceholder () const
 
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 QColorSpace colorSpace () const
 
virtual QSizeF physicalSize () const
 Reimplement this function in subclass to return the physical size of the screen, in millimeters.
 
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 QWindowtopLevelAt (const QPoint &point) const
 Return the given top level window for a given position.
 
QWindowList windows () const
 Return all windows residing on this screen.
 
const QPlatformScreenscreenForPosition (const QPoint &point) const
 Find the sibling screen corresponding to globalPos.
 
QScreenscreen () 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 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< Modemodes () 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.
 

Public Attributes

QString m_name
 
QRect m_geometry
 
int m_logicalDpi = 96
 
int m_logicalBaseDpi = 96
 
qreal m_dpr = 1
 
QScopedPointer< QPlatformCursorm_cursor
 
const QOffscreenIntegrationm_integration
 

Static Public Attributes

static QPlatformWindowwindowContainingCursor = nullptr
 

Additional Inherited Members

- Public Types inherited from QPlatformScreen
enum  SubpixelAntialiasingType {
  Subpixel_None , Subpixel_RGB , Subpixel_BGR , Subpixel_VRGB ,
  Subpixel_VBGR
}
 
enum  PowerState { PowerStateOn , PowerStateStandby , PowerStateSuspend , PowerStateOff }
 
- Static Public Member Functions inherited from QPlatformScreen
static QPlatformScreenplatformScreenForWindow (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)
 
- 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< QPlatformScreenPrivated_ptr
 

Detailed Description

Definition at line 24 of file qoffscreencommon.h.

Constructor & Destructor Documentation

◆ QOffscreenScreen()

QOffscreenScreen::QOffscreenScreen ( const QOffscreenIntegration * integration)

Definition at line 73 of file qoffscreencommon.cpp.

Member Function Documentation

◆ cursor()

QPlatformCursor * QOffscreenScreen::cursor ( ) const
inlineoverridevirtual

Reimplement this function in subclass to return the cursor of the screen.

The default implementation returns \nullptr.

Reimplemented from QPlatformScreen.

Definition at line 36 of file qoffscreencommon.h.

References QScopedPointer< T, Cleanup >::data(), and m_cursor.

+ Here is the call graph for this function:

◆ depth()

int QOffscreenScreen::depth ( ) const
inlineoverridevirtual

Reimplement in subclass to return current depth of the screen.

Implements QPlatformScreen.

Definition at line 30 of file qoffscreencommon.h.

◆ devicePixelRatio()

qreal QOffscreenScreen::devicePixelRatio ( ) const
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.

See also
QPlatformWindow::devicePixelRatio()

Reimplemented from QPlatformScreen.

Definition at line 34 of file qoffscreencommon.h.

References m_dpr.

◆ format()

QImage::Format QOffscreenScreen::format ( ) const
inlineoverridevirtual

Reimplement in subclass to return the image format which corresponds to the screen format.

Implements QPlatformScreen.

Definition at line 31 of file qoffscreencommon.h.

References QImage::Format_RGB32.

◆ geometry()

QRect QOffscreenScreen::geometry ( ) const
inlineoverridevirtual

Reimplement in subclass to return the pixel geometry of the screen.

Implements QPlatformScreen.

Definition at line 29 of file qoffscreencommon.h.

References m_geometry.

◆ grabWindow()

QPixmap QOffscreenScreen::grabWindow ( WId window,
int x,
int y,
int width,
int height ) const
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 80 of file qoffscreencommon.cpp.

References QOffscreenBackingStore::backingStoreForWinId(), QPainter::drawImage(), QOffscreenBackingStore::grabWindow(), QRect::height(), m_geometry, painter, rect, QOffscreenBackingStore::toImage(), QGuiApplication::topLevelWindows(), QPainter::translate(), and QRect::width().

+ Here is the call graph for this function:

◆ logicalBaseDpi()

QDpi QOffscreenScreen::logicalBaseDpi ( ) const
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 33 of file qoffscreencommon.h.

References m_logicalBaseDpi.

◆ logicalDpi()

QDpi QOffscreenScreen::logicalDpi ( ) const
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.

See also
physicalSize

Reimplemented from QPlatformScreen.

Definition at line 32 of file qoffscreencommon.h.

References m_logicalDpi.

◆ name()

QString QOffscreenScreen::name ( ) const
inlineoverridevirtual

Reimplemented from QPlatformScreen.

Definition at line 35 of file qoffscreencommon.h.

References m_name.

◆ virtualSiblings()

QList< QPlatformScreen * > QOffscreenScreen::virtualSiblings ( ) const
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 21 of file qoffscreencommon.cpp.

References QList< T >::append(), m_integration, QPlatformScreen::screen(), and QOffscreenIntegration::screens().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_cursor

QScopedPointer<QPlatformCursor> QOffscreenScreen::m_cursor

Definition at line 49 of file qoffscreencommon.h.

Referenced by cursor().

◆ m_dpr

qreal QOffscreenScreen::m_dpr = 1

Definition at line 48 of file qoffscreencommon.h.

Referenced by devicePixelRatio().

◆ m_geometry

QRect QOffscreenScreen::m_geometry

Definition at line 45 of file qoffscreencommon.h.

Referenced by geometry(), and grabWindow().

◆ m_integration

const QOffscreenIntegration* QOffscreenScreen::m_integration

Definition at line 50 of file qoffscreencommon.h.

Referenced by virtualSiblings().

◆ m_logicalBaseDpi

int QOffscreenScreen::m_logicalBaseDpi = 96

Definition at line 47 of file qoffscreencommon.h.

Referenced by logicalBaseDpi().

◆ m_logicalDpi

int QOffscreenScreen::m_logicalDpi = 96

Definition at line 46 of file qoffscreencommon.h.

Referenced by logicalDpi().

◆ m_name

QString QOffscreenScreen::m_name

Definition at line 44 of file qoffscreencommon.h.

Referenced by name().

◆ windowContainingCursor

QT_BEGIN_NAMESPACE QPlatformWindow * QOffscreenScreen::windowContainingCursor = nullptr
static

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