DisplaySettings Class

The DisplaySettings class specifies display settings. More...

Header: #include <DisplaySettings>
qmake: QT += displaysettings
Inherits: QObject

Properties

Public Functions

DisplaySettings(QObject *parent = Q_NULLPTR)
virtual ~DisplaySettings()
int displayBrightness()
int physicalScreenHeightMm() const
int physicalScreenSizeInch() const
bool physicalScreenSizeOverride() const
int physicalScreenWidthMm() const

Public Slots

bool setDisplayBrightness(int v)
void setPhysicalScreenHeightMm(int newHeight)
void setPhysicalScreenSizeInch(int inches)
void setPhysicalScreenSizeOverride(bool enable)
void setPhysicalScreenWidthMm(int newWidth)

Signals

void displayBrightnessChanged(int newValue)
void physicalScreenHeightMmChanged(int newValue)
void physicalScreenSizeInchChanged(int newInches)
void physicalScreenSizeOverrideChanged(bool newValue)
void physicalScreenWidthMmChanged(int newValue)

Detailed Description

The Boot to Qt demo launcher and Qt Quick Controls scale automatically to screens of different sizes, from 7-inch touch screens to 60-inch or larger television screens to ensure readability and touch friendliness. For this, Qt has to know the physical dimensions of the screen. By default, it tries to query these values from the framebuffer devices. However, many kernel drivers do not provide this information.

The display settings enable overriding and manually setting the physical screen size.

In addition, you can set the display brightness. That is, the intensity of the backlight.

Property Documentation

displayBrightness : int

This property holds the display brightness.

A value of 255 requests the maximum brightness, while that of 0 requests the minimum (typically, the backlight turned off).

Access functions:

Notifier signal:

void displayBrightnessChanged(int newValue)

physicalScreenHeightMm : int

This property holds the physical screen height in millimeters.

Access functions:

int physicalScreenHeightMm() const
void setPhysicalScreenHeightMm(int newHeight)

Notifier signal:

void physicalScreenHeightMmChanged(int newValue)

physicalScreenSizeInch : int

This property holds the physical screen size in inches.

Access functions:

int physicalScreenSizeInch() const
void setPhysicalScreenSizeInch(int inches)

Notifier signal:

void physicalScreenSizeInchChanged(int newInches)

physicalScreenSizeOverride : bool

This property holds whether to use the value set for the physical screen size.

Access functions:

Notifier signal:

void physicalScreenSizeOverrideChanged(bool newValue)

physicalScreenWidthMm : int

This property holds the physical screen width in millimeters.

Access functions:

int physicalScreenWidthMm() const
void setPhysicalScreenWidthMm(int newWidth)

Notifier signal:

void physicalScreenWidthMmChanged(int newValue)

Member Function Documentation

DisplaySettings::DisplaySettings(QObject *parent = Q_NULLPTR)

Creates a new display settings object with the parent parent.

[slot] bool DisplaySettings::setDisplayBrightness(int v)

Sets the display brightness to v.

Returns true on success.

Note: Setter function for property displayBrightness.

See also displayBrightness().

[slot] void DisplaySettings::setPhysicalScreenHeightMm(int newHeight)

Sets the physical screen height to newHeight.

Note: Setter function for property physicalScreenHeightMm.

See also physicalScreenHeightMm().

[slot] void DisplaySettings::setPhysicalScreenSizeInch(int inches)

Sets the physical screen size to inches.

Note: Setter function for property physicalScreenSizeInch.

See also physicalScreenSizeInch().

[slot] void DisplaySettings::setPhysicalScreenSizeOverride(bool enable)

Sets whether the value set for the physical screen size is used to enable.

Note: Setter function for property physicalScreenSizeOverride.

See also physicalScreenSizeOverride() and physicalScreenSizeInch().

[slot] void DisplaySettings::setPhysicalScreenWidthMm(int newWidth)

Sets the physical screen width to newWidth.

Note: Setter function for property physicalScreenWidthMm.

See also physicalScreenWidthMm().

[virtual] DisplaySettings::~DisplaySettings()

Deletes the display settings object.

int DisplaySettings::displayBrightness()

Returns the current backlight intensity.

Note: Getter function for property displayBrightness.

See also setDisplayBrightness.

int DisplaySettings::physicalScreenHeightMm() const

Returns the physical screen height in millimeters.

Note: Getter function for property physicalScreenHeightMm.

See also setPhysicalScreenHeightMm().

int DisplaySettings::physicalScreenSizeInch() const

Returns the physical screen size in inches.

Note: Getter function for property physicalScreenSizeInch.

See also setPhysicalScreenSizeInch().

bool DisplaySettings::physicalScreenSizeOverride() const

Returns whether the value set for the physical screen size is used.

Note: Getter function for property physicalScreenSizeOverride.

See also setPhysicalScreenSizeOverride() and physicalScreenSizeInch().

int DisplaySettings::physicalScreenWidthMm() const

Returns the physical screen width in millimeters.

Note: Getter function for property physicalScreenWidthMm.

See also setPhysicalScreenWidthMm().

© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.