9using namespace Qt::StringLiterals;
15 initFromJsonObject(screenDescription);
25 return QRect(QPoint(0, 0), m_geometry.size());
40 return m_physicalSize;
45 return logicalBaseDpi();
50 return QDpi(100, 100);
60 return m_nativeOrientation;
82 value = description.value(
"id"_L1);
83 if (!value.isUndefined() && value.isDouble())
86 value = description.value(
"description"_L1);
87 if (!value.isUndefined() && value.isString())
88 m_description = value.toString();
90 value = description.value(
"geometry"_L1);
91 if (!value.isUndefined() && value.isObject()) {
92 QJsonObject geometryObject = value.toObject();
93 value = geometryObject.value(
"x"_L1);
94 if (!value.isUndefined() && value.isDouble())
95 m_geometry.setX(value.toInt());
96 value = geometryObject.value(
"y"_L1);
97 if (!value.isUndefined() && value.isDouble())
98 m_geometry.setY(value.toInt());
99 value = geometryObject.value(
"width"_L1);
100 if (!value.isUndefined() && value.isDouble())
101 m_geometry.setWidth(value.toInt());
102 value = geometryObject.value(
"height"_L1);
103 if (!value.isUndefined() && value.isDouble())
104 m_geometry.setHeight(value.toInt());
107 value = description.value(
"depth"_L1);
108 if (!value.isUndefined() && value.isDouble())
109 m_depth = value.toInt();
111 value = description.value(
"format"_L1);
112 if (!value.isUndefined() && value.isDouble())
113 m_format =
static_cast<QImage::Format>(value.toInt());
115 value = description.value(
"physicalSize"_L1);
116 if (!value.isUndefined() && value.isObject()) {
117 QJsonObject physicalSizeObject = value.toObject();
118 value = physicalSizeObject.value(
"width"_L1);
119 if (!value.isUndefined() && value.isDouble())
120 m_physicalSize.setWidth(value.toInt());
121 value = physicalSizeObject.value(
"height"_L1);
122 if (!value.isUndefined() && value.isDouble())
123 m_physicalSize.setHeight(value.toInt());
127 value = description.value(
"refreshRate"_L1);
128 if (!value.isUndefined() && value.isDouble())
129 m_refreshRate = value.toDouble();
131 value = description.value(
"nativeOrientation"_L1);
132 if (!value.isUndefined() && value.isDouble())
133 m_nativeOrientation =
static_cast<Qt::ScreenOrientation>(value.toInt());
135 value = description.value(
"orientation"_L1);
136 if (!value.isUndefined() && value.isDouble())
137 m_orientation =
static_cast<Qt::ScreenOrientation>(value.toInt());
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
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.
qreal refreshRate() const override
Reimplement this function in subclass to return the vertical refresh rate of the screen,...
QDpi logicalBaseDpi() const override
Reimplement to return the base logical DPI for the platform.
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
Qt::ScreenOrientation nativeOrientation() const override
Reimplement this function in subclass to return the native orientation of the screen,...
QString name() const override
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
QRect rawGeometry() const override
QEglFSEmulatorScreen(const QJsonObject &screenDescription)
Combined button and popup list for selecting options.