Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QtWaylandClient::QWaylandScreen Class Reference

#include <qwaylandscreen_p.h>

Inheritance diagram for QtWaylandClient::QWaylandScreen:
Collaboration diagram for QtWaylandClient::QWaylandScreen:

Public Member Functions

 QWaylandScreen (QWaylandDisplay *waylandDisplay, int version, uint32_t id)
 ~QWaylandScreen () override
void maybeInitialize ()
void initXdgOutput (QWaylandXdgOutputManagerV1 *xdgOutputManager)
QWaylandDisplaydisplay () const
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.
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.
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.
QList< QPlatformScreen * > virtualSiblings () const override
 Returns a list of all the platform screens that are part of the same virtual desktop.
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.
int scale () const
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
SubpixelAntialiasingType subpixelAntialiasingTypeHint () const override
 Returns a hint about this screen's subpixel layout structure.
uint32_t outputId () const
::wl_output * output () const override
Qt::ScreenOrientation toScreenOrientation (int wlTransform, Qt::ScreenOrientation fallback) const
Public Member Functions inherited from QPlatformScreen
 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 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 QDpi logicalBaseDpi () const
 Reimplement to return the base logical DPI for the platform.
virtual Qt::ScreenOrientation nativeOrientation () const
 Reimplement this function in subclass to return the native orientation of the screen, e.g.
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 serialNumber () const
 Reimplement this function in subclass to return the serial number of this screen.
virtual QPlatformCursorcursor () const
 Reimplement this function in subclass to return the cursor of the screen.
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.

Static Public Member Functions

static QWaylandScreenwaylandScreenFromWindow (QWindow *window)
static QWaylandScreenfromWlOutput (::wl_output *output)
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 Types

enum  Event : uint { XdgOutputDoneEvent = 0x1 , OutputDoneEvent = 0x2 , XdgOutputNameEvent = 0x4 , OutputNameEvent = 0x8 }

Protected Member Functions

uint requiredEvents () const
void output_mode (uint32_t flags, int width, int height, int refresh) override
void output_geometry (int32_t x, int32_t y, int32_t width, int32_t height, int subpixel, const QString &make, const QString &model, int32_t transform) override
void output_scale (int32_t factor) override
void output_done () override
void output_name (const QString &name) override
void updateOutputProperties ()
void zxdg_output_v1_logical_position (int32_t x, int32_t y) override
void zxdg_output_v1_logical_size (int32_t width, int32_t height) override
void zxdg_output_v1_done () override
void zxdg_output_v1_name (const QString &name) override
void updateXdgOutputProperties ()
Protected Member Functions inherited from QPlatformScreen
void resizeMaximizedWindows ()
 Convenience method to resize all the maximized and fullscreen windows of this platform screen.

Protected Attributes

int m_outputId
QWaylandDisplaymWaylandDisplay = nullptr
QString mManufacturer
QString mModel
QRect mGeometry
QRect mXdgGeometry
int mScale = 1
int mDepth = 32
int mRefreshRate = 60000
int mSubpixel = -1
int mTransform = -1
QImage::Format mFormat = QImage::Format_ARGB32_Premultiplied
QSize mPhysicalSize
QString mOutputName
Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation
uint mProcessedEvents = 0
bool mInitialized = false
Protected Attributes inherited from QPlatformScreen
QScopedPointer< QPlatformScreenPrivated_ptr

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 }

Detailed Description

Definition at line 39 of file qwaylandscreen_p.h.

Member Enumeration Documentation

◆ Event

Enumerator
XdgOutputDoneEvent 
OutputDoneEvent 
XdgOutputNameEvent 
OutputNameEvent 

Definition at line 92 of file qwaylandscreen_p.h.

Constructor & Destructor Documentation

◆ QWaylandScreen()

QtWaylandClient::QWaylandScreen::QWaylandScreen ( QWaylandDisplay * waylandDisplay,
int version,
uint32_t id )

Definition at line 30 of file qwaylandscreen.cpp.

◆ ~QWaylandScreen()

QtWaylandClient::QWaylandScreen::~QWaylandScreen ( )
override

Definition at line 48 of file qwaylandscreen.cpp.

Member Function Documentation

◆ depth()

int QtWaylandClient::QWaylandScreen::depth ( ) const
overridevirtual

Reimplement in subclass to return current depth of the screen.

Implements QPlatformScreen.

Definition at line 131 of file qwaylandscreen.cpp.

◆ devicePixelRatio()

qreal QtWaylandClient::QWaylandScreen::devicePixelRatio ( ) const
overridevirtual

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 191 of file qwaylandscreen.cpp.

◆ display()

QWaylandDisplay * QtWaylandClient::QWaylandScreen::display ( ) const

