summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-09-28 16:56:31 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2022-10-19 09:45:32 +0000
commitea13277c7a6522183c01b2569b181d69f068bc3a (patch)
treeb9e033b5d859f417b68a35c8aa939beb6b07aa14
parent3be3663bf767d33c44297a7be957591939f4b7b7 (diff)
downloadqt-creator-ea13277c7a6522183c01b2569b181d69f068bc3a.tar.gz
QmlDesigner: Fix StyleMerger for custom types
If the template uses custom types they are only found if we register the correct fileUrl. Change-Id: Ia358a39d5c5c5bbcaf403ae3c250495ddadfc326 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r--src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
index 0d5a10fb10..92f903aa0a 100644
--- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
+++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
@@ -1514,7 +1514,7 @@ void styleMerge(const SelectionContext &selectionContext, const QString &templat
QScopedPointer<Model> templateModel(Model::create("QtQuick.Item", 2, 1, parentModel));
Q_ASSERT(templateModel.data());
- templateModel->setFileUrl(QUrl::fromLocalFile(templateFile));
+ templateModel->setFileUrl(selectionContext.view()->model()->fileUrl());
QPlainTextEdit textEditTemplate;
Utils::FileReader reader;
@@ -1540,7 +1540,7 @@ void styleMerge(const SelectionContext &selectionContext, const QString &templat
QScopedPointer<Model> styleModel(Model::create("QtQuick.Item", 2, 1, parentModel));
Q_ASSERT(styleModel.data());
- styleModel->setFileUrl(QUrl::fromLocalFile(templateFile));
+ styleModel->setFileUrl(selectionContext.view()->model()->fileUrl());
QPlainTextEdit textEditStyle;
RewriterView *parentRewriterView = selectionContext.view()->model()->rewriterView();