aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksei German <aleksei.german@qt.io>2023-05-31 18:09:38 +0200
committerAleksei German <aleksei.german@qt.io>2023-05-31 19:39:29 +0200
commit50f5e218ff75c3c21ffa4801cb068017373d371f (patch)
treea86626383a82c01d490628bb47dbf5a113537fdc
parent431aacafd28d2e9c45f42bd374098e0edcbd95fe (diff)
QmlDesigner: Fix for Ultralite compat qml package
- Improves ColorizedImage - Adds basic support for QulPerf singleton - Adds basic support for AnimatedSpriteDirectory - Adds basic support for internal type ItemBuffer Task-number: QDS-9846 Change-Id: Id84d0f19fcf342885afe3d36984b9c5d26999052 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/imports/compat/Extras/AnimatedSpriteDirectory.qml47
-rw-r--r--src/imports/compat/Extras/CMakeLists.txt3
-rw-r--r--src/imports/compat/Extras/ColorizedImage.qml30
-rw-r--r--src/imports/compat/Extras/ItemBuffer.qml37
-rw-r--r--src/imports/compat/Extras/QulPerf.qml50
-rw-r--r--src/imports/compat/Extras/StaticText.qml3
-rw-r--r--src/imports/compat/Extras/qmldir4
-rw-r--r--src/imports/compat/Layers/qmldir1
8 files changed, 152 insertions, 23 deletions
diff --git a/src/imports/compat/Extras/AnimatedSpriteDirectory.qml b/src/imports/compat/Extras/AnimatedSpriteDirectory.qml
new file mode 100644
index 0000000..6488268
--- /dev/null
+++ b/src/imports/compat/Extras/AnimatedSpriteDirectory.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2023 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
+//! [AnimatedSpriteDirectory compatibility]
+// Draws a sprite animation stored in a directory.
+Item {
+ property int currentFrame: 0
+ property int frameDuration: -2
+ property int loops: -1 //-1 = AnimatedSpriteDirectory.Infinite
+ property bool running: true
+ property string sourcePath
+
+ signal finished
+
+ function advance() {}
+ function restart() {}
+ function start() {}
+ function stop() {}
+}
+//! [AnimatedSpriteDirectory compatibility]
diff --git a/src/imports/compat/Extras/CMakeLists.txt b/src/imports/compat/Extras/CMakeLists.txt
index 32b4306..accfe1d 100644
--- a/src/imports/compat/Extras/CMakeLists.txt
+++ b/src/imports/compat/Extras/CMakeLists.txt
@@ -5,8 +5,11 @@ qt_internal_add_qml_module(QuickUltraLiteStudioExtras
NO_SYNC_QT
PAST_MAJOR_VERSIONS 1
QML_FILES
+ AnimatedSpriteDirectory.qml
ColorizedImage.qml
+ ItemBuffer.qml
StaticText.qml
+ QulPerf.qml
)
if(QT_FEATURE_quick_designer AND QT_BUILD_SHARED_LIBS)
diff --git a/src/imports/compat/Extras/ColorizedImage.qml b/src/imports/compat/Extras/ColorizedImage.qml
index ee509d4..d440b39 100644
--- a/src/imports/compat/Extras/ColorizedImage.qml
+++ b/src/imports/compat/Extras/ColorizedImage.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2023 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Quick Ultralite compatibility.
@@ -29,27 +29,17 @@
import QtQuick 2.12
import Qt5Compat.GraphicalEffects
-import QtQuickUltralite.Extras 1.9
-
-Item {
+//! [ColorizedImage compatibility]
+// Displays a colorized image.
+Image {
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
- }
+ layer.enabled: true
+ layer.effect: ColorOverlay {
+ anchors.fill: colorizedRoot
+ source: colorizedRoot
+ color: colorizedRoot.color
}
}
+//! [ColorizedImage compatibility]
diff --git a/src/imports/compat/Extras/ItemBuffer.qml b/src/imports/compat/Extras/ItemBuffer.qml
new file mode 100644
index 0000000..92e40ae
--- /dev/null
+++ b/src/imports/compat/Extras/ItemBuffer.qml
@@ -0,0 +1,37 @@
+/****************************************************************************
+**
+** Copyright (C) 2023 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
+//! [ItemBuffer compatibility]
+Item {
+ enum ExtraFlag { RedrawItemBufferFlag = 1 }
+// property Transform transform; //in regular QML this property is already provided by QtQuick.Item
+ property bool useAlphaChannel;
+}
+//! [ItemBuffer compatibility]
diff --git a/src/imports/compat/Extras/QulPerf.qml b/src/imports/compat/Extras/QulPerf.qml
new file mode 100644
index 0000000..97708ab
--- /dev/null
+++ b/src/imports/compat/Extras/QulPerf.qml
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2023 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$
+**
+****************************************************************************/
+pragma Singleton
+
+import QtQuick 2.12
+//! [QulPerf compatibility]
+// Holds information about application performance.
+// This data is only available if Qt Quick Ultralite is compiled with QUL_ENABLE_PERFORMANCE_LOGGING.
+// Properties will be updated every two seconds.
+// All properties are read-only.
+QtObject {
+ readonly property bool enabled: false
+ readonly property real fps: 0
+ readonly property real imageBlend: 0
+ readonly property real imageTransform: 0
+ readonly property int maxDirtyNodes: 0
+ readonly property real rectBlend: 0
+ readonly property real rectFill: 0
+ readonly property real rectRounded: 0
+ readonly property real repaint: 0
+ readonly property real textBlend: 0
+ readonly property real textLayout: 0
+}
+//! [QulPerf compatibility]
diff --git a/src/imports/compat/Extras/StaticText.qml b/src/imports/compat/Extras/StaticText.qml
index 47483e3..2a05b82 100644
--- a/src/imports/compat/Extras/StaticText.qml
+++ b/src/imports/compat/Extras/StaticText.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2021 The Qt Company Ltd.
+** Copyright (C) 2023 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Quick Ultralite compatibility.
@@ -29,6 +29,7 @@
import QtQuick 2.15
//! [StaticText compatibility]
+// Enables optimized drawing of text.
Text {
}
//! [StaticText compatibility]
diff --git a/src/imports/compat/Extras/qmldir b/src/imports/compat/Extras/qmldir
index fec69a2..3b6b009 100644
--- a/src/imports/compat/Extras/qmldir
+++ b/src/imports/compat/Extras/qmldir
@@ -4,6 +4,8 @@ optional plugin studioqtquickultraliteextrasplugin
classname QtQuickUltralite_ExtrasPlugin
typeinfo studioqtquickultraliteextras.qmltypes
prefer :/QtQuickUltralite/Extras/
+AnimatedSpriteDirectory 1.0 AnimatedSpriteDirectory.qml
ColorizedImage 1.0 ColorizedImage.qml
+ItemBuffer 1.0 ItemBuffer.qml
StaticText 1.0 StaticText.qml
-
+singleton QulPerf 1.0 QulPerf.qml
diff --git a/src/imports/compat/Layers/qmldir b/src/imports/compat/Layers/qmldir
index 8d0a4b2..2c2c3ec 100644
--- a/src/imports/compat/Layers/qmldir
+++ b/src/imports/compat/Layers/qmldir
@@ -9,4 +9,3 @@ ImageLayer 1.0 ImageLayer.qml
ItemLayer 1.0 ItemLayer.qml
Screen 1.0 Screen.qml
SpriteLayer 1.0 SpriteLayer.qml
-