diff options
Diffstat (limited to 'src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp | 72 |
1 files changed, 19 insertions, 53 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp index 697d92a5ca..ff2f966477 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_emu/qeglfsemulatorscreen.cpp @@ -1,46 +1,12 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #include "qeglfsemulatorscreen.h" QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + QEglFSEmulatorScreen::QEglFSEmulatorScreen(const QJsonObject &screenDescription) : QEglFSScreen(eglGetDisplay(EGL_DEFAULT_DISPLAY)) , m_id(0) @@ -112,60 +78,60 @@ void QEglFSEmulatorScreen::initFromJsonObject(const QJsonObject &description) { QJsonValue value; - value = description.value(QLatin1String("id")); + value = description.value("id"_L1); if (!value.isUndefined() && value.isDouble()) m_id = value.toInt(); - value = description.value(QLatin1String("description")); + value = description.value("description"_L1); if (!value.isUndefined() && value.isString()) m_description = value.toString(); - value = description.value(QLatin1String("geometry")); + value = description.value("geometry"_L1); if (!value.isUndefined() && value.isObject()) { QJsonObject geometryObject = value.toObject(); - value = geometryObject.value(QLatin1String("x")); + value = geometryObject.value("x"_L1); if (!value.isUndefined() && value.isDouble()) m_geometry.setX(value.toInt()); - value = geometryObject.value(QLatin1String("y")); + value = geometryObject.value("y"_L1); if (!value.isUndefined() && value.isDouble()) m_geometry.setY(value.toInt()); - value = geometryObject.value(QLatin1String("width")); + value = geometryObject.value("width"_L1); if (!value.isUndefined() && value.isDouble()) m_geometry.setWidth(value.toInt()); - value = geometryObject.value(QLatin1String("height")); + value = geometryObject.value("height"_L1); if (!value.isUndefined() && value.isDouble()) m_geometry.setHeight(value.toInt()); } - value = description.value(QLatin1String("depth")); + value = description.value("depth"_L1); if (!value.isUndefined() && value.isDouble()) m_depth = value.toInt(); - value = description.value(QLatin1String("format")); + value = description.value("format"_L1); if (!value.isUndefined() && value.isDouble()) m_format = static_cast<QImage::Format>(value.toInt()); - value = description.value(QLatin1String("physicalSize")); + value = description.value("physicalSize"_L1); if (!value.isUndefined() && value.isObject()) { QJsonObject physicalSizeObject = value.toObject(); - value = physicalSizeObject.value(QLatin1String("width")); + value = physicalSizeObject.value("width"_L1); if (!value.isUndefined() && value.isDouble()) m_physicalSize.setWidth(value.toInt()); - value = physicalSizeObject.value(QLatin1String("height")); + value = physicalSizeObject.value("height"_L1); if (!value.isUndefined() && value.isDouble()) m_physicalSize.setHeight(value.toInt()); } - value = description.value(QLatin1String("refreshRate")); + value = description.value("refreshRate"_L1); if (!value.isUndefined() && value.isDouble()) m_refreshRate = value.toDouble(); - value = description.value(QLatin1String("nativeOrientation")); + value = description.value("nativeOrientation"_L1); if (!value.isUndefined() && value.isDouble()) m_nativeOrientation = static_cast<Qt::ScreenOrientation>(value.toInt()); - value = description.value(QLatin1String("orientation")); + value = description.value("orientation"_L1); if (!value.isUndefined() && value.isDouble()) m_orientation = static_cast<Qt::ScreenOrientation>(value.toInt()); } |