diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-09-28 16:56:31 +0200 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2022-10-19 09:45:32 +0000 |
commit | ea13277c7a6522183c01b2569b181d69f068bc3a (patch) | |
tree | b9e033b5d859f417b68a35c8aa939beb6b07aa14 | |
parent | 3be3663bf767d33c44297a7be957591939f4b7b7 (diff) | |
download | qt-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.cpp | 4 |
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(); |