summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cpptoolsplugin.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2021-06-28 14:55:54 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2021-06-30 15:09:56 +0000
commitfbb804c442e34d669f7ce4e6a39aacd554ef8008 (patch)
tree73f5b5d4f1d2ae487e453c27e44de27c17c8a51d /src/plugins/cpptools/cpptoolsplugin.cpp
parentb3c83b79f70546c4ba16f41b30e32b5d163de71a (diff)
downloadqt-creator-fbb804c442e34d669f7ce4e6a39aacd554ef8008.tar.gz
Clangd: Add per-project settings
Users might want to use clangd for certain project, but not for others. Change-Id: Id29ce3349f0acd359cf7c824ece073b147ed2280 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp')
-rw-r--r--src/plugins/cpptools/cpptoolsplugin.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp
index 87ecc25d71..1e77501c0f 100644
--- a/src/plugins/cpptools/cpptoolsplugin.cpp
+++ b/src/plugins/cpptools/cpptoolsplugin.cpp
@@ -49,6 +49,7 @@
#include <cppeditor/cppeditorconstants.h>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/project.h>
+#include <projectexplorer/projectpanelfactory.h>
#include <projectexplorer/projecttree.h>
#include <utils/algorithm.h>
@@ -210,6 +211,14 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
tr("Insert \"#pragma once\" instead of \"#ifndef\" include guards into header file"),
[] { return usePragmaOnce() ? QString("true") : QString(); });
+ const auto panelFactory = new ProjectExplorer::ProjectPanelFactory;
+ panelFactory->setPriority(100);
+ panelFactory->setDisplayName(tr("Clangd"));
+ panelFactory->setCreateWidgetFunction([](ProjectExplorer::Project *project) {
+ return new ClangdProjectSettingsWidget(project);
+ });
+ ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory);
+
return true;
}