forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -1514,7 +1514,7 @@ void styleMerge(const SelectionContext &selectionContext, const QString &templat
|
|||||||
QScopedPointer<Model> templateModel(Model::create("QtQuick.Item", 2, 1, parentModel));
|
QScopedPointer<Model> templateModel(Model::create("QtQuick.Item", 2, 1, parentModel));
|
||||||
Q_ASSERT(templateModel.data());
|
Q_ASSERT(templateModel.data());
|
||||||
|
|
||||||
templateModel->setFileUrl(QUrl::fromLocalFile(templateFile));
|
templateModel->setFileUrl(selectionContext.view()->model()->fileUrl());
|
||||||
|
|
||||||
QPlainTextEdit textEditTemplate;
|
QPlainTextEdit textEditTemplate;
|
||||||
Utils::FileReader reader;
|
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));
|
QScopedPointer<Model> styleModel(Model::create("QtQuick.Item", 2, 1, parentModel));
|
||||||
Q_ASSERT(styleModel.data());
|
Q_ASSERT(styleModel.data());
|
||||||
|
|
||||||
styleModel->setFileUrl(QUrl::fromLocalFile(templateFile));
|
styleModel->setFileUrl(selectionContext.view()->model()->fileUrl());
|
||||||
|
|
||||||
QPlainTextEdit textEditStyle;
|
QPlainTextEdit textEditStyle;
|
||||||
RewriterView *parentRewriterView = selectionContext.view()->model()->rewriterView();
|
RewriterView *parentRewriterView = selectionContext.view()->model()->rewriterView();
|
||||||
|
Reference in New Issue
Block a user