Merge remote-tracking branch 'origin/14.0'

Change-Id: Ib80c94c1afde25f4bb555ced11563d0e4904e57f
This commit is contained in:
Eike Ziller
2024-08-30 09:20:33 +02:00
18 changed files with 126 additions and 45 deletions

View File

@@ -10,7 +10,7 @@ find_package(yaml-cpp 0.5 QUIET NO_MODULE)
if (yaml-cpp_FOUND) if (yaml-cpp_FOUND)
# target doesn't set include directory for some reason # target doesn't set include directory for some reason
get_filename_component(yaml_cpp_include_dir "${YAML_CPP_INCLUDE_DIR}" ABSOLUTE) 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)
unset(yaml_cpp_include_dir CACHE) unset(yaml_cpp_include_dir CACHE)
find_path(yaml_cpp_include_dir yaml-cpp/yaml.h) 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

View File

@@ -257,7 +257,7 @@
The \uicontrol Timeline view displays a graphical representation of CPU The \uicontrol Timeline view displays a graphical representation of CPU
usage per thread and a condensed view of all recorded events. 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 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 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 \section1 Loading and Saving Trace Files
You can save and load trace data in a format specific to the You can save and load trace data in a format specific to the
Performance Analyzer with the respective entries in \uicontrol Analyze > Performance Analyzer (.ptq). This format is self-contained, and
\uicontrol {Performance Analyzer Options}. This format is self-contained, and
therefore loading it does not require you to specify the recording therefore loading it does not require you to specify the recording
environment. You can transfer such trace files to a different computer environment. You can transfer such trace files to a different computer
without any toolchain or debug symbols and analyze them there. 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 \section1 Troubleshooting
Performance Analyzer might fail to record data for the following reasons: Performance Analyzer might fail to record data for the following reasons:

View File

@@ -18,6 +18,10 @@
code model with the necessary information for correctly parsing the code code model with the necessary information for correctly parsing the code
when you open a file for editing. 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 To generate a compilation database from the information that the code model
has, select \uicontrol Build > \uicontrol {Generate Compilation Database}. has, select \uicontrol Build > \uicontrol {Generate Compilation Database}.
@@ -37,5 +41,5 @@
database projects in the \uicontrol Projects mode. database projects in the \uicontrol Projects mode.
\sa {Enable and disable plugins}, {Add custom build steps}, \sa {Enable and disable plugins}, {Add custom build steps},
{Configure projects for running}, {Code Model} {Configure projects for running}, {Code Model}, {Configuring Projects}
*/ */

View File

@@ -30,6 +30,8 @@ if (NOT QT_CREATOR_API_DEFINED)
CMAKE_GENERATOR_PLATFORM "${arch}" CMAKE_GENERATOR_PLATFORM "${arch}"
CMAKE_ARGS CMAKE_ARGS
-D${PROJECT_NAME}-MultiBuild=ON -D${PROJECT_NAME}-MultiBuild=ON
-DPythonTargetArchDll=${PythonTarget${arch}Dll}
-DPython3_ROOT_DIR=${Python3_ROOT_DIR}
BUILD_COMMAND BUILD_COMMAND
${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND INSTALL_COMMAND

View File

@@ -43,6 +43,7 @@ add_qtc_plugin(CMakeProjectManager
presetsparser.cpp presetsparser.h presetsparser.cpp presetsparser.h
presetsmacros.cpp presetsmacros.h presetsmacros.cpp presetsmacros.h
projecttreehelper.cpp projecttreehelper.h projecttreehelper.cpp projecttreehelper.h
targethelper.cpp targethelper.h
3rdparty/cmake/cmListFileCache.cxx 3rdparty/cmake/cmListFileCache.cxx
3rdparty/cmake/cmListFileLexer.cxx 3rdparty/cmake/cmListFileLexer.cxx
3rdparty/cmake/cmListFileCache.h 3rdparty/cmake/cmListFileCache.h

View File

@@ -3,10 +3,10 @@
#include "cmakelocatorfilter.h" #include "cmakelocatorfilter.h"
#include "cmakebuildstep.h"
#include "cmakebuildsystem.h" #include "cmakebuildsystem.h"
#include "cmakeproject.h" #include "cmakeproject.h"
#include "cmakeprojectmanagertr.h" #include "cmakeprojectmanagertr.h"
#include "targethelper.h"
#include <coreplugin/locator/ilocatorfilter.h> #include <coreplugin/locator/ilocatorfilter.h>
@@ -108,36 +108,6 @@ static void setupFilter(ILocatorFilter *filter)
filter, projectListUpdated); 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 class CMakeBuildTargetFilter final : ILocatorFilter
{ {
public: public:
@@ -152,7 +122,7 @@ public:
} }
private: private:
LocatorMatcherTasks matchers() final { return cmakeMatchers(&buildAcceptor); } LocatorMatcherTasks matchers() final { return cmakeMatchers(&buildTarget); }
}; };
// OpenCMakeTargetLocatorFilter // OpenCMakeTargetLocatorFilter

