diff --git a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf index 95d1475cf15..baca9a8654e 100644 --- a/doc/qtdesignstudio/config/qtdesignstudio.qdocconf +++ b/doc/qtdesignstudio/config/qtdesignstudio.qdocconf @@ -55,6 +55,7 @@ excludedirs += ../../qtcreator/examples/accelbubble \ ../../qtcreator/src/python \ ../../qtcreator/src/qnx \ ../../qtcreator/src/qtquick/creator-only \ + ../../qtcreator/src/reference \ ../../qtcreator/src/user-interface/creator-only \ ../../qtcreator/src/vcs/creator-only \ ../../qtcreator/src/widgets \ diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json index efdbb112d24..5d2f5e93903 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/wizard.json @@ -3,7 +3,7 @@ "supportedProjectTypes": [ "CMakeProjectManager.CMakeProject" ], "id": "U.QtQuickApplicationEmpty", "category": "D.ApplicationQt", - "trDescription": "Creates a Qt Quick application that can have both QML and C++ code. You can build the application and deploy it to desktop, embedded, and mobile target platforms.\n\nYou can select an option to create a project that you can open in Qt Design Studio, which has a visual editor for Qt Quick UIs.", + "trDescription": "Creates a Qt Quick application that can have both QML and C++ code. You can build the application and deploy it to desktop, embedded, and mobile target platforms.", "trDisplayName": "Qt Quick Application", "trDisplayCategory": "Application (Qt)", "icon": "icon.png", @@ -21,23 +21,7 @@ { "key": "HasFailureSignal", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.3' }"}, { "key": "UsesAutoResourcePrefix", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' }"}, { "key": "HasLoadFromModule", "value": "%{JS: value('MinimumSupportedQtVersion') > '6.4' && value('UsesAutoResourcePrefix') }"}, - { "key": "FeatureQt", "value": "QtSupport.Wizards.FeatureQt.%{MinimumSupportedQtVersion}"}, - { "key": "QdsWizardPath", "value": "%{IDE:ResourcePath}/qmldesigner/studio_templates/projects" }, - { "key": "NoQdsProjectStyle", "value": "%{JS: !%{QdsProjectStyle} }" }, - - { "key": "ImportModuleName", "value": "%{ProjectName}" }, - { "key": "ImportModuleVersion", "value": "" }, - { "key": "IsQt6Project", "value": true }, - { "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" }, - { "key": "ProjectPluginName", "value": "%{ProjectName}plugin" }, - { "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" }, - { "key": "QtQuickControlsStyle", "value": "Material" }, - { "key": "QtQuickControlsStyleTheme", "value": "Light" }, - { "key": "QtQuickVersion", "value": "6.2" }, - { "key": "ScreenHeight", "value": 1080 }, - { "key": "ScreenWidth", "value": 1920 }, - { "key": "UIClassName", "value": "Screen01" }, - { "key": "UIClassFileName", "value": "%{JS: Util.fileName('%{UIClassName}', 'ui.qml')}" } + { "key": "FeatureQt", "value": "QtSupport.Wizards.FeatureQt.%{MinimumSupportedQtVersion}"} ], "pages": @@ -53,18 +37,6 @@ "typeId": "Fields", "data": [ - { - "name": "QdsProjectStyle", - "trDisplayName": "Creates a project that you can open in Qt Design Studio", - "trToolTip": "Creates a project with a structure that is compatible both with Qt Design Studio (via .qmlproject) and with Qt Creator (via CMakeLists.txt). It contains a .ui.qml form that you can visually edit in Qt Design Studio.", - "type": "CheckBox", - "span": true, - "persistenceKey": "QtQuick.QdsProjectStyle", - "data": - { - "checked": false - } - }, { "name": "UseVirtualKeyboard", "trDisplayName": "Use Qt Virtual Keyboard", @@ -115,151 +87,21 @@ [ { "source": "CMakeLists.txt", - "openAsProject": true, - "condition": "%{NoQdsProjectStyle}" + "openAsProject": true }, { "source": "main.cpp", - "target": "%{MainCppFileName}", - "condition": "%{NoQdsProjectStyle}" + "target": "%{MainCppFileName}" }, { "source": "Main.qml.tpl", "target": "Main.qml", - "openInEditor": true, - "condition": "%{NoQdsProjectStyle}" + "openInEditor": true }, { "source": "../git.ignore", "target": ".gitignore", - "condition": "%{JS: %{NoQdsProjectStyle} && !value('IsSubproject') && value('VersionControl') === 'G.Git' }" - } - ] - }, - { - "typeId": "File", - "data": - [ - { - "source": "%{QdsWizardPath}/common/app.qmlproject.tpl", - "target": "%{ProjectDirectory}/%{QmlProjectFileName}", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/CMakeLists.main.txt.tpl", - "target": "%{ProjectDirectory}/CMakeLists.txt", - "openAsProject": true, - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/qmlmodules.tpl", - "target": "%{ProjectDirectory}/qmlmodules", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/qmlcomponents.tpl", - "target": "%{ProjectDirectory}/qmlcomponents", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/insight.tpl", - "target": "%{ProjectDirectory}/insight", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/main.qml", - "target": "%{ProjectDirectory}/main.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/qtquickcontrols2.conf.tpl", - "target": "%{ProjectDirectory}/qtquickcontrols2.conf", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/main.cpp.tpl", - "target": "%{ProjectDirectory}/src/main.cpp", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/app_environment.h.tpl", - "target": "%{ProjectDirectory}/src/app_environment.h", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/import_qml_plugins.h.tpl", - "target": "%{ProjectDirectory}/src/import_qml_plugins.h", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/import_qml_components_plugins.h.tpl", - "target": "%{ProjectDirectory}/src/import_qml_components_plugins.h", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/CMakeLists.content.txt.tpl", - "target": "%{ProjectDirectory}/content/CMakeLists.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/App.qml.tpl", - "target": "%{ProjectDirectory}/content/App.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/application/Screen01.ui.qml.tpl", - "target": "%{ProjectDirectory}/content/Screen01.ui.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/fonts.txt", - "target": "%{ProjectDirectory}/content/fonts/fonts.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/asset_imports.txt", - "target": "%{ProjectDirectory}/asset_imports/asset_imports.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/common/CMakeLists.imports.txt.tpl", - "target": "%{ProjectDirectory}/imports/CMakeLists.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/CMakeLists.importmodule.txt.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/CMakeLists.txt", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/importmodule.qmldir.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/qmldir", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/Constants.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/Constants.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/DirectoryFontLoader.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/DirectoryFontLoader.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/EventListModel.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListModel.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/EventListSimulator.qml.tpl", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/EventListSimulator.qml", - "condition": "%{QdsProjectStyle}" - }, - { - "source": "%{QdsWizardPath}/shared-plugin/name/designer/plugin.metainfo", - "target": "%{ProjectDirectory}/imports/%{ImportModuleName}/designer/plugin.metainfo", - "condition": "%{QdsProjectStyle}" + "condition": "%{JS: !value('IsSubproject') && value('VersionControl') === 'G.Git' }" } ] } diff --git a/src/libs/qtcreatorcdbext/CMakeLists.txt b/src/libs/qtcreatorcdbext/CMakeLists.txt index a431f8f32a4..587dc3c6d39 100644 --- a/src/libs/qtcreatorcdbext/CMakeLists.txt +++ b/src/libs/qtcreatorcdbext/CMakeLists.txt @@ -13,14 +13,55 @@ if (NOT QT_CREATOR_API_DEFINED) include(QtCreatorIDEBranding) include(QtCreatorAPI) qtc_handle_compiler_cache_support() + + # Compile for x86, x64 and arm64 + if (NOT ${PROJECT_NAME}-MultiBuild AND NOT MINGW) + include(ExternalProject) + + set(generator "Visual Studio 16 2019") + if(CMAKE_CXX_COMPILER MATCHES "Microsoft Visual Studio/2022/") + set(generator "Visual Studio 17 2022") + endif() + + macro (setup_library arch) + ExternalProject_Add(${arch}-bld + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" + CMAKE_GENERATOR "${generator}" + CMAKE_GENERATOR_PLATFORM "${arch}" + CMAKE_ARGS + -D${PROJECT_NAME}-MultiBuild=ON + BUILD_COMMAND + ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} + INSTALL_COMMAND + ${CMAKE_COMMAND} --install . --config ${CMAKE_BUILD_TYPE} + --prefix "${CMAKE_BINARY_DIR}" --component qtcreatorcdbext + ) + endmacro() + + if (NOT QTCREATORCDBEXT_BUILD_ARCHS) + set(QTCREATORCDBEXT_BUILD_ARCHS arm64 win32 x64) + endif() + foreach(arch IN LISTS QTCREATORCDBEXT_BUILD_ARCHS) + setup_library(${arch}) + endforeach() + + list(LENGTH QTCREATORCDBEXT_BUILD_ARCHS build_archs_length) + if (build_archs_length GREATER 0) + install( + DIRECTORY "${CMAKE_BINARY_DIR}/lib" + DESTINATION . + COMPONENT qtcreatorcdbext + ) + endif() + + return() + endif() endif() if (NOT WIN32 OR NOT MSVC) return() endif() -find_library(DbgEngLib dbgeng) - set(ArchSuffix "32") if (CMAKE_SIZEOF_VOID_P EQUAL 8) set(ArchSuffix "64") @@ -30,9 +71,13 @@ if (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM") set(ArchSuffix "arm${ArchSuffix}") endif() +if (NOT EXISTS "${CMAKE_BINARY_DIR}/lib/qtcreatorcdbext${ArchSuffix}") + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/lib/qtcreatorcdbext${ArchSuffix}") +endif() + add_qtc_library(qtcreatorcdbext SHARED COMPONENT qtcreatorcdbext - DEPENDS ${DbgEngLib} + DEPENDS dbgeng DESTINATION lib/qtcreatorcdbext${ArchSuffix}/ SOURCES common.cpp common.h @@ -95,18 +140,32 @@ if (_library_enabled) endif() # Support for cross-compilation for arm64 on a x64 system - if (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^AMD") + if (MSVC_CXX_ARCHITECTURE_ID STREQUAL "ARM64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64") + set(arm64_on_arm64 ON) + endif() + if (MSVC_CXX_ARCHITECTURE_ID STREQUAL "x64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64") + set(x64_on_x64 ON) + endif() + + if (NOT arm64_on_arm64 AND NOT x64_on_x64) find_program(dumpbin_executable dumpbin) find_program(lib_executable lib) string(TOLOWER ${MSVC_CXX_ARCHITECTURE_ID} lower_arch_name) + if (lower_arch_name STREQUAL "arm64") + set(python_suffix "arm64") + elseif (lower_arch_name STREQUAL "x64") + set(python_suffix "amd64") + else() + set(python_suffix "win32") + endif() if (NOT dumpbin_executable OR NOT lib_executable) message(WARNING "Couldn't locate dumpbin.exe or lib.exe executables") return() endif() - if (Python3_VERSION VERSION_LESS "3.11.0") + if (Python3_VERSION VERSION_LESS "3.11.0" AND lower_arch_name STREQUAL "arm64") message(WARNING "Python 3.11.0 needs to be installed. This version is the first version that has arm64 Windows support") return() endif() @@ -129,7 +188,7 @@ if (_library_enabled) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.def "${pythondef}") execute_process( - COMMAND ${lib_executable} + COMMAND "${lib_executable}" /def:${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.def /out:${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.lib /machine:${lower_arch_name} /nologo) set(Python3_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/${PythonNameWithVersion}.lib") @@ -139,7 +198,7 @@ if (_library_enabled) endif() if (NOT PythonTargetArchDll) - set(python_embed_url "https://www.python.org/ftp/python/${Python3_VERSION}/python-${Python3_VERSION}-embed-${lower_arch_name}.zip") + set(python_embed_url "https://www.python.org/ftp/python/${Python3_VERSION}/python-${Python3_VERSION}-embed-${python_suffix}.zip") message(STATUS "Downloading ${python_embed_url}") foreach(retry RANGE 10) diff --git a/src/libs/utils/hostosinfo.cpp b/src/libs/utils/hostosinfo.cpp index 4d24b2307f1..725f6dcf836 100644 --- a/src/libs/utils/hostosinfo.cpp +++ b/src/libs/utils/hostosinfo.cpp @@ -31,8 +31,24 @@ bool HostOsInfo::m_useOverrideFileNameCaseSensitivity = false; OsArch HostOsInfo::hostArchitecture() { +#ifdef Q_OS_WIN + // Workaround for Creator running in x86 emulation mode on ARM machines + static const OsArch arch = []() { + const HANDLE procHandle = GetCurrentProcess(); + ushort processMachine; + ushort nativeMachine; + if (IsWow64Process2(procHandle, &processMachine, &nativeMachine) + && nativeMachine == IMAGE_FILE_MACHINE_ARM64) { + return OsArchArm64; + } + + return osArchFromString(QSysInfo::currentCpuArchitecture()).value_or(OsArchUnknown); + }(); +#else static const OsArch arch = osArchFromString(QSysInfo::currentCpuArchitecture()).value_or(OsArchUnknown); +#endif + return arch; } diff --git a/src/plugins/axivion/axivionoutputpane.cpp b/src/plugins/axivion/axivionoutputpane.cpp index 033a65bd717..bf5016d3dad 100644 --- a/src/plugins/axivion/axivionoutputpane.cpp +++ b/src/plugins/axivion/axivionoutputpane.cpp @@ -669,7 +669,7 @@ void IssuesWidget::updateBasicProjectInfo(const std::optional &versions = info->versions; for (auto it = versions.crbegin(); it != versions.crend(); ++it) { const Dto::AnalysisVersionDto &version = *it; - versionLabels.append(version.label.value_or(version.name)); + versionLabels.append(version.name); m_versionDates.append(version.date); } m_signalBlocker.lock(); diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index 418769cbf12..61b98281548 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -92,7 +92,7 @@ private: void initPreview(TextEditor::ICodeStylePreferences *codeStyle); void initEditor(TextEditor::ICodeStylePreferences *codeStyle); - void reopenClangFormatDocument(); + void reopenClangFormatDocument(bool readOnly); void updatePreview(); void slotCodeStyleChanged(TextEditor::ICodeStylePreferences *currentPreferences); @@ -120,9 +120,13 @@ bool ClangFormatConfigWidget::eventFilter(QObject *object, QEvent *event) return QWidget::eventFilter(object, event); } -ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferences *codeStyle, - Project *project, - QWidget *parent) +static bool isReadOnlyCodeStyle(TextEditor::ICodeStylePreferences *style) +{ + return style->isReadOnly() || style->isTemporarilyReadOnly() || !style->isAdditionalTabVisible(); +} + +ClangFormatConfigWidget::ClangFormatConfigWidget( + TextEditor::ICodeStylePreferences *codeStyle, Project *project, QWidget *parent) : CodeStyleEditorWidget(parent) { m_project = project; @@ -152,7 +156,7 @@ ClangFormatConfigWidget::ClangFormatConfigWidget(TextEditor::ICodeStylePreferenc slotCodeStyleChanged(codeStyle->currentPreferences()); - reopenClangFormatDocument(); + reopenClangFormatDocument(isReadOnlyCodeStyle(codeStyle)); updatePreview(); } @@ -163,10 +167,7 @@ void ClangFormatConfigWidget::slotCodeStyleChanged(TextEditor::ICodeStylePrefere m_config.reset(new ClangFormatFile(codeStyle)); m_config->setIsReadOnly(codeStyle->isReadOnly()); - m_editorWidget->setEnabled(!codeStyle->isReadOnly() && !codeStyle->isTemporarilyReadOnly() - && codeStyle->isAdditionalTabVisible()); - - reopenClangFormatDocument(); + reopenClangFormatDocument(isReadOnlyCodeStyle(codeStyle)); updatePreview(); } @@ -188,8 +189,6 @@ void ClangFormatConfigWidget::initEditor(TextEditor::ICodeStylePreferences *code Q_ARG(Core::IEditor *, m_editor.get())); m_editorWidget = m_editor->widget(); - m_editorWidget->setEnabled(!codeStyle->isReadOnly() && !codeStyle->isTemporarilyReadOnly() - && codeStyle->isAdditionalTabVisible()); m_editorScrollArea->setWidget(m_editor->widget()); m_editorScrollArea->setWidgetResizable(true); @@ -309,7 +308,7 @@ void ClangFormatConfigWidget::updatePreview() m_preview->textDocument()->autoFormatOrIndent(cursor); } -void ClangFormatConfigWidget::reopenClangFormatDocument() +void ClangFormatConfigWidget::reopenClangFormatDocument(bool readOnly) { GuardLocker locker(m_ignoreChanges); @@ -319,6 +318,10 @@ void ClangFormatConfigWidget::reopenClangFormatDocument() invokeMethodForLanguageClientManager("documentOpened", Q_ARG(Core::IDocument *, m_editor->document())); } + + auto textEditorWidget = qobject_cast(m_editorWidget); + QTC_ASSERT(textEditorWidget, m_editorWidget->setEnabled(!readOnly); return;); + textEditorWidget->setReadOnly(readOnly); } void ClangFormatConfigWidget::apply() diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 46028cf4094..b2d256bed2d 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -70,7 +70,11 @@ clang::format::FormatStyle calculateQtcStyle() style.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; #endif style.BinPackArguments = false; +#if LLVM_VERSION_MAJOR >= 20 + style.BinPackParameters = FormatStyle::BPPS_OnePerLine; +#else style.BinPackParameters = false; +#endif style.BraceWrapping.AfterClass = true; style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never; style.BraceWrapping.AfterEnum = false; diff --git a/src/plugins/cmakeprojectmanager/presetsmacros.cpp b/src/plugins/cmakeprojectmanager/presetsmacros.cpp index cfc161b417e..8177d877352 100644 --- a/src/plugins/cmakeprojectmanager/presetsmacros.cpp +++ b/src/plugins/cmakeprojectmanager/presetsmacros.cpp @@ -101,7 +101,9 @@ static QString expandMacroEnv(const QString ¯oPrefix, do { done = true; for (qsizetype pos = 0; int len = findMacro(result, &pos, ¯oName);) { - result.replace(pos, len, op(macroName)); + const QString replacement = op(macroName); + // Prevent recursion by not allowing the same value to be reused + result.replace(pos, len, replacement != value ? replacement : ""); pos += macroName.length(); done = false; } @@ -129,80 +131,58 @@ static Environment getEnvCombined(const std::optional &optPresetEnv template void expand(const PresetType &preset, Environment &env, const FilePath &sourceDirectory) { - const Environment presetEnv = getEnvCombined(preset.environment, env); - presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool enabled) { + if (!preset.environment) + return; + + const Environment combinedEnv = getEnvCombined(preset.environment, env); + const Environment parentEnv = env; + preset.environment->forEachEntry([&](const QString &key, QString value, bool enabled) { if (!enabled) return; - QString value = value_; expandAllButEnv(preset, sourceDirectory, value); - value = expandMacroEnv("env", value, [presetEnv](const QString ¯oName) { - return presetEnv.value(macroName); + value = expandMacroEnv("env", value, [&combinedEnv](const QString ¯oName) { + return combinedEnv.value(macroName); }); - enum Operation { set, appendOrSet, prependOrSet }; - Operation op = set; - if (key.compare("PATH", Qt::CaseInsensitive) == 0) { - op = appendOrSet; - const int index = value.indexOf("$penv{PATH}", 0, Qt::CaseInsensitive); - if (index != 0) - op = prependOrSet; - value.replace("$penv{PATH}", "", Qt::CaseInsensitive); - } - - value = expandMacroEnv("penv", value, [env](const QString ¯oName) { - return env.value(macroName); + value = expandMacroEnv("penv", value, [&parentEnv](const QString ¯oName) { + return parentEnv.value(macroName); }); // Make sure to expand the CMake macros also for environment variables expandAllButEnv(preset, sourceDirectory, value); - switch (op) { - case set: - env.set(key, value); - break; - case appendOrSet: - env.appendOrSet(key, value); - break; - case prependOrSet: - env.prependOrSet(key, value); - break; - } + env.set(key, value); }); } template void expand(const PresetType &preset, EnvironmentItems &envItems, const FilePath &sourceDirectory) { - const Environment presetEnv = preset.environment ? *preset.environment : Environment(); - presetEnv.forEachEntry([&](const QString &key, const QString &value_, bool enabled) { - if (!enabled) - return; - QString value = value_; - expandAllButEnv(preset, sourceDirectory, value); - value = expandMacroEnv("env", value, [presetEnv](const QString ¯oName) { - if (presetEnv.hasKey(macroName)) - return presetEnv.value(macroName); - return QString("${%1}").arg(macroName); + if (!preset.environment) + return; + + preset.environment->forEachEntry( + [&preset, + &sourceDirectory, + &envItems](const QString &key, QString value, bool enabled) { + if (!enabled) + return; + expandAllButEnv(preset, sourceDirectory, value); + value = expandMacroEnv("env", value, [&preset](const QString ¯oName) { + if (preset.environment->hasKey(macroName)) + return preset.environment->value(macroName); + return QString("${%1}").arg(macroName); + }); + + value = expandMacroEnv("penv", value, [](const QString ¯oName) { + return QString("${%1}").arg(macroName); + }); + + // Make sure to expand the CMake macros also for environment variables + expandAllButEnv(preset, sourceDirectory, value); + + envItems.emplace_back(Utils::EnvironmentItem(key, value)); }); - - auto operation = EnvironmentItem::Operation::SetEnabled; - if (key.compare("PATH", Qt::CaseInsensitive) == 0) { - operation = EnvironmentItem::Operation::Append; - const int index = value.indexOf("$penv{PATH}", 0, Qt::CaseInsensitive); - if (index != 0) - operation = EnvironmentItem::Operation::Prepend; - value.replace("$penv{PATH}", "", Qt::CaseInsensitive); - } - - value = expandMacroEnv("penv", value, [](const QString ¯oName) { - return QString("${%1}").arg(macroName); - }); - - // Make sure to expand the CMake macros also for environment variables - expandAllButEnv(preset, sourceDirectory, value); - - envItems.emplace_back(Utils::EnvironmentItem(key, value, operation)); - }); } template diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 120684c9fe4..455b4e39862 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -434,11 +434,8 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t return matchOnMultiarch; } - if (debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 32) { - return HostOsInfo::isWindowsHost() && engineType == CdbEngineType - ? DebuggerItem::MatchesPerfectly - : DebuggerItem::MatchesSomewhat; - } + if (debuggerAbi.wordWidth() == 64 && targetAbi.wordWidth() == 32) + return DebuggerItem::MatchesSomewhat; if (debuggerAbi.wordWidth() != 0 && debuggerAbi.wordWidth() != targetAbi.wordWidth()) return matchOnMultiarch; diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index 23dcee4ee6a..b93e0800dec 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -549,7 +549,7 @@ void DebuggerItemModel::autoDetectCdbDebuggers() for (const QFileInfo &kitFolderFi : kitFolders) { const QString path = kitFolderFi.absoluteFilePath(); - QStringList abis = {"x64"}; + QStringList abis = {"x86", "x64"}; if (HostOsInfo::hostArchitecture() == Utils::OsArchArm64) abis << "arm64"; for (const QString &abi: abis) { @@ -783,12 +783,6 @@ void DebuggerItemModel::readDebuggers(const FilePath &fileName, bool isSystem) .arg(item.command().toUserOutput(), item.id().toString(), fileName.toUserOutput()); continue; } - if (item.engineType() == CdbEngineType - && Abi::abisOfBinary(item.command()).value(0).wordWidth() == 32) { - qWarning() << QString("32 bit CDB \"%1\" (%2) read from \"%3\" dropped since it is not supported anymore.") - .arg(item.command().toUserOutput(), item.id().toString(), fileName.toUserOutput()); - continue; - } // FIXME: During startup, devices are not yet available, so we cannot check if the file still exists. if (!item.command().needsDevice() && !item.command().isExecutableFile()) { qWarning() << QString("DebuggerItem \"%1\" (%2) read from \"%3\" dropped since the command is not executable.") diff --git a/src/plugins/debugger/debuggerkitaspect.cpp b/src/plugins/debugger/debuggerkitaspect.cpp index d6a8e83aacd..3ba3b0be065 100644 --- a/src/plugins/debugger/debuggerkitaspect.cpp +++ b/src/plugins/debugger/debuggerkitaspect.cpp @@ -391,10 +391,21 @@ public: void fix(Kit *k) override { const QVariant id = k->value(DebuggerKitAspect::id()); - if (Utils::anyOf(DebuggerItemManager::debuggers(), Utils::equal(&DebuggerItem::id, id))) - return; - k->removeKeySilently(DebuggerKitAspect::id()); - setup(k); + const DebuggerItem debugger = Utils::findOrDefault( + DebuggerItemManager::debuggers(), Utils::equal(&DebuggerItem::id, id)); + if (debugger.isValid() && debugger.engineType() == CdbEngineType) { + const int tcWordWidth = ToolchainKitAspect::targetAbi(k).wordWidth(); + if (Utils::anyOf(debugger.abis(), Utils::equal(&Abi::wordWidth, tcWordWidth))) + return; + + for (const DebuggerItem &item : DebuggerItemManager::debuggers()) { + if (item.engineType() == CdbEngineType + && Utils::anyOf(item.abis(), Utils::equal(&Abi::wordWidth, tcWordWidth))) { + k->setValue(DebuggerKitAspect::id(), item.id()); + return; + } + } + } } KitAspect *createKitAspect(Kit *k) const override diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index c680e313bc3..ee3d3632fe4 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1683,6 +1683,11 @@ void Client::setLogTarget(LogTarget target) } void Client::start() +{ + startImpl(); +} + +void Client::startImpl() { d->m_shutdownTimer.stop(); LanguageClientManager::addClient(this); diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index 13e908b2d50..ec4c7c26854 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -224,6 +224,7 @@ protected: void handleMessage(const LanguageServerProtocol::JsonRpcMessage &message); virtual void handleDiagnostics(const LanguageServerProtocol::PublishDiagnosticsParams ¶ms); virtual DiagnosticManager *createDiagnosticManager(); + virtual void startImpl(); private: friend class ClientPrivate; diff --git a/src/plugins/languageclient/diagnosticmanager.cpp b/src/plugins/languageclient/diagnosticmanager.cpp index 7fc4efb6ddc..db63b5a3f96 100644 --- a/src/plugins/languageclient/diagnosticmanager.cpp +++ b/src/plugins/languageclient/diagnosticmanager.cpp @@ -227,7 +227,7 @@ std::optional DiagnosticManager::createTask( return Task(taskType, taskText(diagnostic), doc->filePath(), - diagnostic.range().start().line(), + diagnostic.range().start().line() + 1, d->m_taskCategory, icon, Task::NoOptions); diff --git a/src/plugins/projectexplorer/environmentwidget.cpp b/src/plugins/projectexplorer/environmentwidget.cpp index 53efaf421d2..2b11622c346 100644 --- a/src/plugins/projectexplorer/environmentwidget.cpp +++ b/src/plugins/projectexplorer/environmentwidget.cpp @@ -270,6 +270,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, Type type, QWidget *additi vbox->addWidget(d->m_detailsContainer); + updateButtons(); connect(d->m_model, &QAbstractItemModel::dataChanged, this, &EnvironmentWidget::updateButtons); diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 47b764d1db1..4c3093e9530 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -282,7 +282,8 @@ ProjectWizardPage::ProjectWizardPage(QWidget *parent) m_addToVersionControlComboBox = new QComboBox; m_addToVersionControlComboBox->setObjectName("addToVersionControlComboBox"); m_vcsManageButton = new QPushButton(ICore::msgShowOptionsDialog()); - m_vcsManageButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred); + m_vcsManageButton + ->setSizePolicy(QSizePolicy::Maximum, m_vcsManageButton->sizePolicy().verticalPolicy()); m_filesLabel = new QLabel; m_filesLabel->setObjectName("filesLabel"); m_filesLabel->setAlignment(Qt::AlignBottom); diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index c118ba1920e..53e80f482b2 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -745,8 +745,10 @@ void QmakeBuildSystem::asyncUpdate() void QmakeBuildSystem::buildFinished(bool success) { - if (success) + if (success) { m_invalidateQmakeVfsContents = true; + updateQmlJSCodeModel(); + } } Tasks QmakeProject::projectIssues(const Kit *k) const diff --git a/src/plugins/qmljseditor/qmllsclient.cpp b/src/plugins/qmljseditor/qmllsclient.cpp index 9fe50a5af7e..ce72cf7977c 100644 --- a/src/plugins/qmljseditor/qmllsclient.cpp +++ b/src/plugins/qmljseditor/qmllsclient.cpp @@ -3,11 +3,14 @@ #include "qmllsclient.h" +#include "qmljseditorconstants.h" #include "qmljseditortr.h" #include #include +#include + #include #include @@ -66,10 +69,13 @@ QmllsClient *QmllsClient::clientForQmlls(const FilePath &qmlls) QmllsClient::QmllsClient(StdIOClientInterface *interface) : Client(interface) { - LanguageServerProtocol::Unregistration unregister; - unregister.setMethod("textDocument/semanticTokens"); - unregister.setId({}); - dynamicCapabilities().unregisterCapability({unregister}); + setSnippetsGroup(QmlJSEditor::Constants::QML_SNIPPETS_GROUP_ID); + + connect( + ProjectExplorer::BuildManager::instance(), + &ProjectExplorer::BuildManager::buildQueueFinished, + this, + [this]() { LanguageClientManager::restartClient(this); }); } QmllsClient::~QmllsClient() @@ -77,4 +83,14 @@ QmllsClient::~QmllsClient() qmllsClients().remove(qmllsClients().key(this)); } +void QmllsClient::startImpl() +{ + LanguageServerProtocol::Unregistration unregister; + unregister.setMethod("textDocument/semanticTokens"); + unregister.setId({}); + dynamicCapabilities().unregisterCapability({unregister}); + + Client::startImpl(); +} + } // namespace QmlJSEditor diff --git a/src/plugins/qmljseditor/qmllsclient.h b/src/plugins/qmljseditor/qmllsclient.h index 30fd0c42fad..feea95a6683 100644 --- a/src/plugins/qmljseditor/qmllsclient.h +++ b/src/plugins/qmljseditor/qmllsclient.h @@ -19,6 +19,7 @@ public: explicit QmllsClient(LanguageClient::StdIOClientInterface *interface); ~QmllsClient(); + void startImpl() override; static QmllsClient *clientForQmlls(const Utils::FilePath &qmlls); }; diff --git a/src/plugins/texteditor/formattexteditor.cpp b/src/plugins/texteditor/formattexteditor.cpp index 9d2ee011751..20a7d9c8bc8 100644 --- a/src/plugins/texteditor/formattexteditor.cpp +++ b/src/plugins/texteditor/formattexteditor.cpp @@ -62,8 +62,9 @@ static FormatOutput format(const FormatInput &input) switch (input.command.processing()) { case Command::FileProcessing: { // Save text to temporary file - Utils::TempFileSaver sourceFile(Utils::TemporaryDirectory::masterDirectoryPath() - + "/qtc_beautifier_XXXXXXXX." + input.filePath.suffix()); + Utils::TempFileSaver sourceFile( + input.filePath.parentDir() + / (input.filePath.fileName() + "_format_XXXXXXXX." + input.filePath.suffix())); sourceFile.setAutoRemove(true); sourceFile.write(input.sourceData.toUtf8()); if (!sourceFile.finalize()) { diff --git a/src/plugins/welcome/introductionwidget.cpp b/src/plugins/welcome/introductionwidget.cpp index 03f1891181c..4da7e937b33 100644 --- a/src/plugins/welcome/introductionwidget.cpp +++ b/src/plugins/welcome/introductionwidget.cpp @@ -173,10 +173,12 @@ bool IntroductionWidget::event(QEvent *e) bool IntroductionWidget::eventFilter(QObject *obj, QEvent *ev) { - if (obj == parent() && ev->type() == QEvent::Resize) + if (obj == parent() && ev->type() == QEvent::Resize) { resizeToParent(); - else if (obj == m_stepText && ev->type() == QEvent::MouseButtonRelease) + } else if (obj == m_stepText && ev->type() == QEvent::MouseButtonRelease) { step(); + return true; + } return QWidget::eventFilter(obj, ev); } diff --git a/src/shared/qbs b/src/shared/qbs index 34e91f7a5d8..64e82d38558 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 34e91f7a5d825c9462d59e2283be628b9d5b5817 +Subproject commit 64e82d38558dccc0ddfb1bdcefe11d13a43fafaf diff --git a/src/tools/wininterrupt/CMakeLists.txt b/src/tools/wininterrupt/CMakeLists.txt index caeb3345c30..39f1b7c5b4d 100644 --- a/src/tools/wininterrupt/CMakeLists.txt +++ b/src/tools/wininterrupt/CMakeLists.txt @@ -13,6 +13,49 @@ if (NOT QT_CREATOR_API_DEFINED) include(QtCreatorIDEBranding) include(QtCreatorAPI) qtc_handle_compiler_cache_support() + + # Compile for x86, x64 and arm64 + if (NOT ${PROJECT_NAME}-MultiBuild AND NOT MINGW) + include(ExternalProject) + + set(generator "Visual Studio 16 2019") + if(CMAKE_CXX_COMPILER MATCHES "Microsoft Visual Studio/2022/") + set(generator "Visual Studio 17 2022") + endif() + + macro (setup_executable arch) + ExternalProject_Add(${arch}-bld + SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" + CMAKE_GENERATOR "${generator}" + CMAKE_GENERATOR_PLATFORM "${arch}" + CMAKE_ARGS + -D${PROJECT_NAME}-MultiBuild=ON + BUILD_COMMAND + ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} + INSTALL_COMMAND + ${CMAKE_COMMAND} --install . --config ${CMAKE_BUILD_TYPE} + --prefix "${CMAKE_BINARY_DIR}" --component wininterrupt + ) + endmacro() + + if (NOT WININTERRUPT_BUILD_ARCHS) + set(WININTERRUPT_BUILD_ARCHS arm64 win32 x64) + endif() + foreach(arch IN LISTS WININTERRUPT_BUILD_ARCHS) + setup_executable(${arch}) + endforeach() + + list(LENGTH WININTERRUPT_BUILD_ARCHS build_archs_length) + if (build_archs_length GREATER 0) + install( + DIRECTORY "${CMAKE_BINARY_DIR}/bin" + DESTINATION . + COMPONENT wininterrupt + ) + endif() + + return() + endif() endif() if (NOT WIN32) diff --git a/tests/system/README b/tests/system/README index 7dff67a84d0..d76526a6f73 100644 --- a/tests/system/README +++ b/tests/system/README @@ -18,7 +18,6 @@ Qt version for the respective toolchain with the components (if available): The exact versions and toolchains are: Linux: -Qt 5.4.1 (gcc) Qt 5.10.1 (gcc) Qt 5.14.1 (gcc) Qt 6.2.4 (gcc) diff --git a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml index f696a5c0195..319f9f0a213 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/profiles.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/profiles.xml @@ -4,30 +4,6 @@ Profile.0 - - false - - - - {70e26273-2c0b-4534-bbc0-eb6ca670821a} - Desktop Device - Desktop - - - ProjectExplorer.ToolChain.Gcc:{c3f59b87-6997-4bd8-8067-ee04dc536371} - - 13 - - :///DESKTOP/// - {8ca91e21-c12e-4876-85b3-4b2141708acb} - - Desktop 5.4.1 GCC - false - - - - - Profile.1 false @@ -51,7 +27,7 @@ - Profile.2 + Profile.1 false @@ -79,7 +55,7 @@ - Profile.3 + Profile.2 false @@ -104,7 +80,7 @@ Profile.Count - 4 + 3 Profile.Default diff --git a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml index 2b20e63a7a7..fd073c77109 100644 --- a/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml +++ b/tests/system/settings/unix/QtProject/qtcreator/qtversion.xml @@ -4,16 +4,6 @@ QtVersion.0 - - 13 - Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) - ~/Qt5.4.1/5.4/SQUISH_DEFAULT_COMPILER/bin/qmake - Qt4ProjectManager.QtVersion.Desktop - false - - - - QtVersion.1 15 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) @@ -23,7 +13,7 @@ - QtVersion.2 + QtVersion.1 17 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) @@ -33,7 +23,7 @@ - QtVersion.3 + QtVersion.2 18 Qt %{Qt:Version} (SQUISH_DEFAULT_COMPILER) diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 3451da354ff..4659dda5535 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -25,7 +25,7 @@ class Targets: @staticmethod def availableTargetClasses(ignoreValidity=False): availableTargets = set(Targets.ALL_TARGETS) - if platform.system() == 'Darwin': + if platform.system() not in ('Windows', 'Microsoft'): availableTargets.remove(Targets.DESKTOP_5_4_1_GCC) return availableTargets @@ -84,7 +84,7 @@ class QtPath: def getPaths(pathSpec): qtTargets = [Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT, Targets.DESKTOP_6_2_4] - if platform.system() != 'Darwin': + if platform.system() in ('Windows', 'Microsoft'): qtTargets.append(Targets.DESKTOP_5_4_1_GCC) if pathSpec == QtPath.DOCS: return map(lambda target: QtPath.docsPath(target), qtTargets) diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index cdf5290d895..b87920b4f76 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -533,7 +533,7 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False, ignoreVali result = result.union(set([Targets.DESKTOP_5_10_1_DEFAULT, Targets.DESKTOP_5_14_1_DEFAULT, Targets.DESKTOP_6_2_4])) - if platform.system() != 'Darwin': + if platform.system() in ('Windows', 'Microsoft'): result.add(Targets.DESKTOP_5_4_1_GCC) elif 'Platform independent' in text: result = Targets.desktopTargetClasses()