8using namespace Qt::StringLiterals;
14 initFromJsonObject(screenDescription);
24 return QRect(QPoint(0, 0), m_geometry.size());
39 return m_physicalSize;
44 return logicalBaseDpi();
49 return QDpi(100, 100);
59 return m_nativeOrientation;
81 value = description.value(
"id"_L1);
82 if (!value.isUndefined() && value.isDouble())
85 value = description.value(
"description"_L1);
86 if (!value.isUndefined() && value.isString())
87 m_description = value.toString();
89 value = description.value(
"geometry"_L1);
90 if (!value.isUndefined() && value.isObject()) {
91 QJsonObject geometryObject = value.toObject();
92 value = geometryObject.value(
"x"_L1);
93 if (!value.isUndefined() && value.isDouble())
94 m_geometry.setX(value.toInt());
95 value = geometryObject.value(
"y"_L1);
96 if (!value.isUndefined() && value.isDouble())
97 m_geometry.setY(value.toInt());
98 value = geometryObject.value(
"width"_L1);
99 if (!value.isUndefined() && value.isDouble())
100 m_geometry.setWidth(value.toInt());
101 value = geometryObject.value(
"height"_L1);
102 if (!value.isUndefined() && value.isDouble())
103 m_geometry.setHeight(value.toInt());
106 value = description.value(
"depth"_L1);
107 if (!value.isUndefined() && value.isDouble())
108 m_depth = value.toInt();
110 value = description.value(
"format"_L1);
111 if (!value.isUndefined() && value.isDouble())
112 m_format =
static_cast<QImage::Format>(value.toInt());
114 value = description.value(
"physicalSize"_L1);
115 if (!value.isUndefined() && value.isObject()) {
116 QJsonObject physicalSizeObject = value.toObject();
117 value = physicalSizeObject.value(
"width"_L1);
118 if (!value.isUndefined() && value.isDouble())
119 m_physicalSize.setWidth(value.toInt());
120 value = physicalSizeObject.value(
"height"_L1);
121 if (!value.isUndefined() && value.isDouble())
122 m_physicalSize.setHeight(value.toInt());
126 value = description.value(
"refreshRate"_L1);
127 if (!value.isUndefined() && value.isDouble())
128 m_refreshRate = value.toDouble();
130 value = description.value(
"nativeOrientation"_L1);
131 if (!value.isUndefined() && value.isDouble())
132 m_nativeOrientation =
static_cast<Qt::ScreenOrientation>(value.toInt());
134 value = description.value(
"orientation"_L1);
135 if (!value.isUndefined() && value.isDouble())
136 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)