View File

@@ -76,6 +76,7 @@ private:
QAction *m_runCMakeAction; QAction *m_runCMakeAction;
QAction *m_clearCMakeCacheAction; QAction *m_clearCMakeCacheAction;
QAction *m_runCMakeActionContextMenu; QAction *m_runCMakeActionContextMenu;
QAction *m_clearCMakeCacheActionContextMenu;
QAction *m_rescanProjectAction; QAction *m_rescanProjectAction;
QAction *m_buildFileContextMenu; QAction *m_buildFileContextMenu;
QAction *m_reloadCMakePresetsAction; QAction *m_reloadCMakePresetsAction;
@@ -142,7 +143,7 @@ CMakeManager::CMakeManager()
ActionBuilder(this, Constants::CLEAR_CMAKE_CACHE_CONTEXT_MENU) ActionBuilder(this, Constants::CLEAR_CMAKE_CACHE_CONTEXT_MENU)
.setText(Tr::tr("Clear CMake Configuration")) .setText(Tr::tr("Clear CMake Configuration"))
.setContext(projectContext) .setContext(projectContext)
.bindContextAction(&m_clearCMakeCacheAction) .bindContextAction(&m_clearCMakeCacheActionContextMenu)
.setCommandAttribute(Command::CA_Hide) .setCommandAttribute(Command::CA_Hide)
.addToContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_REBUILD) .addToContainer(PEC::M_PROJECTCONTEXT, PEC::G_PROJECT_REBUILD)
.addOnTriggered(this, [this] { clearCMakeCache(ProjectManager::startupBuildSystem()); }); .addOnTriggered(this, [this] { clearCMakeCache(ProjectManager::startupBuildSystem()); });
@@ -238,6 +239,7 @@ void CMakeManager::updateCmakeActions(Node *node)
const bool visible = project && !BuildManager::isBuilding(project); const bool visible = project && !BuildManager::isBuilding(project);
m_runCMakeAction->setVisible(visible); m_runCMakeAction->setVisible(visible);
m_runCMakeActionContextMenu->setEnabled(visible); m_runCMakeActionContextMenu->setEnabled(visible);
m_clearCMakeCacheActionContextMenu->setVisible(visible);
m_clearCMakeCacheAction->setVisible(visible); m_clearCMakeCacheAction->setVisible(visible);
m_rescanProjectAction->setVisible(visible); m_rescanProjectAction->setVisible(visible);
m_cmakeProfilerAction->setEnabled(visible); m_cmakeProfilerAction->setEnabled(visible);

View File

