forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/14.0'
Change-Id: Ib80c94c1afde25f4bb555ced11563d0e4904e57f
This commit is contained in:
@@ -10,7 +10,7 @@ find_package(yaml-cpp 0.5 QUIET NO_MODULE)
|
||||
if (yaml-cpp_FOUND)
|
||||
# target doesn't set include directory for some reason
|
||||
get_filename_component(yaml_cpp_include_dir "${YAML_CPP_INCLUDE_DIR}" ABSOLUTE)
|
||||
if (NOT EXISTS yaml_cpp_include_dir)
|
||||
if (NOT EXISTS ${yaml_cpp_include_dir})
|
||||
unset(yaml_cpp_include_dir)
|
||||
unset(yaml_cpp_include_dir CACHE)
|
||||
find_path(yaml_cpp_include_dir yaml-cpp/yaml.h)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 19 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@@ -257,7 +257,7 @@
|
||||
The \uicontrol Timeline view displays a graphical representation of CPU
|
||||
usage per thread and a condensed view of all recorded events.
|
||||
|
||||
\image qtcreator-performance-analyzer-timeline.png {Performance Analyzer}
|
||||
\image qtcreator-performance-analyzer-timeline.webp {Performance Analyzer Timeline view}
|
||||
|
||||
Each category in the timeline describes a thread in the application. Move
|
||||
the cursor on an event (5) on a row to see how long it takes and which
|
||||
@@ -452,12 +452,16 @@
|
||||
\section1 Loading and Saving Trace Files
|
||||
|
||||
You can save and load trace data in a format specific to the
|
||||
Performance Analyzer with the respective entries in \uicontrol Analyze >
|
||||
\uicontrol {Performance Analyzer Options}. This format is self-contained, and
|
||||
Performance Analyzer (.ptq). This format is self-contained, and
|
||||
therefore loading it does not require you to specify the recording
|
||||
environment. You can transfer such trace files to a different computer
|
||||
without any toolchain or debug symbols and analyze them there.
|
||||
|
||||
To load trace data, go to \uicontrol Analyze >
|
||||
\uicontrol {Performance Analyzer Options} > \uicontrol {Load Trace File}.
|
||||
|
||||
To save trace data, select \uicontrol {Save Trace File}.
|
||||
|
||||
\section1 Troubleshooting
|
||||
|
||||
Performance Analyzer might fail to record data for the following reasons:
|
||||
|
@@ -18,6 +18,10 @@
|
||||
code model with the necessary information for correctly parsing the code
|
||||
when you open a file for editing.
|
||||
|
||||
To open a compilation database as a \l {Managing Projects}{project}, go to
|
||||
\uicontrol File > \uicontrol {Open File or Project} and select a compilation
|
||||
database JSON file.
|
||||
|
||||
To generate a compilation database from the information that the code model
|
||||
has, select \uicontrol Build > \uicontrol {Generate Compilation Database}.
|
||||
|
||||
@@ -37,5 +41,5 @@
|
||||
database projects in the \uicontrol Projects mode.
|
||||
|
||||
\sa {Enable and disable plugins}, {Add custom build steps},
|
||||
{Configure projects for running}, {Code Model}
|
||||
{Configure projects for running}, {Code Model}, {Configuring Projects}
|
||||
*/
|
||||
|
@@ -30,6 +30,8 @@ if (NOT QT_CREATOR_API_DEFINED)
|
||||
CMAKE_GENERATOR_PLATFORM "${arch}"
|
||||
CMAKE_ARGS
|
||||
-D${PROJECT_NAME}-MultiBuild=ON
|
||||
-DPythonTargetArchDll=${PythonTarget${arch}Dll}
|
||||
-DPython3_ROOT_DIR=${Python3_ROOT_DIR}
|
||||
BUILD_COMMAND
|
||||
${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
|
||||
INSTALL_COMMAND
|
||||
|
@@ -43,6 +43,7 @@ add_qtc_plugin(CMakeProjectManager
|
||||
presetsparser.cpp presetsparser.h
|
||||
presetsmacros.cpp presetsmacros.h
|
||||
projecttreehelper.cpp projecttreehelper.h
|
||||
targethelper.cpp targethelper.h
|
||||
3rdparty/cmake/cmListFileCache.cxx
|
||||
3rdparty/cmake/cmListFileLexer.cxx
|
||||
3rdparty/cmake/cmListFileCache.h
|
||||
|
@@ -3,10 +3,10 @@
|
||||
|
||||
#include "cmakelocatorfilter.h"
|
||||
|
||||
#include "cmakebuildstep.h"
|
||||
#include "cmakebuildsystem.h"
|
||||
#include "cmakeproject.h"
|
||||
#include "cmakeprojectmanagertr.h"
|
||||
#include "targethelper.h"
|
||||
|
||||
#include <coreplugin/locator/ilocatorfilter.h>
|
||||
|
||||
@@ -108,36 +108,6 @@ static void setupFilter(ILocatorFilter *filter)
|
||||
filter, projectListUpdated);
|
||||
}
|
||||
|
||||
static void buildAcceptor(const FilePath &projectPath, const QString &displayName)
|
||||
{
|
||||
// Get the project containing the target selected
|
||||
const auto cmakeProject = qobject_cast<CMakeProject *>(
|
||||
Utils::findOrDefault(ProjectManager::projects(), [projectPath](Project *p) {
|
||||
return p->projectFilePath() == projectPath;
|
||||
}));
|
||||
if (!cmakeProject || !cmakeProject->activeTarget()
|
||||
|| !cmakeProject->activeTarget()->activeBuildConfiguration())
|
||||
return;
|
||||
|
||||
if (BuildManager::isBuilding(cmakeProject))
|
||||
BuildManager::cancel();
|
||||
|
||||
// Find the make step
|
||||
const BuildStepList *buildStepList =
|
||||
cmakeProject->activeTarget()->activeBuildConfiguration()->buildSteps();
|
||||
const auto buildStep = buildStepList->firstOfType<CMakeBuildStep>();
|
||||
if (!buildStep)
|
||||
return;
|
||||
|
||||
// Change the make step to build only the given target
|
||||
const QStringList oldTargets = buildStep->buildTargets();
|
||||
buildStep->setBuildTargets({displayName});
|
||||
|
||||
// Build
|
||||
BuildManager::buildProjectWithDependencies(cmakeProject);
|
||||
buildStep->setBuildTargets(oldTargets);
|
||||
}
|
||||
|
||||
class CMakeBuildTargetFilter final : ILocatorFilter
|
||||
{
|
||||
public:
|
||||
@@ -152,7 +122,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
LocatorMatcherTasks matchers() final { return cmakeMatchers(&buildAcceptor); }
|
||||
LocatorMatcherTasks matchers() final { return cmakeMatchers(&buildTarget); }
|
||||
};
|
||||
|
||||
// OpenCMakeTargetLocatorFilter
|
||||
|
@@ -76,6 +76,7 @@ private:
|
||||
QAction *m_runCMakeAction;
|
||||
QAction *m_clearCMakeCacheAction;
|
||||
QAction *m_runCMakeActionContextMenu;
|
||||
QAction *m_clearCMakeCacheActionContextMenu;
|
||||
QAction *m_rescanProjectAction;
|
||||
QAction *m_buildFileContextMenu;
|
||||
QAction *m_reloadCMakePresetsAction;
|
||||
@@ -142,7 +143,7 @@ CMakeManager::CMakeManager()
|
||||
ActionBuilder(this, Constants::CLEAR_CMAKE_CACHE_CONTEXT_MENU)
|
||||
.setText(Tr::tr("Clear CMake Configuration"))
|
||||
.setContext(projectContext)
|
||||
.bindContextAction(&m_clearCMakeCacheAction)
|
||||
.bindContextAction(&m_clearCMakeCacheActionContextMenu)
|
||||
.setCommandAttribute(Command::CA_Hide)
|
||||
.addToContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_REBUILD)
|
||||
.addOnTriggered(this, [this] { clearCMakeCache(ProjectManager::startupBuildSystem()); });
|
||||
@@ -238,6 +239,7 @@ void CMakeManager::updateCmakeActions(Node *node)
|
||||
const bool visible = project && !BuildManager::isBuilding(project);
|
||||
m_runCMakeAction->setVisible(visible);
|
||||
m_runCMakeActionContextMenu->setEnabled(visible);
|
||||
m_clearCMakeCacheActionContextMenu->setVisible(visible);
|
||||
m_clearCMakeCacheAction->setVisible(visible);
|
||||
m_rescanProjectAction->setVisible(visible);
|
||||
m_cmakeProfilerAction->setEnabled(visible);
|
||||
|
@@ -86,7 +86,9 @@ QtcPlugin {
|
||||
"presetsmacros.cpp",
|
||||
"presetsmacros.h",
|
||||
"projecttreehelper.cpp",
|
||||
"projecttreehelper.h"
|
||||
"projecttreehelper.h",
|
||||
"targethelper.cpp",
|
||||
"targethelper.h",
|
||||
]
|
||||
|
||||
Group {
|
||||
|
48
src/plugins/cmakeprojectmanager/targethelper.cpp
Normal file
48
src/plugins/cmakeprojectmanager/targethelper.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
// Copyright (C) 2024 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include "targethelper.h"
|
||||
|
||||
#include <projectexplorer/buildmanager.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
#include "cmakebuildstep.h"
|
||||
#include "cmakebuildsystem.h"
|
||||
#include "cmakeproject.h"
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
|
||||
void buildTarget(const Utils::FilePath &projectPath, const QString &targetName)
|
||||
{
|
||||
// Get the project containing the target selected
|
||||
const auto cmakeProject = qobject_cast<CMakeProject *>(Utils::findOrDefault(
|
||||
ProjectExplorer::ProjectManager::projects(), [projectPath](ProjectExplorer::Project *p) {
|
||||
return p->projectFilePath() == projectPath;
|
||||
}));
|
||||
if (!cmakeProject || !cmakeProject->activeTarget()
|
||||
|| !cmakeProject->activeTarget()->activeBuildConfiguration())
|
||||
return;
|
||||
|
||||
if (ProjectExplorer::BuildManager::isBuilding(cmakeProject))
|
||||
ProjectExplorer::BuildManager::cancel();
|
||||
|
||||
// Find the make step
|
||||
const ProjectExplorer::BuildStepList *buildStepList
|
||||
= cmakeProject->activeTarget()->activeBuildConfiguration()->buildSteps();
|
||||
const auto buildStep = buildStepList->firstOfType<Internal::CMakeBuildStep>();
|
||||
if (!buildStep)
|
||||
return;
|
||||
|
||||
// Change the make step to build only the given target
|
||||
const QStringList oldTargets = buildStep->buildTargets();
|
||||
buildStep->setBuildTargets({targetName});
|
||||
|
||||
// Build
|
||||
ProjectExplorer::BuildManager::buildProjectWithDependencies(cmakeProject);
|
||||
buildStep->setBuildTargets(oldTargets);
|
||||
}
|
||||
|
||||
} // namespace CMakeProjectManager
|
14
src/plugins/cmakeprojectmanager/targethelper.h
Normal file
14
src/plugins/cmakeprojectmanager/targethelper.h
Normal file
@@ -0,0 +1,14 @@
|
||||
// Copyright (C) 2024 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cmake_global.h"
|
||||
|
||||
#include <utils/filepath.h>
|
||||
|
||||
namespace CMakeProjectManager {
|
||||
|
||||
CMAKE_EXPORT void buildTarget(const Utils::FilePath &projectPath, const QString &targetName);
|
||||
|
||||
} // namespace CMakeProjectManager
|
@@ -31,10 +31,11 @@ MimeTypeMagicDialog::MimeTypeMagicDialog(QWidget *parent) :
|
||||
setWindowTitle(Tr::tr("Add Magic Header"));
|
||||
|
||||
auto informationLabel = new QLabel;
|
||||
informationLabel->setText(Tr::tr("<html><head/><body><p>MIME magic data is interpreted as defined "
|
||||
"by the Shared MIME-info Database specification from "
|
||||
"<a href=\"http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html\">"
|
||||
"freedesktop.org</a>.<hr/></p></body></html>")); // FIXME: Simplify for translators
|
||||
informationLabel->setText(
|
||||
Tr::tr("<html><head/><body><p>MIME magic data is interpreted as defined "
|
||||
"by the Shared MIME-info Database specification from "
|
||||
"<a href=\"https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/\">"
|
||||
"freedesktop.org</a>.<hr/></p></body></html>")); // FIXME: Simplify for translators
|
||||
informationLabel->setWordWrap(true);
|
||||
|
||||
m_valueLineEdit = new QLineEdit;
|
||||
|
@@ -415,6 +415,12 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t
|
||||
targetAbi.osFlavor() <= Abi::WindowsLastMsvcFlavor;
|
||||
if (!isMsvcTarget && (engineType == GdbEngineType || engineType == LldbEngineType))
|
||||
matchOnMultiarch = DebuggerItem::MatchesSomewhat;
|
||||
// arm64 cdb can debug x64 targets
|
||||
if (isMsvcTarget && engineType == CdbEngineType
|
||||
&& debuggerAbi.architecture() == Abi::ArmArchitecture
|
||||
&& targetAbi.architecture() == Abi::X86Architecture
|
||||
&& debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 64)
|
||||
return DebuggerItem::MatchesSomewhat;
|
||||
if (debuggerAbi.architecture() != Abi::UnknownArchitecture
|
||||
&& debuggerAbi.architecture() != targetAbi.architecture())
|
||||
return matchOnMultiarch;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
add_qtc_plugin(QmlJSEditor
|
||||
DEPENDS LanguageUtils QmlJS QmlEditorWidgets
|
||||
DEPENDS LanguageUtils QmlJS QmlEditorWidgets CMakeProjectManager
|
||||
PLUGIN_DEPENDS Core ProjectExplorer QmlJSTools TextEditor LanguageClient
|
||||
SOURCES
|
||||
qmlexpressionundercursor.cpp qmlexpressionundercursor.h
|
||||
|
@@ -23,5 +23,7 @@ const char TASK_CATEGORY_QML_ANALYSIS[] = "Task.Category.QmlAnalysis";
|
||||
|
||||
const char QML_SNIPPETS_GROUP_ID[] = "QML";
|
||||
|
||||
const char QMLLINT_BUILD_TARGET[] = "all_qmllint";
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace QmlJSEditor
|
||||
|
@@ -3,11 +3,16 @@
|
||||
|
||||
#include "qmltaskmanager.h"
|
||||
#include "qmljseditorconstants.h"
|
||||
#include "qmljseditorsettings.h"
|
||||
|
||||
#include <cmakeprojectmanager/targethelper.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/idocument.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectmanager.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
#include <qmljs/qmljscontext.h>
|
||||
#include <qmljs/qmljsconstants.h>
|
||||
@@ -113,8 +118,27 @@ void QmlTaskManager::updateSemanticMessagesNow()
|
||||
updateMessagesNow(true);
|
||||
}
|
||||
|
||||
static void triggerQmllintCMakeTarget()
|
||||
{
|
||||
CMakeProjectManager::buildTarget(
|
||||
ProjectManager::startupProject()->projectFilePath(), Constants::QMLLINT_BUILD_TARGET);
|
||||
}
|
||||
|
||||
|
||||
void QmlTaskManager::updateMessagesNow(bool updateSemantic)
|
||||
{
|
||||
// heuristic: qmllint will output meaningful warnings if qmlls is enabled
|
||||
if (QmllsSettingsManager::instance()->useQmlls()) {
|
||||
// abort any update that's going on already, and remove old codemodel warnings
|
||||
m_messageCollector.cancel();
|
||||
removeAllTasks(true);
|
||||
triggerQmllintCMakeTarget();
|
||||
return;
|
||||
}
|
||||
|
||||
// clear out the qmllint warnings when qmlls was disabled after being enabled
|
||||
TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_COMPILE);
|
||||
|
||||
// don't restart a small update if a big one is running
|
||||
if (!updateSemantic && m_updatingSemantic)
|
||||
return;
|
||||
|
@@ -440,7 +440,8 @@ void ExamplesViewController::updateExamples()
|
||||
}
|
||||
}
|
||||
|
||||
const bool sortIntoCategories = !m_isExamples || qtVersion >= *minQtVersionForCategories;
|
||||
const bool sortIntoCategories = !m_isExamples || qtVersion.isNull()
|
||||
|| qtVersion >= *minQtVersionForCategories;
|
||||
const QStringList order = categoryOrder.isEmpty() && m_isExamples ? *defaultOrder
|
||||
: categoryOrder;
|
||||
const QList<std::pair<Section, QList<ExampleItem *>>> sections
|
||||
|
Reference in New Issue
Block a user