Definition at line 98 of file qwaylandscreen.cpp.

◆ format()

QImage::Format QtWaylandClient::QWaylandScreen::format ( ) const
overridevirtual

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

Implements QPlatformScreen.

Definition at line 136 of file qwaylandscreen.cpp.

◆ fromWlOutput()

QWaylandScreen * QtWaylandClient::QWaylandScreen::fromWlOutput ( ::wl_output * output)
static

Definition at line 242 of file qwaylandscreen.cpp.

◆ geometry()

QRect QtWaylandClient::QWaylandScreen::geometry ( ) const
overridevirtual

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

Implements QPlatformScreen.

Definition at line 113 of file qwaylandscreen.cpp.

◆ initXdgOutput()

void QtWaylandClient::QWaylandScreen::initXdgOutput ( QWaylandXdgOutputManagerV1 * xdgOutputManager)

Definition at line 89 of file qwaylandscreen.cpp.

◆ logicalDpi()

QDpi QtWaylandClient::QWaylandScreen::logicalDpi ( ) const
overridevirtual

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 149 of file qwaylandscreen.cpp.

◆ manufacturer()

QString QtWaylandClient::QWaylandScreen::manufacturer ( ) const
overridevirtual

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

The default implementation returns an empty string.

Since
5.9

Reimplemented from QPlatformScreen.

Definition at line 103 of file qwaylandscreen.cpp.

◆ maybeInitialize()

void QtWaylandClient::QWaylandScreen::maybeInitialize ( )

Definition at line 73 of file qwaylandscreen.cpp.

◆ model()

QString QtWaylandClient::QWaylandScreen::model ( ) const
overridevirtual

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

The default implementation returns an empty string.

Since
5.9

Reimplemented from QPlatformScreen.

Definition at line 108 of file qwaylandscreen.cpp.

◆ name()

QString QtWaylandClient::QWaylandScreen::name ( ) const
inlineoverridevirtual

Reimplemented from QPlatformScreen.

Definition at line 71 of file qwaylandscreen_p.h.

◆ orientation()

Qt::ScreenOrientation QtWaylandClient::QWaylandScreen::orientation ( ) const
overridevirtual

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 181 of file qwaylandscreen.cpp.

◆ output()

::wl_output * QtWaylandClient::QWaylandScreen::output ( ) const
inlineoverride

Definition at line 80 of file qwaylandscreen_p.h.

◆ output_done()

void QtWaylandClient::QWaylandScreen::output_done ( )
overrideprotected

Definition at line 313 of file qwaylandscreen.cpp.

◆ output_geometry()

void QtWaylandClient::QWaylandScreen::output_geometry ( int32_t x,
int32_t y,
int32_t width,
int32_t height,
int subpixel,
const QString & make,
const QString & model,
int32_t transform )
overrideprotected

Definition at line 291 of file qwaylandscreen.cpp.

◆ output_mode()

void QtWaylandClient::QWaylandScreen::output_mode ( uint32_t flags,
int width,
int height,
int refresh )
overrideprotected

Definition at line 278 of file qwaylandscreen.cpp.

◆ output_name()

void QtWaylandClient::QWaylandScreen::output_name ( const QString & name)
overrideprotected

Definition at line 326 of file qwaylandscreen.cpp.

◆ output_scale()

void QtWaylandClient::QWaylandScreen::output_scale ( int32_t factor)
overrideprotected

Definition at line 308 of file qwaylandscreen.cpp.

◆ outputId()

uint32_t QtWaylandClient::QWaylandScreen::outputId ( ) const
inline

Definition at line 79 of file qwaylandscreen_p.h.

◆ physicalSize()

QSizeF QtWaylandClient::QWaylandScreen::physicalSize ( ) const
overridevirtual

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.

See also
logcalDpi

Reimplemented from QPlatformScreen.

Definition at line 141 of file qwaylandscreen.cpp.

◆ refreshRate()

qreal QtWaylandClient::QWaylandScreen::refreshRate ( ) const
overridevirtual

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 196 of file qwaylandscreen.cpp.

◆ requiredEvents()

uint QtWaylandClient::QWaylandScreen::requiredEvents ( ) const
protected

Definition at line 58 of file qwaylandscreen.cpp.

◆ scale()

int QtWaylandClient::QWaylandScreen::scale ( ) const

Definition at line 186 of file qwaylandscreen.cpp.

◆ subpixelAntialiasingTypeHint()

QPlatformScreen::SubpixelAntialiasingType QtWaylandClient::QWaylandScreen::subpixelAntialiasingTypeHint ( ) const
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 208 of file qwaylandscreen.cpp.

◆ toScreenOrientation()

Qt::ScreenOrientation QtWaylandClient::QWaylandScreen::toScreenOrientation ( int wlTransform,
Qt::ScreenOrientation fallback ) const

