CopperSpice API
1.9.2
|
Provides an abstraction for visual displays. More...
Public Methods | |
QPlatformScreen () | |
virtual | ~QPlatformScreen () |
virtual QRect | availableGeometry () const |
virtual QPlatformCursor * | cursor () const |
virtual int | depth () const = 0 |
QRect | deviceIndependentGeometry () const |
virtual qreal | devicePixelRatio () const |
virtual QImage::Format | format () const = 0 |
virtual QRect | geometry () const = 0 |
virtual QPixmap | grabWindow (WId window, int x, int y, int width, int height) const |
virtual QDpi | logicalDpi () const |
virtual QString | name () const |
virtual Qt::ScreenOrientation | nativeOrientation () const |
virtual Qt::ScreenOrientation | orientation () const |
virtual QSizeF | physicalSize () const |
virtual qreal | pixelDensity () const |
virtual PowerState | powerState () const |
virtual qreal | refreshRate () const |
QScreen * | screen () const |
const QPlatformScreen * | screenForPosition (const QPoint &point) const |
virtual void | setOrientationUpdateMask (Qt::ScreenOrientations mask) |
virtual void | setPowerState (PowerState state) |
virtual SubpixelAntialiasingType | subpixelAntialiasingTypeHint () const |
virtual QWindow * | topLevelWindowAt (const QPoint &point) const |
virtual QList< QPlatformScreen * > | virtualSiblings () const |
Static Public Methods | |
static int | angleBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b) |
static QRect | mapBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) |
static QPlatformScreen * | platformScreenForWindow (const QWindow *window) |
static QTransform | transformBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) |
Protected Methods | |
void | resizeMaximizedWindows () |
Some systems have support for retrieving information about the attached displays. Use QPlatformScreen to query the display. QPlatformScreen is also used by the public api QDesktopWidget for information about the desktop.
CopperSpice uses the physicalSize() method to calculate the dpi when converting point sizes to pixels sizes. However, on some systems the operating system does not report an accurate physical size.
QPlatformScreen::QPlatformScreen | ( | ) |
Constructs a new QPlatformScreen.
|
virtual |
Destroys the current QPlatformScreen.
|
static |
Additional documentation pending.
|
inlinevirtual |
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 |
Reimplement this function in subclass to return the cursor of the screen. The default implementation returns a nullptr.
|
pure virtual |
Reimplement in subclass to return current depth of the screen.
QRect QPlatformScreen::deviceIndependentGeometry | ( | ) | const |
Additional documentation pending.
|
virtual |
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.
|
pure virtual |
Reimplement in subclass to return the image format which corresponds to the screen format
|
pure virtual |
Reimplement in subclass to return the pixel geometry of the screen
|
virtual |
|
virtual |
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 QFont to convert point sizes to pixel sizes. The default implementation uses the screen pixel size and physical size to compute the metrics.
|
static |
Additional documentation pending.
|
inlinevirtual |
Additional documentation pending.
|
virtual |
Reimplement this method in a subclass to return the native orientation of the screen, e.g. the orientation where the logo sticker of the device appears the right way up.
The default implementation returns Qt::PrimaryOrientation.
|
virtual |
Reimplement this method in a 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.
|
virtual |
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.
|
virtual |
Reimplement this function in subclass to return the pixel density of the screen. This is the scale factor needed to make a low DPI application usable on this screen. The default implementation returns 1.0.
Returning something else than 1.0 from this function causes CopperSpice to apply the scale factor to the application's coordinate system. This is different from devicePixelRatio, which reports a scale factor already applied by the windowing system. A platform plugin typically implements one (or none) of these two functions.
|
static |
Additional documentation pending.
|
virtual |
Returns the current power state. The default implementation always returns PowerStateOn.
|
virtual |
Reimplement in subclass to return the vertical refresh rate of the screen, in Hz. The default returns 60, a sensible default for modern displays.
|
protected |
Used to resize all the maximized and fullscreen windows of this platform screen.
QScreen * QPlatformScreen::screen | ( | ) | const |
Additional documentation pending.
const QPlatformScreen * QPlatformScreen::screenForPosition | ( | const QPoint & | point | ) | const |
Find the sibling screen corresponding to point. Returns this screen if no suitable screen is found at the position.
|
virtual |
Reimplement in subclass to filter out unneeded screen orientation updates.
The orientations will anyway be filtered before QScreen::orientationChanged() is emitted, but the mask can be used by the platform plugin for example to prevent having to have an accelerometer sensor running all the time, or to improve the reported values. As an example of the latter, in case of only Landscape | InvertedLandscape being set in the mask, on a platform that gets its orientation readings from an accelerometer sensor embedded in a handheld device, the platform can report transitions between the two even when the device is held in an orientation that's closer to portrait.
By default the orientation update mask is empty, so unless this function has been called with a non-empty mask the platform does not need to report any orientation updates through QWindowSystemInterface::handleScreenOrientationChange().
|
virtual |
Sets the state for this screen.
|
virtual |
Returns a hint about this screen's subpixel layout structure. The default implementation queries the QT_SUBPIXEL_AA_TYPE environment variable. This is just a hint because most platforms do not have a way to retrieve the correct value from hardware and instead rely on font configurations.
Returns 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.
|
static |
Additional documentation pending.
|
virtual |
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.