diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-01-26 14:03:31 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-01-26 14:04:33 +0100 |
commit | 957bcda3b956008e944f1335cce43c84cc838907 (patch) | |
tree | b328abe00339c531be3a04c2ee0ab55b6be4d8d2 /src/imports/compat/QtAndroidAutomotive | |
parent | 5d7345c937e795806ce12884026eee56bfadf19b (diff) |
Rename compatilbity to compat
This shortens the path a bit further (Windows builds).
Change-Id: If5494806675350bd3983535820b0776d2ab80d94
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/imports/compat/QtAndroidAutomotive')
11 files changed, 414 insertions, 0 deletions
diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/ActivityView.qml b/src/imports/compat/QtAndroidAutomotive/ActivityView/ActivityView.qml new file mode 100644 index 0000000..d02fd13 --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/ActivityView.qml @@ -0,0 +1,212 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Android Automotive compatibility. +** +** $QT_BEGIN_LICENSE:GPL$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick +import QtQuick.Controls + +Item { + id: root + + width: 480 + height: 640 + + property alias radius: rect.radius + property string packageName: "some.package.name" + property string className + readonly property alias status: internal.status + property alias placeholder: placeholderItem.children + property bool usePlaceholder: false + + onUsePlaceholderChanged: { + if (placeholder) { + placeholder.visible = usePlaceholder + avMock.visible = !usePlaceholder + } else { + avMock.visible = true + } + } + + onPlaceholderChanged: { + if (!placeholder) + avMock.visible = true + } + + enum Status { + NotInitialized, + Ready, + Starting, + Started + } + + QtObject { + id: internal + + property var status: ActivityView.NotInitialized + property real fontPointSize: 20 + + function enumToString(val) { + switch (val) { + case ActivityView.NotInitialized: return "NotInitialized" + case ActivityView.Ready: return "Ready" + case ActivityView.Starting: return "Starting" + case ActivityView.Started: return "Started" + } + return "Unknown" + } + } + + component StatusButton: Rectangle { + id: button + + color: highlighted ? "lightGray" : "gray" + radius: 5 + clip: true + width: btnText.width + height: btnText.height + + property int statusId: 0 + property bool highlighted: false + signal clicked(int value) + + Label { + id: btnText + + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: internal.fontPointSize + + text: " " + internal.enumToString(statusId) + " " + } + + MouseArea { + anchors.fill: parent + onClicked: button.clicked(statusId) + } + } + + Item { + id: placeholderItem + anchors.fill: parent + } + + Item { + id: avMock + + anchors.fill: parent + + Rectangle { + id: rect + + anchors.fill: parent + color: "#AAAAAA" + radius: 0 + border.color: "#888888" + border.width: 2 + clip: true + + Image { + id: icon + + anchors.centerIn: parent + anchors.verticalCenterOffset: - statusArea.height / 2 + + source: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAQMAAAD58POIAAAABlBMV + EUAAAA+Pj4LNneDAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEwAACxMBAJqcGAAAASNJREFUSMft1 + TFuwzAMBVApAqIlgNZu6hF6A/UovYm99VjV1mu46AUyelDNilJgftkx0gbtZg4C/BCFNETRSnE88 + 3JQEi+8HAEel/DEywngYV624DTv24KjMrHmvsRBEfUIxhGdI4B+I/rqESgHgmHALZbhDOAZRoDAM + AF0DARQniGNrhDbrERDmxXBpZwmBSnEj7mQ0Y9LSFLXBkipXf3TaVE51E5b0Lev8hOI7cveBcP9s + Aw4U1c2JNkSYjkDO0PHv3b0OkPpAC/wcYF3gXQNgsDnDjv8AdxuuqZP07VOdtDrZdrZCZqfr5BOA + j7ikJIr9i9w+2avJsxqBq3nWKjPE871wTZzfYffQ2zBUTTNx3MFlnrdjGiTz6j5AOvcsF09yG/q3 + /z/4fD/YgAAAABJRU5ErkJggg==" + } + + Label { + id: packageLabel + + anchors.top: icon.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 5 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: internal.fontPointSize + text: root.packageName + } + } + + Rectangle { + id: statusArea + + anchors.left: parent.left + anchors.right: parent.right + anchors.top: statusFlow.top + anchors.bottom: statusFlow.bottom + anchors.topMargin: -5 + anchors.bottomMargin: -5 + color: "black" + opacity: 0.5 + radius: rect.radius + } + + Label { + id: statusLabel + + anchors.top: statusFlow.top + anchors.left: parent.left + + text: " " + "status:" + " " + color: "lightGray" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + font.pointSize: internal.fontPointSize + } + + Flow { + id: statusFlow + + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: 5 + anchors.leftMargin: statusLabel.width + spacing: 5 + + Repeater { + model: [ActivityView.NotInitialized, ActivityView.Ready, ActivityView.Starting, + ActivityView.Started] + + delegate: StatusButton { + statusId: modelData + onClicked: (value) => internal.status = value + highlighted: modelData === internal.status + } + } + } + } +} diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/CMakeLists.txt b/src/imports/compat/QtAndroidAutomotive/ActivityView/CMakeLists.txt new file mode 100644 index 0000000..cd6d69c --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/CMakeLists.txt @@ -0,0 +1,14 @@ +qt_internal_add_qml_module(AndroidAutomotiveActivityView + URI "QtAndroidAutomotive.ActivityView" + VERSION "${PROJECT_VERSION}" + DESIGNER_SUPPORTED + NO_SYNC_QT + PAST_MAJOR_VERSIONS 1 + QML_FILES + ActivityView.qml +) + +if(QT_FEATURE_quick_designer AND QT_BUILD_SHARED_LIBS) + add_subdirectory(designer) +endif() + diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/ActivityViewSpecifics.qml b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/ActivityViewSpecifics.qml new file mode 100644 index 0000000..5b3707b --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/ActivityViewSpecifics.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Android Automotive compatibility. +** +** $QT_BEGIN_LICENSE:GPL$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick +import QtQuick.Layouts +import HelperWidgets +import StudioTheme 1.0 as StudioTheme + +//! [ActivityView compatibility] +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Activity View") + + SectionLayout { + PropertyLabel { text: qsTr("Package name") } + + LineEdit { + backendValue: backendValues.packageName + Layout.fillWidth: true + + } + + PropertyLabel { text: qsTr("Class name") } + + LineEdit { + backendValue: backendValues.className + Layout.fillWidth: true + } + + PropertyLabel { text: qsTr("Corner radius") } + + SecondColumnLayout { + SpinBox { + minimumValue: 0 + maximumValue: 128 + decimals: 0 + backendValue: backendValues.radius + Layout.fillWidth: true + } + } + } +} +//! [ActivityView compatibility] diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/CMakeLists.txt b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/CMakeLists.txt new file mode 100644 index 0000000..664231e --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/CMakeLists.txt @@ -0,0 +1,16 @@ +qt_path_join(installdesignerdir "${INSTALL_QMLDIR}" "QtAndroidAutomotive/ActivityView") +qt_path_join(targetdesignerdir "${CMAKE_BINARY_DIR}" "${installdesignerdir}/designer") + +file( + COPY . + DESTINATION ${targetdesignerdir} + FILES_MATCHING PATTERN "*qml" + PATTERN "*metainfo" + PATTERN "images/*png" + PATTERN "CMakeFiles" EXCLUDE +) + +qt_install( + DIRECTORY ${targetdesignerdir} + DESTINATION ${installdesignerdir} +) diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/images/qtaa-av-icon.png b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/images/qtaa-av-icon.png Binary files differnew file mode 100644 index 0000000..fc14ca4 --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/images/qtaa-av-icon.png diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/images/qtaa-av-icon@2x.png b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/images/qtaa-av-icon@2x.png Binary files differnew file mode 100644 index 0000000..a195f66 --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/images/qtaa-av-icon@2x.png diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/qtandroidautomotiveactivityview.metainfo b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/qtandroidautomotiveactivityview.metainfo new file mode 100644 index 0000000..babf3e1 --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/designer/qtandroidautomotiveactivityview.metainfo @@ -0,0 +1,23 @@ + +MetaInfo { + + Type { + name: "QtAndroidAutomotive.ActivityView.ActivityView" + icon: "images/qtaa-av-icon.png" + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: true + } + + ItemLibraryEntry { + name: "ActivityView" + category: "ActivityView" + version: "1.0" + requiredImport: "QtAndroidAutomotive.ActivityView" + libraryIcon: "images/qtaa-av-icon@2x.png" + } + } + +} diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/plugins.qmltypes b/src/imports/compat/QtAndroidAutomotive/ActivityView/plugins.qmltypes new file mode 100644 index 0000000..6a6c815 --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/plugins.qmltypes @@ -0,0 +1,13 @@ +import QtQuick.tooling 1.2 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. +// +// This file was auto-generated by: +// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls 2.15' + +Module { + dependencies: [ + "QtQuick 2.12" + ] +} diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/qmldir b/src/imports/compat/QtAndroidAutomotive/ActivityView/qmldir new file mode 100644 index 0000000..02c4a9d --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/qmldir @@ -0,0 +1,9 @@ +module QtAndroidAutomotive.ActivityView +linktarget Qt6::AndroidAutomotiveActivityViewplugin +optional plugin androidautomotiveactivityviewplugin +classname QtAndroidAutomotive_ActivityViewPlugin +designersupported +typeinfo AndroidAutomotiveActivityView.qmltypes +prefer :/qt-project.org/imports/QtAndroidAutomotive/ActivityView/ +ActivityView 6.0 ActivityView.qml +ActivityView 1.0 ActivityView.qml diff --git a/src/imports/compat/QtAndroidAutomotive/ActivityView/studiocompatibilityqaaactivityview.cpp b/src/imports/compat/QtAndroidAutomotive/ActivityView/studiocompatibilityqaaactivityview.cpp new file mode 100644 index 0000000..233b397 --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/ActivityView/studiocompatibilityqaaactivityview.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Android Automotive compatibility. +** +** $QT_BEGIN_LICENSE:GPL$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) 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.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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtQml/qqmlextensionplugin.h> + +QT_BEGIN_NAMESPACE + +class StudioCompatibilityQtAaActivityView: public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + StudioCompatibilityQtAaActivityView(QObject *parent = nullptr); + void registerTypes(const char *uri) override; +}; + +StudioCompatibilityQtAaActivityView::StudioCompatibilityQtAaActivityView(QObject *parent) + : QQmlExtensionPlugin(parent) +{ +} + +void StudioCompatibilityQtAaActivityView::registerTypes(const char *) +{ +} + +QT_END_NAMESPACE + +#include "studiocompatibilityqaaactivityview.moc" diff --git a/src/imports/compat/QtAndroidAutomotive/CMakeLists.txt b/src/imports/compat/QtAndroidAutomotive/CMakeLists.txt new file mode 100644 index 0000000..3416fae --- /dev/null +++ b/src/imports/compat/QtAndroidAutomotive/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(ActivityView) + |