Files
qt-creator/src/plugins/qmljstools/qmljsmodelmanager.h
Marcus Tillmanns 129448d61d QmlJS: Fix Follow under cursor
When trying to jump to a symbol in a qml file the Qml Model may find
the location in a generated .qml file in the build folder.
QtCreator searches in all generated .qrc files to try and find
the source file so it can jump to it instead.

Previously not all auto-generated ".rcc" folders would be found
as only the folders of targets (executables) were searched.
Plugins or Static Libraries were not searched.

With this fix, all projects nodes are searched for the ".rcc" folder
and therefore also finds them for Dynamic / Static libraries and
plugins.

Fixes: QTCREATORBUG-27173
Change-Id: Ic51ac8fbc82c15785cbefd76787942a512ecf3db
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-11-08 09:54:10 +00:00

46 lines
1.3 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include "qmljstools_global.h"
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <QFuture>
QT_FORWARD_DECLARE_CLASS(QTimer)
QT_FORWARD_DECLARE_CLASS(QLocale)
namespace Utils { class MimeType; }
namespace QmlJSTools {
namespace Internal {
class QMLJSTOOLS_EXPORT ModelManager: public QmlJS::ModelManagerInterface
{
Q_OBJECT
public:
ModelManager();
~ModelManager() override;
void delayedInitialization();
protected:
QHash<QString, QmlJS::Dialect> languageForSuffix() const override;
void writeMessageInternal(const QString &msg) const override;
WorkingCopy workingCopyInternal() const override;
void addTaskInternal(const QFuture<void> &result, const QString &msg,
const char *taskId) const override;
ProjectInfo defaultProjectInfoForProject(
ProjectExplorer::Project *project, const Utils::FilePaths &hiddenRccFolders) const override;
private:
void updateDefaultProjectInfo();
void loadDefaultQmlTypeDescriptions();
QHash<QString, QmlJS::Dialect> initLanguageForSuffix() const;
};
} // namespace Internal
} // namespace QmlJSTools