diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-01-26 13:35:18 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-01-26 12:41:31 +0000 |
commit | 5d7345c937e795806ce12884026eee56bfadf19b (patch) | |
tree | 395bbae8da9b96e32ea39e0b1802c2d35657e516 /src/imports/compatibility/Extras | |
parent | 4acb5214409d4bba4b58ffee7d8cf71c28c2693a (diff) |
Move QtQuickUltralite items directly to compatibility
This shortens the path and avoids building issues on Windows.
Removing QtAndroidAutomotive for now.
Change-Id: I76a4ba4269b626ec9ae31d735bc2eef244760d1f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/imports/compatibility/Extras')
14 files changed, 542 insertions, 0 deletions
diff --git a/src/imports/compatibility/Extras/CMakeLists.txt b/src/imports/compatibility/Extras/CMakeLists.txt new file mode 100644 index 0000000..32b4306 --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/ColorizedImage.qml b/src/imports/compatibility/Extras/ColorizedImage.qml new file mode 100644 index 0000000..ee509d4 --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/StaticText.qml b/src/imports/compatibility/Extras/StaticText.qml new file mode 100644 index 0000000..47483e3 --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/designer/CMakeLists.txt b/src/imports/compatibility/Extras/designer/CMakeLists.txt new file mode 100644 index 0000000..19ad43d --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/designer/ColorizedImageSpecifics.qml b/src/imports/compatibility/Extras/designer/ColorizedImageSpecifics.qml new file mode 100644 index 0000000..c0e9ce5 --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/designer/QtQuickUltraliteExtras.metainfo b/src/imports/compatibility/Extras/designer/QtQuickUltraliteExtras.metainfo new file mode 100644 index 0000000..ab5716c --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/designer/StaticTextSpecifics.qml b/src/imports/compatibility/Extras/designer/StaticTextSpecifics.qml new file mode 100644 index 0000000..e75bbfa --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/designer/images/image-icon.png b/src/imports/compatibility/Extras/designer/images/image-icon.png Binary files differnew file mode 100644 index 0000000..318ce08 --- /dev/null +++ b/src/imports/compatibility/Extras/designer/images/image-icon.png diff --git a/src/imports/compatibility/Extras/designer/images/image-icon@2x.png b/src/imports/compatibility/Extras/designer/images/image-icon@2x.png Binary files differnew file mode 100644 index 0000000..cc84918 --- /dev/null +++ b/src/imports/compatibility/Extras/designer/images/image-icon@2x.png diff --git a/src/imports/compatibility/Extras/designer/images/text-icon.png b/src/imports/compatibility/Extras/designer/images/text-icon.png Binary files differnew file mode 100644 index 0000000..29a81f5 --- /dev/null +++ b/src/imports/compatibility/Extras/designer/images/text-icon.png diff --git a/src/imports/compatibility/Extras/designer/images/text-icon@2x.png b/src/imports/compatibility/Extras/designer/images/text-icon@2x.png Binary files differnew file mode 100644 index 0000000..1df8f76 --- /dev/null +++ b/src/imports/compatibility/Extras/designer/images/text-icon@2x.png diff --git a/src/imports/compatibility/Extras/plugins.qmltypes b/src/imports/compatibility/Extras/plugins.qmltypes new file mode 100644 index 0000000..6a6c815 --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/qmldir b/src/imports/compatibility/Extras/qmldir new file mode 100644 index 0000000..fec69a2 --- /dev/null +++ b/src/imports/compatibility/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/compatibility/Extras/studiocompatibilityqulextras.cpp b/src/imports/compatibility/Extras/studiocompatibilityqulextras.cpp new file mode 100644 index 0000000..8b2804d --- /dev/null +++ b/src/imports/compatibility/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" |