forked from qt-creator/qt-creator
AssetExporter: Export type Label as text
Task-number: QDS-3979 Change-Id: I0920d242a480da9a27f26d39b44ab1d3714917e4 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include <private/qquicktext_p.h>
|
#include <private/qquicktext_p.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const QHash<QString, QString> AlignMapping{
|
const QHash<QString, QString> AlignMapping{
|
||||||
{"AlignRight", "RIGHT"},
|
{"AlignRight", "RIGHT"},
|
||||||
@@ -63,7 +65,10 @@ TextNodeDumper::TextNodeDumper(const QByteArrayList &lineage, const ModelNode &n
|
|||||||
|
|
||||||
bool TextNodeDumper::isExportable() const
|
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
|
QJsonObject TextNodeDumper::json(Component &component) const
|
||||||
|
|||||||
Reference in New Issue
Block a user