aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Pachdha <vikas.pachdha@qt.io>2021-03-25 17:21:57 +0100
committerVikas Pachdha <vikas.pachdha@qt.io>2021-03-26 07:31:46 +0000
commit28de5ec4fd2ad6ee3edd875840515164c7c7bf0c (patch)
tree976953a2842c023166adaaa49879045453d7de5c
parent60a275ce6245c0d3ce71b2d63bbeefd879dfef9c (diff)
AssetExporter: Export type Label as text
Task-number: QDS-3979 Change-Id: I0920d242a480da9a27f26d39b44ab1d3714917e4 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/plugins/qmldesigner/assetexporterplugin/dumpers/textnodedumper.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/assetexporterplugin/dumpers/textnodedumper.cpp b/src/plugins/qmldesigner/assetexporterplugin/dumpers/textnodedumper.cpp
index 49d16cb393..d9e9ace498 100644
--- a/src/plugins/qmldesigner/assetexporterplugin/dumpers/textnodedumper.cpp
+++ b/src/plugins/qmldesigner/assetexporterplugin/dumpers/textnodedumper.cpp
@@ -34,6 +34,8 @@
#include <private/qquicktext_p.h>
+#include <algorithm>
+
namespace {
const QHash<QString, QString> AlignMapping{
{"AlignRight", "RIGHT"},
@@ -63,7 +65,10 @@ TextNodeDumper::TextNodeDumper(const QByteArrayList &lineage, const ModelNode &n
bool TextNodeDumper::isExportable() const
{
- return lineage().contains("QtQuick.Text");
+ const QByteArrayList &baseClasses = lineage();
+ return std::any_of(baseClasses.cbegin(), baseClasses.cend(), [](const QByteArray &type) {
+ return type == "QtQuick.Text" || type == "QtQuick.Controls.Label";
+ });
}
QJsonObject TextNodeDumper::json(Component &component) const