Definition at line 249 of file qwaylandscreen.cpp.

◆ updateOutputProperties()

void QtWaylandClient::QWaylandScreen::updateOutputProperties ( )
protected

Definition at line 344 of file qwaylandscreen.cpp.

◆ updateXdgOutputProperties()

void QtWaylandClient::QWaylandScreen::updateXdgOutputProperties ( )
protected

Definition at line 405 of file qwaylandscreen.cpp.

◆ virtualSiblings()

QList< QPlatformScreen * > QtWaylandClient::QWaylandScreen::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 162 of file qwaylandscreen.cpp.

◆ waylandScreenFromWindow()

QWaylandScreen * QtWaylandClient::QWaylandScreen::waylandScreenFromWindow ( QWindow * window)
static

Definition at line 234 of file qwaylandscreen.cpp.

◆ zxdg_output_v1_done()

void QtWaylandClient::QWaylandScreen::zxdg_output_v1_done ( )
overrideprotected

Definition at line 374 of file qwaylandscreen.cpp.

◆ zxdg_output_v1_logical_position()

void QtWaylandClient::QWaylandScreen::zxdg_output_v1_logical_position ( int32_t x,
int32_t y )
overrideprotected

Definition at line 364 of file qwaylandscreen.cpp.

◆ zxdg_output_v1_logical_size()

void QtWaylandClient::QWaylandScreen::zxdg_output_v1_logical_size ( int32_t width,
int32_t height )
overrideprotected

Definition at line 369 of file qwaylandscreen.cpp.

◆ zxdg_output_v1_name()

void QtWaylandClient::QWaylandScreen::zxdg_output_v1_name ( const QString & name)
overrideprotected

Definition at line 386 of file qwaylandscreen.cpp.

Member Data Documentation

◆ m_orientation

Qt::ScreenOrientation QtWaylandClient::QWaylandScreen::m_orientation = Qt::PrimaryOrientation
protected

Definition at line 133 of file qwaylandscreen_p.h.

◆ m_outputId

int QtWaylandClient::QWaylandScreen::m_outputId
protected

Definition at line 119 of file qwaylandscreen_p.h.

◆ mDepth

int QtWaylandClient::QWaylandScreen::mDepth = 32
protected

Definition at line 126 of file qwaylandscreen_p.h.

◆ mFormat

QImage::Format QtWaylandClient::QWaylandScreen::mFormat = QImage::Format_ARGB32_Premultiplied
protected

Definition at line 130 of file qwaylandscreen_p.h.

◆ mGeometry

QRect QtWaylandClient::QWaylandScreen::mGeometry
protected

Definition at line 123 of file qwaylandscreen_p.h.

◆ mInitialized

bool QtWaylandClient::QWaylandScreen::mInitialized = false
protected

Definition at line 135 of file qwaylandscreen_p.h.

◆ mManufacturer

QString QtWaylandClient::QWaylandScreen::mManufacturer
protected

Definition at line 121 of file qwaylandscreen_p.h.

◆ mModel

QString QtWaylandClient::QWaylandScreen::mModel
protected

Definition at line 122 of file qwaylandscreen_p.h.

◆ mOutputName

QString QtWaylandClient::QWaylandScreen::mOutputName
protected

Definition at line 132 of file qwaylandscreen_p.h.

◆ mPhysicalSize

QSize QtWaylandClient::QWaylandScreen::mPhysicalSize
protected

Definition at line 131 of file qwaylandscreen_p.h.

◆ mProcessedEvents

uint QtWaylandClient::QWaylandScreen::mProcessedEvents = 0
protected

Definition at line 134 of file qwaylandscreen_p.h.

◆ mRefreshRate

int QtWaylandClient::QWaylandScreen::mRefreshRate = 60000
protected

Definition at line 127 of file qwaylandscreen_p.h.

◆ mScale

int QtWaylandClient::QWaylandScreen::mScale = 1
protected

Definition at line 125 of file qwaylandscreen_p.h.

◆ mSubpixel

int QtWaylandClient::QWaylandScreen::mSubpixel = -1
protected

Definition at line 128 of file qwaylandscreen_p.h.

◆ mTransform

int QtWaylandClient::QWaylandScreen::mTransform = -1
protected

Definition at line 129 of file qwaylandscreen_p.h.

◆ mWaylandDisplay

QWaylandDisplay* QtWaylandClient::QWaylandScreen::mWaylandDisplay = nullptr
protected

Definition at line 120 of file qwaylandscreen_p.h.

◆ mXdgGeometry

QRect QtWaylandClient::QWaylandScreen::mXdgGeometry
protected

Definition at line 124 of file qwaylandscreen_p.h.


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