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 | |
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')
45 files changed, 1833 insertions, 0 deletions
diff --git a/src/imports/compat/CMakeLists.txt b/src/imports/compat/CMakeLists.txt new file mode 100644 index 0000000..d35facf --- /dev/null +++ b/src/imports/compat/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(Extras) +add_subdirectory(Layers) + diff --git a/src/imports/compat/Extras/CMakeLists.txt b/src/imports/compat/Extras/CMakeLists.txt new file mode 100644 index 0000000..32b4306 --- /dev/null +++ b/src/imports/compat/Extras/CMakeLists.txt @@ -0,0 +1,16 @@ +qt_internal_add_qml_module(QuickUltraLiteStudioExtras + URI "QtQuickUltralite.Extras" + VERSION "${PROJECT_VERSION}" + DESIGNER_SUPPORTED + NO_SYNC_QT + PAST_MAJOR_VERSIONS 1 + QML_FILES + ColorizedImage.qml + StaticText.qml +) + +if(QT_FEATURE_quick_designer AND QT_BUILD_SHARED_LIBS) + add_subdirectory(designer) +endif() + + diff --git a/src/imports/compat/Extras/ColorizedImage.qml b/src/imports/compat/Extras/ColorizedImage.qml new file mode 100644 index 0000000..ee509d4 --- /dev/null +++ b/src/imports/compat/Extras/ColorizedImage.qml @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.12 +import Qt5Compat.GraphicalEffects +import QtQuickUltralite.Extras 1.9 + +Item { + id: colorizedRoot + property var color: "transparent" + property alias source: internalImg.source + property alias fillMode: internalImg.fillMode + property alias horizontalAlignment: internalImg.horizontalAlignment + property alias verticalAlignment: internalImg.verticalAlignment + + implicitWidth: internalImg.sourceSize.width + implicitHeight: internalImg.sourceSize.height + + Image { + id: internalImg + + layer.enabled: true + layer.effect: ColorOverlay { + anchors.fill: internalImg + source: internalImg + color: colorizedRoot.color + } + } +} diff --git a/src/imports/compat/Extras/StaticText.qml b/src/imports/compat/Extras/StaticText.qml new file mode 100644 index 0000000..47483e3 --- /dev/null +++ b/src/imports/compat/Extras/StaticText.qml @@ -0,0 +1,34 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +//! [StaticText compatibility] +Text { +} +//! [StaticText compatibility] diff --git a/src/imports/compat/Extras/designer/CMakeLists.txt b/src/imports/compat/Extras/designer/CMakeLists.txt new file mode 100644 index 0000000..19ad43d --- /dev/null +++ b/src/imports/compat/Extras/designer/CMakeLists.txt @@ -0,0 +1,16 @@ +qt_path_join(installdesignerdir "${INSTALL_QMLDIR}" "QtQuickUltralite/Extras") +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/Extras/designer/ColorizedImageSpecifics.qml b/src/imports/compat/Extras/designer/ColorizedImageSpecifics.qml new file mode 100644 index 0000000..c0e9ce5 --- /dev/null +++ b/src/imports/compat/Extras/designer/ColorizedImageSpecifics.qml @@ -0,0 +1,254 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioTheme 1.0 as StudioTheme + +//! [ColorizedImage compatibility] +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Colorized Image") + + SectionLayout { + PropertyLabel { text: qsTr("Image color") } + + ColorEditor { + backendValue: backendValues.color + supportGradient: false + } + + PropertyLabel { text: qsTr("Source") } + + SecondColumnLayout { + UrlChooser { + backendValue: backendValues.source + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Fill mode") } + + SecondColumnLayout { + ComboBox { + scope: "Image" + model: ["Stretch", "PreserveAspectFit", "PreserveAspectCrop", "Tile", "TileVertically", "TileHorizontally", "Pad"] + backendValue: backendValues.fillMode + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Source size") + blockedByTemplate: !backendValues.sourceSize.isAvailable + } + + SecondColumnLayout { + SpinBox { + backendValue: backendValues.sourceSize_width + minimumValue: 0 + maximumValue: 8192 + decimals: 0 + enabled: backendValue.isAvailable + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + enabled: backendValues.sourceSize_width.isAvailable + } + + SpinBox { + backendValue: backendValues.sourceSize_height + minimumValue: 0 + maximumValue: 8192 + decimals: 0 + enabled: backendValue.isAvailable + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + enabled: backendValues.sourceSize_height.isAvailable + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Alignment H") } + + SecondColumnLayout { + ComboBox { + scope: "Image" + model: ["AlignLeft", "AlignRight", "AlignHCenter"] + backendValue: backendValues.horizontalAlignment + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Alignment V") } + + SecondColumnLayout { + ComboBox { + scope: "Image" + model: ["AlignTop", "AlignBottom", "AlignVCenter"] + backendValue: backendValues.verticalAlignment + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Asynchronous") + tooltip: qsTr("Loads images on the local filesystem asynchronously in a separate thread.") + blockedByTemplate: !backendValues.asynchronous.isAvailable + } + + SecondColumnLayout { + CheckBox { + enabled: backendValues.asynchronous.isAvailable + text: backendValues.asynchronous.valueToString + backendValue: backendValues.asynchronous + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Auto transform") + tooltip: qsTr("Automatically applies image transformation metadata such as EXIF orientation.") + blockedByTemplate: !backendValues.autoTransform.isAvailable + } + + SecondColumnLayout { + CheckBox { + enabled: backendValues.autoTransform.isAvailable + text: backendValues.autoTransform.valueToString + backendValue: backendValues.autoTransform + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Cache") + tooltip: qsTr("Caches the image.") + blockedByTemplate: !backendValues.cache.isAvailable + } + + SecondColumnLayout { + CheckBox { + enabled: backendValues.cache.isAvailable + text: backendValues.cache.valueToString + backendValue: backendValues.cache + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Mipmap") + tooltip: qsTr("Uses mipmap filtering when the image is scaled or transformed.") + blockedByTemplate: !backendValues.mipmap.isAvailable + } + + SecondColumnLayout { + CheckBox { + enabled: backendValues.mipmap.isAvailable + text: backendValues.mipmap.valueToString + backendValue: backendValues.mipmap + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Mirror") + tooltip: qsTr("Inverts the image horizontally.") + blockedByTemplate: !backendValues.mirror.isAvailable + } + + SecondColumnLayout { + CheckBox { + enabled: backendValues.mirror.isAvailable + text: backendValues.mirror.valueToString + backendValue: backendValues.mirror + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Smooth") + tooltip: qsTr("Smoothly filters the image when it is scaled or transformed.") + blockedByTemplate: !backendValues.smooth.isAvailable + } + + SecondColumnLayout { + CheckBox { + enabled: backendValues.smooth.isAvailable + text: backendValues.smooth.valueToString + backendValue: backendValues.smooth + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + } +} +//! [ColorizedImage compatibility] diff --git a/src/imports/compat/Extras/designer/QtQuickUltraliteExtras.metainfo b/src/imports/compat/Extras/designer/QtQuickUltraliteExtras.metainfo new file mode 100644 index 0000000..ab5716c --- /dev/null +++ b/src/imports/compat/Extras/designer/QtQuickUltraliteExtras.metainfo @@ -0,0 +1,28 @@ +MetaInfo { + Type { + name: "QtQuickUltralite.Extras.ColorizedImage" + icon: "images/image-icon.png" + + ItemLibraryEntry { + name: "Colorized Image" + category: "QtQuickUltralite - Extras" + libraryIcon: "images/image-icon@2x.png" + version: "1.9" + requiredImport: "QtQuickUltralite.Extras" + Property { name: "source"; type: "binding"; value: "\"source/text\""; } + } + } + Type { + name: "QtQuickUltralite.Extras.StaticText" + icon: "images/text-icon.png" + + ItemLibraryEntry { + name: "Static Text" + category: "QtQuickUltralite - Extras" + libraryIcon: "images/text-icon@2x.png" + version: "1.9" + requiredImport: "QtQuickUltralite.Extras" + Property { name: "text"; type: "binding"; value: "qsTr(\"Static Text\")"; } + } + } +} diff --git a/src/imports/compat/Extras/designer/StaticTextSpecifics.qml b/src/imports/compat/Extras/designer/StaticTextSpecifics.qml new file mode 100644 index 0000000..e75bbfa --- /dev/null +++ b/src/imports/compat/Extras/designer/StaticTextSpecifics.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 + +//! [StaticText compatibility] +Column { + anchors.left: parent.left + anchors.right: parent.right + + CharacterSection { + richTextEditorAvailable: true + showLineHeight: true + showVerticalAlignment: true + } + + TextExtrasSection { + showElide: true + showWrapMode: true + showFormatProperty: true + showFontSizeMode: true + showLineHeight: true + } + + FontExtrasSection { + showStyle: true + } + + PaddingSection {} +} + +//! [StaticText compatibility] diff --git a/src/imports/compat/Extras/designer/images/image-icon.png b/src/imports/compat/Extras/designer/images/image-icon.png Binary files differnew file mode 100644 index 0000000..318ce08 --- /dev/null +++ b/src/imports/compat/Extras/designer/images/image-icon.png diff --git a/src/imports/compat/Extras/designer/images/image-icon@2x.png b/src/imports/compat/Extras/designer/images/image-icon@2x.png Binary files differnew file mode 100644 index 0000000..cc84918 --- /dev/null +++ b/src/imports/compat/Extras/designer/images/image-icon@2x.png diff --git a/src/imports/compat/Extras/designer/images/text-icon.png b/src/imports/compat/Extras/designer/images/text-icon.png Binary files differnew file mode 100644 index 0000000..29a81f5 --- /dev/null +++ b/src/imports/compat/Extras/designer/images/text-icon.png diff --git a/src/imports/compat/Extras/designer/images/text-icon@2x.png b/src/imports/compat/Extras/designer/images/text-icon@2x.png Binary files differnew file mode 100644 index 0000000..1df8f76 --- /dev/null +++ b/src/imports/compat/Extras/designer/images/text-icon@2x.png diff --git a/src/imports/compat/Extras/plugins.qmltypes b/src/imports/compat/Extras/plugins.qmltypes new file mode 100644 index 0000000..6a6c815 --- /dev/null +++ b/src/imports/compat/Extras/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/Extras/qmldir b/src/imports/compat/Extras/qmldir new file mode 100644 index 0000000..fec69a2 --- /dev/null +++ b/src/imports/compat/Extras/qmldir @@ -0,0 +1,9 @@ +module QtQuickUltralite.Extras +linktarget studioqtquickultraliteextrasplugin +optional plugin studioqtquickultraliteextrasplugin +classname QtQuickUltralite_ExtrasPlugin +typeinfo studioqtquickultraliteextras.qmltypes +prefer :/QtQuickUltralite/Extras/ +ColorizedImage 1.0 ColorizedImage.qml +StaticText 1.0 StaticText.qml + diff --git a/src/imports/compat/Extras/studiocompatibilityqulextras.cpp b/src/imports/compat/Extras/studiocompatibilityqulextras.cpp new file mode 100644 index 0000000..8b2804d --- /dev/null +++ b/src/imports/compat/Extras/studiocompatibilityqulextras.cpp @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 <QQmlEngine> +#include <QQmlContext> +#include <QtQml/qqmlextensionplugin.h> + +QT_BEGIN_NAMESPACE + +class StudioCompatibilityQULExtras: public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + StudioCompatibilityQULExtras(QObject *parent = nullptr); + void registerTypes(const char *uri) override; +}; + +StudioCompatibilityQULExtras::StudioCompatibilityQULExtras(QObject *parent) + : QQmlExtensionPlugin(parent) +{ +} + +void StudioCompatibilityQULExtras::registerTypes(const char *) +{ +} + +QT_END_NAMESPACE + +#include "studiocompatibilityqulextras.moc" diff --git a/src/imports/compat/Layers/+DesignMode/Screen.qml b/src/imports/compat/Layers/+DesignMode/Screen.qml new file mode 100644 index 0000000..f86c272 --- /dev/null +++ b/src/imports/compat/Layers/+DesignMode/Screen.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 + +//! [Screen compatibility] +Rectangle { + id: wnd + property var outputDevice: "device" + property alias backgroundColor: color + + property int defaultApplicationWidth: width + property int defaultApplicationHeight: height + + visible: true +} +//! [Screen compatibility] diff --git a/src/imports/compat/Layers/Application.qml b/src/imports/compat/Layers/Application.qml new file mode 100644 index 0000000..f13f25e --- /dev/null +++ b/src/imports/compat/Layers/Application.qml @@ -0,0 +1,35 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 + +//! [Application compatibility] +Item { +} +//! [Application compatibility] diff --git a/src/imports/compat/Layers/CMakeLists.txt b/src/imports/compat/Layers/CMakeLists.txt new file mode 100644 index 0000000..1903505 --- /dev/null +++ b/src/imports/compat/Layers/CMakeLists.txt @@ -0,0 +1,18 @@ +qt_internal_add_qml_module(QuickUltraLiteStudioLayers + URI "QtQuickUltralite.Layers" + VERSION "${PROJECT_VERSION}" + DESIGNER_SUPPORTED + NO_SYNC_QT + PAST_MAJOR_VERSIONS 1 + QML_FILES + Application.qml + ImageLayer.qml + ItemLayer.qml + Screen.qml + SpriteLayer.qml +) + +if(QT_FEATURE_quick_designer AND QT_BUILD_SHARED_LIBS) + add_subdirectory(designer) +endif() + diff --git a/src/imports/compat/Layers/ImageLayer.qml b/src/imports/compat/Layers/ImageLayer.qml new file mode 100644 index 0000000..f4c0647 --- /dev/null +++ b/src/imports/compat/Layers/ImageLayer.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 + +//! [ImageLayer compatibility] +Item { + enum RenderingHints { + OptimizeForSpeed, + OptimizeForSize, + StaticContents + } + + property int platformId: 0 + property int renderingHints: ImageLayer.RenderingHints.OptimizeForSpeed + property alias source: internalImage.source + + Image { + id: internalImage + anchors.fill: parent + } +} +//! [ImageLayer compatibility] diff --git a/src/imports/compat/Layers/ItemLayer.qml b/src/imports/compat/Layers/ItemLayer.qml new file mode 100644 index 0000000..231c3d3 --- /dev/null +++ b/src/imports/compat/Layers/ItemLayer.qml @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 + +//! [ItemLayer compatibility] +Item { + enum ColorDepth { + Bpp16, Bpp16Alpha, Bpp24, Bpp32, Bpp32Alpha + } + + enum RenderingHints { + OptimizeForSpeed, + OptimizeForSize, + StaticContents + } + + property int depth: ColorDepth.Bpp32 + property int refreshInterval: 1 + property int platformId: 0 + property int renderingHints: RenderingHints.OptimizeForSpeed +} +//! [ItemLayer compatibility] diff --git a/src/imports/compat/Layers/Screen.qml b/src/imports/compat/Layers/Screen.qml new file mode 100644 index 0000000..ad50a8d --- /dev/null +++ b/src/imports/compat/Layers/Screen.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +import QtQuick.Window 2.2 + +//! [Screen compatibility] +Item { + id: root + + property var outputDevice: "device" + property alias backgroundColor: wnd.color + + property alias defaultApplicationWidth: wnd.width + property alias defaultApplicationHeight: wnd.height + + Window { + id: wnd + visible: true + } +} +//! [Screen compatibility] diff --git a/src/imports/compat/Layers/SpriteLayer.qml b/src/imports/compat/Layers/SpriteLayer.qml new file mode 100644 index 0000000..29f3db9 --- /dev/null +++ b/src/imports/compat/Layers/SpriteLayer.qml @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 + +//! [SpriteLayer compatibility] +Item { + enum ColorDepth { + Bpp8, Bpp16, Bpp16Alpha, Bpp24, Bpp32, Bpp32Alpha + } + + property int depth: ColorDepth.Bpp32 + property int platformId: 0 +} +//! [SpriteLayer compatibility] diff --git a/src/imports/compat/Layers/designer/ApplicationSpecifics.qml b/src/imports/compat/Layers/designer/ApplicationSpecifics.qml new file mode 100644 index 0000000..58374ef --- /dev/null +++ b/src/imports/compat/Layers/designer/ApplicationSpecifics.qml @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 + +import HelperWidgets 2.0 +import QtQuick.Layouts 1.0 + +//! [Application compatibility] +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Application") + + //Application type has no properties +} +//! [Application compatibility] diff --git a/src/imports/compat/Layers/designer/CMakeLists.txt b/src/imports/compat/Layers/designer/CMakeLists.txt new file mode 100644 index 0000000..508a4ea --- /dev/null +++ b/src/imports/compat/Layers/designer/CMakeLists.txt @@ -0,0 +1,16 @@ +qt_path_join(installdesignerdir "${INSTALL_QMLDIR}" "QtQuickUltralite/Layers") +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/Layers/designer/ImageLayerSpecifics.qml b/src/imports/compat/Layers/designer/ImageLayerSpecifics.qml new file mode 100644 index 0000000..ac60034 --- /dev/null +++ b/src/imports/compat/Layers/designer/ImageLayerSpecifics.qml @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioTheme 1.0 as StudioTheme + +//! [ImageLayer compatibility] +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Image Layer") + + SectionLayout { + PropertyLabel { text: qsTr("Platform ID") } + + SecondColumnLayout { + SpinBox { + backendValue: backendValues.platformId + minimumValue: 0 + maximumValue: 2000 + decimals: 0 + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Rendering hints") } + + SecondColumnLayout { + ComboBox { + model: ["OptimizeForSpeed", "OptimizeForSize", "StaticContents"] + backendValue: backendValues.renderingHints + scope: "ImageLayer" + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Source") } + + SecondColumnLayout { + UrlChooser { + backendValue: backendValues.source + } + + ExpandingSpacer {} + } + } +} +//! [ImageLayer compatibility] diff --git a/src/imports/compat/Layers/designer/ItemLayerSpecifics.qml b/src/imports/compat/Layers/designer/ItemLayerSpecifics.qml new file mode 100644 index 0000000..d36486c --- /dev/null +++ b/src/imports/compat/Layers/designer/ItemLayerSpecifics.qml @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioTheme 1.0 as StudioTheme + +//! [ItemLayer compatibility] +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Item Layer") + + SectionLayout { + PropertyLabel { text: qsTr("Platform ID") } + + SecondColumnLayout { + SpinBox { + backendValue: backendValues.platformId + minimumValue: 0 + maximumValue: 2000 + decimals: 0 + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Rendering hints") } + + SecondColumnLayout { + ComboBox { + model: ["OptimizeForSpeed", "OptimizeForSize", "StaticContents"] + backendValue: backendValues.renderingHints + scope: "ItemLayer" + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Depth") } + + SecondColumnLayout { + ComboBox { + model: ["Bpp16", "Bpp16Alpha", "Bpp24", "Bpp32", "Bpp32Alpha"] + backendValue: backendValues.depth + scope: "ItemLayer" + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Refresh interval") } + + SecondColumnLayout { + SpinBox { + backendValue: backendValues.refreshInterval + minimumValue: 0 + maximumValue: 1000 + decimals: 0 + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + } +} +//! [ItemLayer compatibility] diff --git a/src/imports/compat/Layers/designer/QtQuickUltraliteLayers.metainfo b/src/imports/compat/Layers/designer/QtQuickUltraliteLayers.metainfo new file mode 100644 index 0000000..649154b --- /dev/null +++ b/src/imports/compat/Layers/designer/QtQuickUltraliteLayers.metainfo @@ -0,0 +1,87 @@ +MetaInfo { + Type { + name: "QtQuickUltralite.Layers.Application" + icon: "images/item-icon.png" + + ItemLibraryEntry { + name: "Application" + category: "QtQuickUltralite - Layers" + libraryIcon: "images/item-icon@2x.png" + version: "1.9" + requiredImport: "QtQuickUltralite.Layers" + } + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: true + } + } + Type { + name: "QtQuickUltralite.Layers.ImageLayer" + icon: "images/item-icon.png" + + ItemLibraryEntry { + name: "Image Layer" + category: "QtQuickUltralite - Layers" + libraryIcon: "images/item-icon@2x.png" + version: "1.9" + requiredImport: "QtQuickUltralite.Layers" + + Property { name: "renderingHints"; type: "enum"; value: "ImageLayer.OptimizeForSpeed"; } + Property { name: "platformId"; type: "int"; value: 0; } + } + } + Type { + name: "QtQuickUltralite.Layers.ItemLayer" + icon: "images/item-icon.png" + + ItemLibraryEntry { + name: "Item Layer" + category: "QtQuickUltralite - Layers" + libraryIcon: "images/item-icon@2x.png" + version: "1.9" + requiredImport: "QtQuickUltralite.Layers" + + Property { name: "depth"; type: "enum"; value: "ItemLayer.Bpp32"; } + Property { name: "renderingHints"; type: "enum"; value: "ItemLayer.OptimizeForSpeed"; } + Property { name: "refreshInterval"; type: "int"; value: 1; } + Property { name: "platformId"; type: "int"; value: 0; } + } + } + Type { + name: "QtQuickUltralite.Layers.Screen" + icon: "images/item-icon.png" + + ItemLibraryEntry { + name: "Screen" + category: "QtQuickUltralite - Layers" + libraryIcon: "images/item-icon@2x.png" + version: "1.9" + requiredImport: "QtQuickUltralite.Layers" + } + + Hints { + visibleInNavigator: true + canBeDroppedInNavigator: true + canBeDroppedInFormEditor: false + canBeContainer: true + } + } + Type { + name: "QtQuickUltralite.Layers.SpriteLayer" + icon: "images/item-icon.png" + + ItemLibraryEntry { + name: "Sprite Layer" + category: "QtQuickUltralite - Layers" + libraryIcon: "images/item-icon@2x.png" + version: "1.9" + requiredImport: "QtQuickUltralite.Layers" + + Property { name: "depth"; type: "enum"; value: "SpriteLayer.Bpp32"; } + Property { name: "platformId"; type: "int"; value: 0; } + } + } +} diff --git a/src/imports/compat/Layers/designer/ScreenSpecifics.qml b/src/imports/compat/Layers/designer/ScreenSpecifics.qml new file mode 100644 index 0000000..80c7357 --- /dev/null +++ b/src/imports/compat/Layers/designer/ScreenSpecifics.qml @@ -0,0 +1,112 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioTheme 1.0 as StudioTheme + +//! [Screen compatibility] +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Screen") + + SectionLayout { + PropertyLabel { text: qsTr("Output Device") } + + SecondColumnLayout { + LineEdit { + backendValue: backendValues.outputDevice + showTranslateCheckBox: false + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Background color") } + + ColorEditor { + backendValue: backendValues.backgroundColor + supportGradient: false + } + + PropertyLabel { text: qsTr("Application size") } + + SecondColumnLayout { + SpinBox { + id: widthSpinBox + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.defaultApplicationWidth + maximumValue: 0xffff + minimumValue: 0 + decimals: 0 + enabled: true + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + tooltip: widthSpinBox.enabled ? qsTr("Width") : root.disbaledTooltip + enabled: widthSpinBox.enabled + } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + id: heightSpinBox + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.defaultApplicationHeight + maximumValue: 0xffff + minimumValue: 0 + decimals: 0 + enabled: true + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + tooltip: heightSpinBox.enabled ? qsTr("Height") : root.disbaledTooltip + enabled: heightSpinBox.enabled + } + + ExpandingSpacer {} + } + } +} +//! [Screen compatibility] diff --git a/src/imports/compat/Layers/designer/SpriteLayerSpecifics.qml b/src/imports/compat/Layers/designer/SpriteLayerSpecifics.qml new file mode 100644 index 0000000..c13054d --- /dev/null +++ b/src/imports/compat/Layers/designer/SpriteLayerSpecifics.qml @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 2.15 +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 +import StudioTheme 1.0 as StudioTheme + +//! [SpriteLayer compatibility] +Section { + anchors.left: parent.left + anchors.right: parent.right + caption: qsTr("Sprite Layer") + + SectionLayout { + PropertyLabel { text: qsTr("Platform ID") } + + SecondColumnLayout { + SpinBox { + backendValue: backendValues.platformId + minimumValue: 0 + maximumValue: 2000 + decimals: 0 + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Depth") } + + SecondColumnLayout { + ComboBox { + model: ["Bpp8", "Bpp16", "Bpp16Alpha", "Bpp24", "Bpp32", "Bpp32Alpha"] + backendValue: backendValues.depth + scope: "SpriteLayer" + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + } + + ExpandingSpacer {} + } + } +} +//! [SpriteLayer compatibility] diff --git a/src/imports/compat/Layers/designer/images/item-icon.png b/src/imports/compat/Layers/designer/images/item-icon.png Binary files differnew file mode 100644 index 0000000..af81cdf --- /dev/null +++ b/src/imports/compat/Layers/designer/images/item-icon.png diff --git a/src/imports/compat/Layers/designer/images/item-icon@2x.png b/src/imports/compat/Layers/designer/images/item-icon@2x.png Binary files differnew file mode 100644 index 0000000..f05aa57 --- /dev/null +++ b/src/imports/compat/Layers/designer/images/item-icon@2x.png diff --git a/src/imports/compat/Layers/plugins.qmltypes b/src/imports/compat/Layers/plugins.qmltypes new file mode 100644 index 0000000..05873fb --- /dev/null +++ b/src/imports/compat/Layers/plugins.qmltypes @@ -0,0 +1,10 @@ +import QtQuick.tooling 1.2 + +// This file describes the plugin-supplied types contained in the library. +// It is used for QML tooling purposes only. + +Module { + dependencies: [ + "QtQuick 2.15" + ] +} diff --git a/src/imports/compat/Layers/qmldir b/src/imports/compat/Layers/qmldir new file mode 100644 index 0000000..8d0a4b2 --- /dev/null +++ b/src/imports/compat/Layers/qmldir @@ -0,0 +1,12 @@ +module QtQuickUltralite.Layers +linktarget studioqtquickultralitelayersplugin +optional plugin studioqtquickultralitelayersplugin +classname QtQuickUltralite_LayersPlugin +typeinfo studioqtquickultralitelayers.qmltypes +prefer :/QtQuickUltralite/Layers/ +Application 1.0 Application.qml +ImageLayer 1.0 ImageLayer.qml +ItemLayer 1.0 ItemLayer.qml +Screen 1.0 Screen.qml +SpriteLayer 1.0 SpriteLayer.qml + diff --git a/src/imports/compat/Layers/studiocompatibilityqullayers.cpp b/src/imports/compat/Layers/studiocompatibilityqullayers.cpp new file mode 100644 index 0000000..762371a --- /dev/null +++ b/src/imports/compat/Layers/studiocompatibilityqullayers.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Quick Ultralite 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 StudioCompatibilityQULLayers: public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) + +public: + StudioCompatibilityQULLayers(QObject *parent = nullptr); + void registerTypes(const char *uri) override; +}; + +StudioCompatibilityQULLayers::StudioCompatibilityQULLayers(QObject *parent) + : QQmlExtensionPlugin(parent) +{ +} + +void StudioCompatibilityQULLayers::registerTypes(const char *) +{ +} + +QT_END_NAMESPACE + +#include "studiocompatibilityqullayers.moc" 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) + |