diff --git a/cmake/Findyaml-cpp.cmake b/cmake/Findyaml-cpp.cmake index b79056f67fe..06d518cf5db 100644 --- a/cmake/Findyaml-cpp.cmake +++ b/cmake/Findyaml-cpp.cmake @@ -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) diff --git a/doc/qtcreator/images/qtcreator-performance-analyzer-timeline.png b/doc/qtcreator/images/qtcreator-performance-analyzer-timeline.png deleted file mode 100644 index f47d79787ba..00000000000 Binary files a/doc/qtcreator/images/qtcreator-performance-analyzer-timeline.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-performance-analyzer-timeline.webp b/doc/qtcreator/images/qtcreator-performance-analyzer-timeline.webp new file mode 100644 index 00000000000..a8cecfd5626 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-performance-analyzer-timeline.webp differ diff --git a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc index d267eaf8f60..d34997b1ee0 100644 --- a/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/cpu-usage-analyzer.qdoc @@ -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: diff --git a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdoc b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdoc index 4bc641fb091..a3388374f49 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdoc @@ -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} */ diff --git a/src/libs/qtcreatorcdbext/CMakeLists.txt b/src/libs/qtcreatorcdbext/CMakeLists.txt index 587dc3c6d39..b62bdf9b317 100644 --- a/src/libs/qtcreatorcdbext/CMakeLists.txt +++ b/src/libs/qtcreatorcdbext/CMakeLists.txt @@ -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 diff --git a/src/plugins/cmakeprojectmanager/CMakeLists.txt b/src/plugins/cmakeprojectmanager/CMakeLists.txt index 2c58b4f08b3..7b282e79c85 100644 --- a/src/plugins/cmakeprojectmanager/CMakeLists.txt +++ b/src/plugins/cmakeprojectmanager/CMakeLists.txt @@ -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 diff --git a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp index 2445cf58b60..01ed02bdb0c 100644 --- a/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakelocatorfilter.cpp @@ -3,10 +3,10 @@ #include "cmakelocatorfilter.h" -#include "cmakebuildstep.h" #include "cmakebuildsystem.h" #include "cmakeproject.h" #include "cmakeprojectmanagertr.h" +#include "targethelper.h" #include @@ -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( - 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(); - 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 diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp index 9037fb0ad96..1a8c818491a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.cpp @@ -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); diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs index 98849a71f57..d51d24982e8 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs +++ b/src/plugins/cmakeprojectmanager/cmakeprojectmanager.qbs @@ -86,7 +86,9 @@ QtcPlugin { "presetsmacros.cpp", "presetsmacros.h", "projecttreehelper.cpp", - "projecttreehelper.h" + "projecttreehelper.h", + "targethelper.cpp", + "targethelper.h", ] Group { diff --git a/src/plugins/cmakeprojectmanager/targethelper.cpp b/src/plugins/cmakeprojectmanager/targethelper.cpp new file mode 100644 index 00000000000..3d18deaa84a --- /dev/null +++ b/src/plugins/cmakeprojectmanager/targethelper.cpp @@ -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 +#include +#include +#include +#include + +#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(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(); + 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 diff --git a/src/plugins/cmakeprojectmanager/targethelper.h b/src/plugins/cmakeprojectmanager/targethelper.h new file mode 100644 index 00000000000..1053d2b6d1b --- /dev/null +++ b/src/plugins/cmakeprojectmanager/targethelper.h @@ -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 + +namespace CMakeProjectManager { + +CMAKE_EXPORT void buildTarget(const Utils::FilePath &projectPath, const QString &targetName); + +} // namespace CMakeProjectManager diff --git a/src/plugins/coreplugin/mimetypemagicdialog.cpp b/src/plugins/coreplugin/mimetypemagicdialog.cpp index 2a55539bf76..b49b639f773 100644 --- a/src/plugins/coreplugin/mimetypemagicdialog.cpp +++ b/src/plugins/coreplugin/mimetypemagicdialog.cpp @@ -31,10 +31,11 @@ MimeTypeMagicDialog::MimeTypeMagicDialog(QWidget *parent) : setWindowTitle(Tr::tr("Add Magic Header")); auto informationLabel = new QLabel; - informationLabel->setText(Tr::tr("

MIME magic data is interpreted as defined " - "by the Shared MIME-info Database specification from " - "" - "freedesktop.org.


")); // FIXME: Simplify for translators + informationLabel->setText( + Tr::tr("

MIME magic data is interpreted as defined " + "by the Shared MIME-info Database specification from " + "" + "freedesktop.org.


")); // FIXME: Simplify for translators informationLabel->setWordWrap(true); m_valueLineEdit = new QLineEdit; diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 455b4e39862..dfa45da6d9b 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -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; diff --git a/src/plugins/qmljseditor/CMakeLists.txt b/src/plugins/qmljseditor/CMakeLists.txt index fcba4765f3b..2320c5ba7d1 100644 --- a/src/plugins/qmljseditor/CMakeLists.txt +++ b/src/plugins/qmljseditor/CMakeLists.txt @@ -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 diff --git a/src/plugins/qmljseditor/qmljseditorconstants.h b/src/plugins/qmljseditor/qmljseditorconstants.h index 25cc711bf0c..5ffbbc98c3b 100644 --- a/src/plugins/qmljseditor/qmljseditorconstants.h +++ b/src/plugins/qmljseditor/qmljseditorconstants.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 diff --git a/src/plugins/qmljseditor/qmltaskmanager.cpp b/src/plugins/qmljseditor/qmltaskmanager.cpp index ca985f4022e..3bf2e2cbdec 100644 --- a/src/plugins/qmljseditor/qmltaskmanager.cpp +++ b/src/plugins/qmljseditor/qmltaskmanager.cpp @@ -3,11 +3,16 @@ #include "qmltaskmanager.h" #include "qmljseditorconstants.h" +#include "qmljseditorsettings.h" +#include #include #include +#include #include +#include #include +#include #include #include #include @@ -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; diff --git a/src/plugins/qtsupport/exampleslistmodel.cpp b/src/plugins/qtsupport/exampleslistmodel.cpp index bd73137b00d..c9163c62fc6 100644 --- a/src/plugins/qtsupport/exampleslistmodel.cpp +++ b/src/plugins/qtsupport/exampleslistmodel.cpp @@ -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>> sections