@@ -86,7 +86,9 @@ QtcPlugin {
"presetsmacros.cpp", "presetsmacros.cpp",
"presetsmacros.h", "presetsmacros.h",
"projecttreehelper.cpp", "projecttreehelper.cpp",
"projecttreehelper.h" "projecttreehelper.h",
"targethelper.cpp",
"targethelper.h",
] ]
Group { Group {

View 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

View 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

View File

@@ -31,9 +31,10 @@ MimeTypeMagicDialog::MimeTypeMagicDialog(QWidget *parent) :
setWindowTitle(Tr::tr("Add Magic Header")); setWindowTitle(Tr::tr("Add Magic Header"));
auto informationLabel = new QLabel; auto informationLabel = new QLabel;
informationLabel->setText(Tr::tr("<html><head/><body><p>MIME magic data is interpreted as defined " informationLabel->setText(
Tr::tr("<html><head/><body><p>MIME magic data is interpreted as defined "
"by the Shared MIME-info Database specification from " "by the Shared MIME-info Database specification from "
"<a href=\"http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html\">" "<a href=\"https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/\">"
"freedesktop.org</a>.<hr/></p></body></html>")); // FIXME: Simplify for translators "freedesktop.org</a>.<hr/></p></body></html>")); // FIXME: Simplify for translators
informationLabel->setWordWrap(true); informationLabel->setWordWrap(true);

View File

@@ -415,6 +415,12 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t
targetAbi.osFlavor() <= Abi::WindowsLastMsvcFlavor; targetAbi.osFlavor() <= Abi::WindowsLastMsvcFlavor;
if (!isMsvcTarget && (engineType == GdbEngineType || engineType == LldbEngineType)) if (!isMsvcTarget && (engineType == GdbEngineType || engineType == LldbEngineType))
matchOnMultiarch = DebuggerItem::MatchesSomewhat; 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 if (debuggerAbi.architecture() != Abi::UnknownArchitecture
&& debuggerAbi.architecture() != targetAbi.architecture()) && debuggerAbi.architecture() != targetAbi.architecture())
return matchOnMultiarch; return matchOnMultiarch;

View File

@@ -1,5 +1,5 @@
add_qtc_plugin(QmlJSEditor add_qtc_plugin(QmlJSEditor
DEPENDS LanguageUtils QmlJS QmlEditorWidgets DEPENDS LanguageUtils QmlJS QmlEditorWidgets CMakeProjectManager
PLUGIN_DEPENDS Core ProjectExplorer QmlJSTools TextEditor LanguageClient PLUGIN_DEPENDS Core ProjectExplorer QmlJSTools TextEditor LanguageClient
SOURCES SOURCES
qmlexpressionundercursor.cpp qmlexpressionundercursor.h qmlexpressionundercursor.cpp qmlexpressionundercursor.h

View File

@@ -23,5 +23,7 @@ const char TASK_CATEGORY_QML_ANALYSIS[] = "Task.Category.QmlAnalysis";
const char QML_SNIPPETS_GROUP_ID[] = "QML"; const char QML_SNIPPETS_GROUP_ID[] = "QML";
const char QMLLINT_BUILD_TARGET[] = "all_qmllint";
} // namespace Constants } // namespace Constants
} // namespace QmlJSEditor } // namespace QmlJSEditor

View File

@@ -3,11 +3,16 @@
#include "qmltaskmanager.h" #include "qmltaskmanager.h"
#include "qmljseditorconstants.h" #include "qmljseditorconstants.h"
#include "qmljseditorsettings.h"
#include <cmakeprojectmanager/targethelper.h>
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/idocument.h> #include <coreplugin/idocument.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectmanager.h>
#include <projectexplorer/taskhub.h> #include <projectexplorer/taskhub.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <qmljs/qmljsmodelmanagerinterface.h> #include <qmljs/qmljsmodelmanagerinterface.h>
#include <qmljs/qmljscontext.h> #include <qmljs/qmljscontext.h>
#include <qmljs/qmljsconstants.h> #include <qmljs/qmljsconstants.h>
@@ -113,8 +118,27 @@ void QmlTaskManager::updateSemanticMessagesNow()
updateMessagesNow(true); updateMessagesNow(true);
} }
static void triggerQmllintCMakeTarget()
{
CMakeProjectManager::buildTarget(
ProjectManager::startupProject()->projectFilePath(), Constants::QMLLINT_BUILD_TARGET);
}
void QmlTaskManager::updateMessagesNow(bool updateSemantic) 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 // don't restart a small update if a big one is running
if (!updateSemantic && m_updatingSemantic) if (!updateSemantic && m_updatingSemantic)
return; return;

View File

@@ -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 const QStringList order = categoryOrder.isEmpty() && m_isExamples ? *defaultOrder
: categoryOrder; : categoryOrder;
const QList<std::pair<Section, QList<ExampleItem *>>> sections const QList<std::pair<Section, QList<ExampleItem *>>> sections