From ea13277c7a6522183c01b2569b181d69f068bc3a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 28 Sep 2022 16:56:31 +0200 Subject: 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 Reviewed-by: Vikas Pachdha Reviewed-by: --- .../qmldesigner/components/componentcore/modelnodeoperations.cpp | 4 ++-- 1 file 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 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 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(); -- cgit v1.2.3