diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index d695061f95d..e430f35ebde 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -7,7 +7,8 @@ on: - 'doc/**' env: - QT_VERSION: 6.4.0 + QT_VERSION: 6.4.2 + MACOS_DEPLOYMENT_TARGET: 10.14 CLANG_VERSION: 15.0.0 ELFUTILS_VERSION: 0.175 CMAKE_VERSION: 3.21.1 @@ -489,7 +490,7 @@ jobs: run: | set(ENV{CC} ${{ matrix.config.cc }}) set(ENV{CXX} ${{ matrix.config.cxx }}) - set(ENV{MACOSX_DEPLOYMENT_TARGET} "10.13") + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${{ env.MACOS_DEPLOYMENT_TARGET }}") if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") execute_process( diff --git a/CMakeLists.txt b/CMakeLists.txt index 5067c46ebd7..33563c04ac3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,8 @@ feature_summary(INCLUDE_QUIET_PACKAGES WHAT ENABLED_FEATURES DISABLED_FEATURES ) -if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - # Only for non super repo builds +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR + AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.GPL3-EXCEPT") + # Only for opensource, non-super-repo builds add_subdirectory(packaging) endif() diff --git a/README.md b/README.md index 50dd9152a0b..9930da2356d 100644 --- a/README.md +++ b/README.md @@ -157,15 +157,21 @@ like Qt and LLVM, additionally run cmake --install . --prefix /path/to/qtcreator_install --component Dependencies -### Performance Analyzer +### Perf Profiler Support -If you have not installed Qt with the Maintenance Tool, you must -either set the path to the `perfparser` executable as a value of -the `PERFPROFILER_PARSER_FILEPATH` environment variable or copy -the executable to from the Qt Creator installation directory to -the build directory. That is, copy it from -`/path/to/qtcreator_install/Tools/QtCreator/libexec/qtcreator/` to -/path/to/qtcreator_buid/libexec/qtcreator/`. +Support for the [perf](https://perf.wiki.kernel.org/index.php/Main_Page) profiler +requires the `perfparser` tool that is part of the Qt Creator source package, and also +part of the Qt Creator Git repository in form of a submodule in `src/tools/perfparser`. + +Compilation of `perfparser` requires ELF and DWARF development packages. +You can either download and extract a prebuilt package from +https://download.qt.io/development_releases/prebuilt/elfutils/ and add the +directory to the `CMAKE_PREFIX_PATH` when configuring Qt Creator, +or install the `libdw-dev` package on Debian-style Linux systems. + +You can also point Qt Creator to a separate installation of `perfparser` by +setting the `PERFPROFILER_PARSER_FILEPATH` environment variable to the full +path to the executable. ## Getting LLVM/Clang for the Clang Code Model diff --git a/cmake/Findelfutils.cmake b/cmake/Findelfutils.cmake index ce6ed8d16c9..71463403315 100644 --- a/cmake/Findelfutils.cmake +++ b/cmake/Findelfutils.cmake @@ -60,6 +60,8 @@ if(elfutils_FOUND) endif() endif() endforeach() +else() + message(STATUS " (set ELFUTILS_INSTALL_DIR, or install libdw-dev on a Debian-like system)") endif() mark_as_advanced(ELFUTILS_INCLUDE_DIR ELFUTILS_LIB_elf ELFUTILS_LIB_dw) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index e7f7b39cadc..c8b0ff78d5b 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,6 +1,6 @@ -set(IDE_VERSION "9.0.1") # The IDE version. +set(IDE_VERSION "9.0.2") # The IDE version. set(IDE_VERSION_COMPAT "9.0.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "9.0.1") # The IDE display version. +set(IDE_VERSION_DISPLAY "9.0.2") # The IDE display version. set(IDE_COPYRIGHT_YEAR "2022") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. diff --git a/coin/instructions/common_environment.yaml b/coin/instructions/common_environment.yaml index 5843ca790b0..33557ea11d5 100644 --- a/coin/instructions/common_environment.yaml +++ b/coin/instructions/common_environment.yaml @@ -10,7 +10,7 @@ instructions: variableValue: http://master.qt.io/development_releases/prebuilt/libclang/libclang-release_15.0.0-based - type: EnvironmentVariable variableName: QTC_QT_BASE_URL - variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.0-released/Qt" + variableValue: "http://ci-files02-hki.intra.qt.io/packages/jenkins/archive/qt/6.4/6.4.2-released/Qt" - type: EnvironmentVariable variableName: QTC_QT_MODULES variableValue: "qt5compat qtbase qtdeclarative qtimageformats qtquick3d qtquickcontrols2 qtquicktimeline qtserialport qtshadertools qtsvg qttools qttranslations qtwebengine" diff --git a/doc/qtcreator/config/style/qt5-sidebar.html b/doc/qtcreator/config/style/qt5-sidebar.html index 0069cb97090..e38e76483a8 100644 --- a/doc/qtcreator/config/style/qt5-sidebar.html +++ b/doc/qtcreator/config/style/qt5-sidebar.html @@ -1,17 +1,110 @@ +
+ +
- -

Qt Creator Manual

+

Getting Started

+
+
+
+

Managing Projects

+
+ +
+
+
+

Designing User Interfaces

+
+ +
+
+
+

Coding

+
+ +
+
+
+

Building and Running

+
+ +
+
+
+

Testing

+
+ +
+
+
+

Advanced Use

+
+ +
+
+
+

Getting Help

+
+ +
diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index 83bb4ff131a..c375a31d404 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -151,6 +151,8 @@ \li Opening the CMakeLists.txt file for the current run configuration in the editor (\c {cmo}). This is the same build target as when you select \uicontrol Build > \uicontrol {Build for Run Configuration}. + \li Running a particular run configuration (\c {rr} \e {}) + \li Switching to a particular run configuration (\c {sr} \e {}) \endif \endlist diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index 527bfe5e6dd..f7948de85b1 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -6,10 +6,10 @@ import qbs.Utilities Module { Depends { name: "cpp"; required: false } - property string qtcreator_display_version: '9.0.1' + property string qtcreator_display_version: '9.0.2' property string ide_version_major: '9' property string ide_version_minor: '0' - property string ide_version_release: '1' + property string ide_version_release: '2' property string qtcreator_version: ide_version_major + '.' + ide_version_minor + '.' + ide_version_release diff --git a/qtcreator_ide_branding.pri b/qtcreator_ide_branding.pri index f03edd9f28a..f0f86fcf4fe 100644 --- a/qtcreator_ide_branding.pri +++ b/qtcreator_ide_branding.pri @@ -1,6 +1,6 @@ -QTCREATOR_VERSION = 9.0.1 +QTCREATOR_VERSION = 9.0.2 QTCREATOR_COMPAT_VERSION = 9.0.0 -QTCREATOR_DISPLAY_VERSION = 9.0.1 +QTCREATOR_DISPLAY_VERSION = 9.0.2 QTCREATOR_COPYRIGHT_YEAR = 2022 IDE_DISPLAY_NAME = Qt Creator diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py index 4e142bcd1e0..df06908c9d3 100755 --- a/scripts/build_plugin.py +++ b/scripts/build_plugin.py @@ -39,6 +39,13 @@ def get_arguments(): action='store_true', default=False) parser.add_argument('--build-type', help='Build type to pass to CMake (defaults to RelWithDebInfo)', default='RelWithDebInfo') + # zipping + parser.add_argument('--zip-threads', help='Sets number of threads to use for 7z. Use "+" for turning threads on ' + 'without a specific number of threads. This is directly passed to the "-mmt" option of 7z.', + default='2') + # signing + parser.add_argument('--keychain-unlock-script', + help='Path to script for unlocking the keychain used for signing (macOS)') args = parser.parse_args() args.with_debug_info = args.build_type == 'RelWithDebInfo' return args @@ -144,6 +151,21 @@ def package(args, paths): common.check_print_call(['7z', 'a', '-mmt2', os.path.join(paths.result, args.name + '-debug.7z'), '*'], paths.debug_install) + if common.is_mac_platform() and common.codesign_call(): + if args.keychain_unlock_script: + common.check_print_call([args.keychain_unlock_script], paths.install) + if os.environ.get('SIGNING_IDENTITY'): + signed_install_path = paths.install + '-signed' + common.copytree(paths.install, signed_install_path, symlinks=True) + apps = [d for d in os.listdir(signed_install_path) if d.endswith('.app')] + if apps: + app = apps[0] + common.conditional_sign_recursive(os.path.join(signed_install_path, app), + lambda ff: ff.endswith('.dylib')) + common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads, + os.path.join(paths.result, args.name + '-signed.7z'), + app], + signed_install_path) def get_paths(args): Paths = collections.namedtuple('Paths', diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 50eb3eb1253..05113e43e77 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -110,9 +110,12 @@ def is_ignored_windows_file(use_debug, basepath, filename): return False def ignored_qt_lib_files(path, filenames): + # Qt ships some unneeded object files in the qml plugins + # On Windows we also do not want to ship the wrong debug/release .dlls or .lib files etc if not common.is_windows_platform(): - return [] - return [fn for fn in filenames if is_ignored_windows_file(debug_build, path, fn)] + return [fn for fn in filenames if fn.endswith('.cpp.o')] + return [fn for fn in filenames + if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)] def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_qml_dir, plugins): print("copying Qt libraries...") diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 4109e6f31db..efcde54bdfe 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -143,6 +143,9 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then fi +# clean up unneeded object files that are part of Qt for some static libraries +find "$app_path" -ipath "*/objects-*" -delete + # clean up after macdeployqt # it deploys some plugins (and libs for these) that interfere with what we want echo "Cleaning up after macdeployqt..." diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index 8beba72113a..85deeba1c82 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -239,7 +239,6 @@ class DumperBase(): def setFallbackQtVersion(self, args): version = int(args.get('version', self.fallbackQtVersion)) - DumperBase.warn("got fallback qt version 0x%x" % version) self.fallbackQtVersion = version def resetPerStepCaches(self): diff --git a/share/qtcreator/translations/qtcreator_de.ts b/share/qtcreator/translations/qtcreator_de.ts index eeb1f1091f4..fa440e48882 100644 --- a/share/qtcreator/translations/qtcreator_de.ts +++ b/share/qtcreator/translations/qtcreator_de.ts @@ -48247,7 +48247,7 @@ Useful if build directory is corrupted or when rebuilding with a newer version o Did not find %1 plugin. - Konnte das Plugin %1 nicht finden. + Konnte kein %1 Plugin finden. Install Location diff --git a/src/app/main.cpp b/src/app/main.cpp index bdd80ed34e2..74d1ccec9e6 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -217,16 +217,37 @@ static inline QStringList getPluginPaths() return rc; } -static void setupInstallSettings(QString &installSettingspath) +// Returns plugin path that is set in install settings. +// The installer (or rather the packaging) can write that to load optional plugins from +// outside the application bundle on macOS, because installing optional plugins into +// the application bundle would break code signing. +static QStringList getInstallPluginPaths() +{ + // uses SystemScope because this really must be an "installation" setting + QSettings installSettings(QSettings::IniFormat, + QSettings::SystemScope, + QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), + QLatin1String(Core::Constants::IDE_CASED_ID)); + return Utils::transform(installSettings.value("Settings/InstallPluginPaths").toStringList(), + [](const QString &path) -> QString { + if (QDir::isRelativePath(path)) + return applicationDirPath() + '/' + path; + return path; + }); +} + +static void setupInstallSettings(QString &installSettingspath, bool redirect = true) { if (!installSettingspath.isEmpty() && !QFileInfo(installSettingspath).isDir()) { displayError(QString("-installsettingspath \"%0\" needs to be the path where a %1/%2.ini exist.").arg(installSettingspath, QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR), QLatin1String(Core::Constants::IDE_CASED_ID))); installSettingspath.clear(); } - static const char kInstallSettingsKey[] = "Settings/InstallSettings"; - QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope, - installSettingspath.isEmpty() ? resourcePath() : installSettingspath); + QSettings::setPath(QSettings::IniFormat, + QSettings::SystemScope, + installSettingspath.isEmpty() ? resourcePath() : installSettingspath); + if (!redirect) // ignore redirection via Settings/InstallSettings + return; // Check if the default install settings contain a setting for the actual install settings. // This can be an absolute path, or a path relative to applicationDirPath(). @@ -236,6 +257,7 @@ static void setupInstallSettings(QString &installSettingspath) // yet a second time. So try this a few times. // (Only the first time with QSettings::UserScope, to allow setting the install settings path // in the user settings.) + static const char kInstallSettingsKey[] = "Settings/InstallSettings"; QSettings::Scope scope = QSettings::UserScope; int count = 0; bool containsInstallSettingsKey = false; @@ -542,9 +564,11 @@ int main(int argc, char **argv) // Must be done before any QSettings class is created QSettings::setDefaultFormat(QSettings::IniFormat); - setupInstallSettings(options.installSettingsPath); - // plugin manager takes control of this settings object + // HiDPI variables need to be set before creating QApplication. + // Since we do not have a QApplication yet, we cannot rely on QApplication::applicationDirPath() + // though. So we set up install settings with a educated guess here, and re-setup it later. + setupInstallSettings(options.installSettingsPath); setHighDpiEnvironmentVariable(); SharedTools::QtSingleApplication::setAttribute(Qt::AA_ShareOpenGLContexts); @@ -563,7 +587,11 @@ int main(int argc, char **argv) const QStringList pluginArguments = app.arguments(); - /*Initialize global settings and resetup install settings with QApplication::applicationDirPath */ + // Re-setup install settings with QApplication::applicationDirPath() available, but + // first read install plugin paths from original install settings, without redirection + setupInstallSettings(options.installSettingsPath, /*redirect=*/false); + const QStringList installPluginPaths = getInstallPluginPaths(); + // Re-setup install settings for real setupInstallSettings(options.installSettingsPath); Utils::QtcSettings *settings = createUserSettings(); Utils::QtcSettings *globalSettings @@ -645,7 +673,8 @@ int main(int argc, char **argv) QNetworkProxyFactory::setUseSystemConfiguration(true); // Load - const QStringList pluginPaths = getPluginPaths() + options.customPluginPaths; + const QStringList pluginPaths = getPluginPaths() + installPluginPaths + + options.customPluginPaths; PluginManager::setPluginPaths(pluginPaths); QMap foundAppOptions; if (pluginArguments.size() > 1) { diff --git a/src/libs/advanceddockingsystem/ads_globals.cpp b/src/libs/advanceddockingsystem/ads_globals.cpp index 1dbd1f7c056..252a31f9d30 100644 --- a/src/libs/advanceddockingsystem/ads_globals.cpp +++ b/src/libs/advanceddockingsystem/ads_globals.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "ads_globals.h" diff --git a/src/libs/advanceddockingsystem/ads_globals.h b/src/libs/advanceddockingsystem/ads_globals.h index 07246cfc535..d2f882d8e71 100644 --- a/src/libs/advanceddockingsystem/ads_globals.h +++ b/src/libs/advanceddockingsystem/ads_globals.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockareatabbar.cpp b/src/libs/advanceddockingsystem/dockareatabbar.cpp index 06b067168f6..ec1bf782ff0 100644 --- a/src/libs/advanceddockingsystem/dockareatabbar.cpp +++ b/src/libs/advanceddockingsystem/dockareatabbar.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockareatabbar.h" diff --git a/src/libs/advanceddockingsystem/dockareatabbar.h b/src/libs/advanceddockingsystem/dockareatabbar.h index eb7d1fc1853..956300e07f0 100644 --- a/src/libs/advanceddockingsystem/dockareatabbar.h +++ b/src/libs/advanceddockingsystem/dockareatabbar.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockareatitlebar.cpp b/src/libs/advanceddockingsystem/dockareatitlebar.cpp index e050f7446d5..d76ddaa3e8c 100644 --- a/src/libs/advanceddockingsystem/dockareatitlebar.cpp +++ b/src/libs/advanceddockingsystem/dockareatitlebar.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockareatitlebar.h" diff --git a/src/libs/advanceddockingsystem/dockareatitlebar.h b/src/libs/advanceddockingsystem/dockareatitlebar.h index 61190000f04..888e3736af7 100644 --- a/src/libs/advanceddockingsystem/dockareatitlebar.h +++ b/src/libs/advanceddockingsystem/dockareatitlebar.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockareawidget.cpp b/src/libs/advanceddockingsystem/dockareawidget.cpp index 4c00839c0e0..b4c21f71198 100644 --- a/src/libs/advanceddockingsystem/dockareawidget.cpp +++ b/src/libs/advanceddockingsystem/dockareawidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockareawidget.h" diff --git a/src/libs/advanceddockingsystem/dockareawidget.h b/src/libs/advanceddockingsystem/dockareawidget.h index 02b536a8f6a..a0482136bf5 100644 --- a/src/libs/advanceddockingsystem/dockareawidget.h +++ b/src/libs/advanceddockingsystem/dockareawidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp b/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp index ca2222e1251..76afb45d2c9 100644 --- a/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp +++ b/src/libs/advanceddockingsystem/dockcomponentsfactory.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockcomponentsfactory.h" diff --git a/src/libs/advanceddockingsystem/dockcomponentsfactory.h b/src/libs/advanceddockingsystem/dockcomponentsfactory.h index 2c02d1d1320..ce5c656ac04 100644 --- a/src/libs/advanceddockingsystem/dockcomponentsfactory.h +++ b/src/libs/advanceddockingsystem/dockcomponentsfactory.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockcontainerwidget.cpp b/src/libs/advanceddockingsystem/dockcontainerwidget.cpp index 9bd1b3ef272..80393a46713 100644 --- a/src/libs/advanceddockingsystem/dockcontainerwidget.cpp +++ b/src/libs/advanceddockingsystem/dockcontainerwidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockcontainerwidget.h" diff --git a/src/libs/advanceddockingsystem/dockcontainerwidget.h b/src/libs/advanceddockingsystem/dockcontainerwidget.h index 0738a39f09f..5020b98bf13 100644 --- a/src/libs/advanceddockingsystem/dockcontainerwidget.h +++ b/src/libs/advanceddockingsystem/dockcontainerwidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockfocuscontroller.cpp b/src/libs/advanceddockingsystem/dockfocuscontroller.cpp index 176632beadb..79b6c6cad29 100644 --- a/src/libs/advanceddockingsystem/dockfocuscontroller.cpp +++ b/src/libs/advanceddockingsystem/dockfocuscontroller.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockfocuscontroller.h" diff --git a/src/libs/advanceddockingsystem/dockfocuscontroller.h b/src/libs/advanceddockingsystem/dockfocuscontroller.h index b06b1fec6ec..c108d0d5591 100644 --- a/src/libs/advanceddockingsystem/dockfocuscontroller.h +++ b/src/libs/advanceddockingsystem/dockfocuscontroller.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockingstatereader.cpp b/src/libs/advanceddockingsystem/dockingstatereader.cpp index 3d0628751c8..f5db34c6c0d 100644 --- a/src/libs/advanceddockingsystem/dockingstatereader.cpp +++ b/src/libs/advanceddockingsystem/dockingstatereader.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockingstatereader.h" diff --git a/src/libs/advanceddockingsystem/dockingstatereader.h b/src/libs/advanceddockingsystem/dockingstatereader.h index 5dd892386cd..99198332dc2 100644 --- a/src/libs/advanceddockingsystem/dockingstatereader.h +++ b/src/libs/advanceddockingsystem/dockingstatereader.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index e5daf2c611f..d8622c2aa9f 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockmanager.h" diff --git a/src/libs/advanceddockingsystem/dockmanager.h b/src/libs/advanceddockingsystem/dockmanager.h index ada8960a05f..9dbfc30cda3 100644 --- a/src/libs/advanceddockingsystem/dockmanager.h +++ b/src/libs/advanceddockingsystem/dockmanager.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockoverlay.cpp b/src/libs/advanceddockingsystem/dockoverlay.cpp index 7b680abea90..3a3e9b5b0b0 100644 --- a/src/libs/advanceddockingsystem/dockoverlay.cpp +++ b/src/libs/advanceddockingsystem/dockoverlay.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockoverlay.h" diff --git a/src/libs/advanceddockingsystem/dockoverlay.h b/src/libs/advanceddockingsystem/dockoverlay.h index 2d388fedfcc..abdee68b5d2 100644 --- a/src/libs/advanceddockingsystem/dockoverlay.h +++ b/src/libs/advanceddockingsystem/dockoverlay.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/docksplitter.cpp b/src/libs/advanceddockingsystem/docksplitter.cpp index 1d345e565c8..e8537dbd775 100644 --- a/src/libs/advanceddockingsystem/docksplitter.cpp +++ b/src/libs/advanceddockingsystem/docksplitter.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "docksplitter.h" diff --git a/src/libs/advanceddockingsystem/docksplitter.h b/src/libs/advanceddockingsystem/docksplitter.h index 3d145fa1db3..8dffc234ad4 100644 --- a/src/libs/advanceddockingsystem/docksplitter.h +++ b/src/libs/advanceddockingsystem/docksplitter.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockwidget.cpp b/src/libs/advanceddockingsystem/dockwidget.cpp index 33ffe36b847..b39c58f4c2d 100644 --- a/src/libs/advanceddockingsystem/dockwidget.cpp +++ b/src/libs/advanceddockingsystem/dockwidget.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockwidget.h" diff --git a/src/libs/advanceddockingsystem/dockwidget.h b/src/libs/advanceddockingsystem/dockwidget.h index 9565faef36c..7820b88d17d 100644 --- a/src/libs/advanceddockingsystem/dockwidget.h +++ b/src/libs/advanceddockingsystem/dockwidget.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/dockwidgettab.cpp b/src/libs/advanceddockingsystem/dockwidgettab.cpp index 69bed0c7dc8..a3fd47d3901 100644 --- a/src/libs/advanceddockingsystem/dockwidgettab.cpp +++ b/src/libs/advanceddockingsystem/dockwidgettab.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "dockwidgettab.h" diff --git a/src/libs/advanceddockingsystem/dockwidgettab.h b/src/libs/advanceddockingsystem/dockwidgettab.h index 48103ebc122..49909c6374b 100644 --- a/src/libs/advanceddockingsystem/dockwidgettab.h +++ b/src/libs/advanceddockingsystem/dockwidgettab.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/elidinglabel.cpp b/src/libs/advanceddockingsystem/elidinglabel.cpp index 01cadb4de33..1942b5b1878 100644 --- a/src/libs/advanceddockingsystem/elidinglabel.cpp +++ b/src/libs/advanceddockingsystem/elidinglabel.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "elidinglabel.h" diff --git a/src/libs/advanceddockingsystem/elidinglabel.h b/src/libs/advanceddockingsystem/elidinglabel.h index 4e34c606194..8ee2e9bf8af 100644 --- a/src/libs/advanceddockingsystem/elidinglabel.h +++ b/src/libs/advanceddockingsystem/elidinglabel.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/floatingdockcontainer.cpp b/src/libs/advanceddockingsystem/floatingdockcontainer.cpp index 16909e351cb..4b8ae0913dd 100644 --- a/src/libs/advanceddockingsystem/floatingdockcontainer.cpp +++ b/src/libs/advanceddockingsystem/floatingdockcontainer.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "floatingdockcontainer.h" diff --git a/src/libs/advanceddockingsystem/floatingdockcontainer.h b/src/libs/advanceddockingsystem/floatingdockcontainer.h index c7827349486..e19ce428492 100644 --- a/src/libs/advanceddockingsystem/floatingdockcontainer.h +++ b/src/libs/advanceddockingsystem/floatingdockcontainer.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/floatingdragpreview.cpp b/src/libs/advanceddockingsystem/floatingdragpreview.cpp index 3d4f12ee436..f427ab85edf 100644 --- a/src/libs/advanceddockingsystem/floatingdragpreview.cpp +++ b/src/libs/advanceddockingsystem/floatingdragpreview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "floatingdragpreview.h" diff --git a/src/libs/advanceddockingsystem/floatingdragpreview.h b/src/libs/advanceddockingsystem/floatingdragpreview.h index f7150fdc10f..ed578da993a 100644 --- a/src/libs/advanceddockingsystem/floatingdragpreview.h +++ b/src/libs/advanceddockingsystem/floatingdragpreview.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/iconprovider.cpp b/src/libs/advanceddockingsystem/iconprovider.cpp index 9b8a5ba8138..b1db84c56ff 100644 --- a/src/libs/advanceddockingsystem/iconprovider.cpp +++ b/src/libs/advanceddockingsystem/iconprovider.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "iconprovider.h" diff --git a/src/libs/advanceddockingsystem/iconprovider.h b/src/libs/advanceddockingsystem/iconprovider.h index 8e02348b895..ec72121ae9a 100644 --- a/src/libs/advanceddockingsystem/iconprovider.h +++ b/src/libs/advanceddockingsystem/iconprovider.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 Uwe Kindler -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/workspacedialog.cpp b/src/libs/advanceddockingsystem/workspacedialog.cpp index 481f597e8a3..17fd82e148f 100644 --- a/src/libs/advanceddockingsystem/workspacedialog.cpp +++ b/src/libs/advanceddockingsystem/workspacedialog.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "workspacedialog.h" diff --git a/src/libs/advanceddockingsystem/workspacedialog.h b/src/libs/advanceddockingsystem/workspacedialog.h index 3a6f1f27b1b..a0880429dcb 100644 --- a/src/libs/advanceddockingsystem/workspacedialog.h +++ b/src/libs/advanceddockingsystem/workspacedialog.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/workspacemodel.cpp b/src/libs/advanceddockingsystem/workspacemodel.cpp index af3823f4148..a92b3079e66 100644 --- a/src/libs/advanceddockingsystem/workspacemodel.cpp +++ b/src/libs/advanceddockingsystem/workspacemodel.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "workspacemodel.h" diff --git a/src/libs/advanceddockingsystem/workspacemodel.h b/src/libs/advanceddockingsystem/workspacemodel.h index c7e6cfe1308..38386ad348b 100644 --- a/src/libs/advanceddockingsystem/workspacemodel.h +++ b/src/libs/advanceddockingsystem/workspacemodel.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/advanceddockingsystem/workspaceview.cpp b/src/libs/advanceddockingsystem/workspaceview.cpp index b1c381fc309..de1ff741024 100644 --- a/src/libs/advanceddockingsystem/workspaceview.cpp +++ b/src/libs/advanceddockingsystem/workspaceview.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #include "workspaceview.h" diff --git a/src/libs/advanceddockingsystem/workspaceview.h b/src/libs/advanceddockingsystem/workspaceview.h index 615678512fc..a2bef81e771 100644 --- a/src/libs/advanceddockingsystem/workspaceview.h +++ b/src/libs/advanceddockingsystem/workspaceview.h @@ -1,5 +1,5 @@ // Copyright (C) 2020 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later #pragma once diff --git a/src/libs/glsl/glslparsertable.cpp b/src/libs/glsl/glslparsertable.cpp index dce78522eb4..485b3b20943 100644 --- a/src/libs/glsl/glslparsertable.cpp +++ b/src/libs/glsl/glslparsertable.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later // This file was generated by qlalr - DO NOT EDIT! #include "glslparsertable_p.h" diff --git a/src/libs/glsl/glslparsertable_p.h b/src/libs/glsl/glslparsertable_p.h index a9a3e5408b5..dc409144583 100644 --- a/src/libs/glsl/glslparsertable_p.h +++ b/src/libs/glsl/glslparsertable_p.h @@ -1,5 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-2.1-or-later OR GPL-3.0-or-later // // W A R N I N G diff --git a/src/libs/languageserverprotocol/jsonrpcmessages.h b/src/libs/languageserverprotocol/jsonrpcmessages.h index ebf51b4c14c..c33e46422ca 100644 --- a/src/libs/languageserverprotocol/jsonrpcmessages.h +++ b/src/libs/languageserverprotocol/jsonrpcmessages.h @@ -290,7 +290,10 @@ public: return val.isUndefined() ? std::nullopt : std::make_optional(fromJsonValue(val)); } void setError(const Error &error) - { m_jsonObject.insert(errorKey, QJsonValue(error)); } + { + QTC_CHECK(error.isValid()); + m_jsonObject.insert(errorKey, QJsonValue(error)); + } void clearError() { m_jsonObject.remove(errorKey); } bool isValid(QString *errorMessage) const override diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 918a4e39770..4d03613bed1 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -917,7 +917,7 @@ QVariant AndroidBuildApkStep::data(Utils::Id id) const if (id == Constants::AndroidNdkPlatform) { if (auto qtVersion = QtKitAspect::qtVersion(kit())) return AndroidConfigurations::currentConfig() - .bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion).mid(8); + .bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion); return {}; } if (id == Constants::NdkLocation) { diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index 08ab4f52fc7..dcada43181f 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -15,6 +15,13 @@ namespace Autotest { namespace Internal { +static QString functionWithDataTagAsArg(const QString &func, const QString &dataTag) +{ + if (dataTag.contains(' ')) + return '"' + func + ':' + dataTag + '"'; + return func + ':' + dataTag; +} + QtTestTreeItem::QtTestTreeItem(ITestFramework *testFramework, const QString &name, const Utils::FilePath &filePath, TestTreeItem::Type type) : TestTreeItem(testFramework, name, filePath, type) @@ -85,6 +92,13 @@ Qt::ItemFlags QtTestTreeItem::flags(int column) const Qt::CheckState QtTestTreeItem::checked() const { + switch (type()) { + case TestDataFunction: + case TestSpecialFunction: + return Qt::Unchecked; + default: + break; + } return m_multiTest ? Qt::Unchecked : TestTreeItem::checked(); } @@ -133,9 +147,8 @@ ITestConfiguration *QtTestTreeItem::testConfiguration() const const TestTreeItem *parent = function ? function->parentItem() : nullptr; if (!parent) return nullptr; - const QString functionWithTag = function->name() + ':' + name(); config = new QtTestConfiguration(framework()); - config->setTestCases(QStringList(functionWithTag)); + config->setTestCases(QStringList(functionWithDataTagAsArg(function->name(), name()))); config->setProjectFile(parent->proFile()); config->setProject(project); break; @@ -178,7 +191,7 @@ static void fillTestConfigurationsFromCheckState(const TestTreeItem *item, const QString funcName = grandChild->name(); grandChild->forFirstLevelChildren([&testCases, &funcName](ITestTreeItem *dataTag) { if (dataTag->checked() == Qt::Checked) - testCases << funcName + ':' + dataTag->name(); + testCases << functionWithDataTagAsArg(funcName, dataTag->name()); }); } }); @@ -210,7 +223,7 @@ static void collectFailedTestInfo(TestTreeItem *item, QListforFirstLevelChildren([&testCases, func](ITestTreeItem *dataTag) { if (dataTag->data(0, FailedRole).toBool()) - testCases << func->name() + ':' + dataTag->name(); + testCases << functionWithDataTagAsArg(func->name(), dataTag->name()); }); } }); diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index 6072082c8c7..47791c27de7 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -464,10 +464,9 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe bool secondTry) const { QTC_ASSERT(replacementsToKeep != ReplacementsToKeep::All, return Utils::Text::Replacements()); + QTC_ASSERT(!m_fileName.isEmpty(), return {}); - clang::format::FormatStyle style = styleForFile(); QByteArray originalBuffer = buffer; - int utf8Offset = Utils::Text::utf8NthLineOffset(m_doc, buffer, startBlock.blockNumber() + 1); QTC_ASSERT(utf8Offset >= 0, return Utils::Text::Replacements();); int utf8Length = selectedLines(m_doc, startBlock, endBlock).toUtf8().size(); @@ -476,6 +475,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe if (replacementsToKeep == ReplacementsToKeep::IndentAndBefore) rangeStart = formattingRangeStart(startBlock, buffer, lastSaveRevision()); + clang::format::FormatStyle style = styleForFile(); adjustFormatStyleForLineBreak(style, replacementsToKeep); if (replacementsToKeep == ReplacementsToKeep::OnlyIndent) { CharacterContext currentCharContext = CharacterContext::Unknown; @@ -527,6 +527,7 @@ Utils::Text::Replacements ClangFormatBaseIndenter::replacements(QByteArray buffe Utils::Text::Replacements ClangFormatBaseIndenter::format( const TextEditor::RangesInLines &rangesInLines) { + QTC_ASSERT(!m_fileName.isEmpty(), return {}); if (rangesInLines.empty()) return Utils::Text::Replacements(); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 4b6ab55d4df..1823462382c 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -1477,7 +1477,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) if (DeviceTypeKitAspect::deviceTypeId(k) == Android::Constants::ANDROID_DEVICE_TYPE) { buildSteps()->appendStep(Android::Constants::ANDROID_BUILD_APK_ID); const auto &bs = buildSteps()->steps().constLast(); - cmd.addArg("-DANDROID_NATIVE_API_LEVEL:STRING=" + cmd.addArg("-DANDROID_PLATFORM:STRING=" + bs->data(Android::Constants::AndroidNdkPlatform).toString()); auto ndkLocation = bs->data(Android::Constants::NdkLocation).value(); cmd.addArg("-DANDROID_NDK:PATH=" + ndkLocation.path()); diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index c450bc814bd..28ce7e7ccbe 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -875,6 +876,7 @@ const char CMAKE_CXX_TOOLCHAIN_KEY[] = "CMAKE_CXX_COMPILER"; const char CMAKE_QMAKE_KEY[] = "QT_QMAKE_EXECUTABLE"; const char CMAKE_PREFIX_PATH_KEY[] = "CMAKE_PREFIX_PATH"; const char QTC_CMAKE_PRESET_KEY[] = "QTC_CMAKE_PRESET"; +const char QTC_KIT_DEFAULT_CONFIG_HASH[] = "QTC_KIT_DEFAULT_CONFIG_HASH"; class CMakeConfigurationKitAspectWidget final : public KitAspectWidget { @@ -1135,6 +1137,43 @@ CMakeConfigItem CMakeConfigurationKitAspect::cmakePresetConfigItem(const Project }); } +void CMakeConfigurationKitAspect::setKitDefaultConfigHash(ProjectExplorer::Kit *k) +{ + const CMakeConfig defaultConfigExpanded + = Utils::transform(defaultConfiguration(k).toList(), [k](const CMakeConfigItem &item) { + CMakeConfigItem expanded(item); + expanded.value = item.expandedValue(k).toUtf8(); + return expanded; + }); + const QByteArray kitHash = computeDefaultConfigHash(defaultConfigExpanded); + + CMakeConfig config = configuration(k); + config.append(CMakeConfigItem(QTC_KIT_DEFAULT_CONFIG_HASH, CMakeConfigItem::INTERNAL, kitHash)); + + setConfiguration(k, config); +} + +CMakeConfigItem CMakeConfigurationKitAspect::kitDefaultConfigHashItem(const ProjectExplorer::Kit *k) +{ + const CMakeConfig config = configuration(k); + return Utils::findOrDefault(config, [](const CMakeConfigItem &item) { + return item.key == QTC_KIT_DEFAULT_CONFIG_HASH; + }); +} + +QByteArray CMakeConfigurationKitAspect::computeDefaultConfigHash(const CMakeConfig &config) +{ + const CMakeConfig defaultConfig = defaultConfiguration(nullptr); + const QByteArray configValues = std::accumulate(defaultConfig.begin(), + defaultConfig.end(), + QByteArray(), + [config](QByteArray &sum, + const CMakeConfigItem &item) { + return sum += config.valueOf(item.key); + }); + return QCryptographicHash::hash(configValues, QCryptographicHash::Md5).toHex(); +} + QVariant CMakeConfigurationKitAspect::defaultValue(const Kit *k) const { // FIXME: Convert preload scripts diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.h b/src/plugins/cmakeprojectmanager/cmakekitinformation.h index da2435664b3..25b7b7f3f7d 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.h +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.h @@ -91,6 +91,10 @@ public: static void setCMakePreset(ProjectExplorer::Kit *k, const QString &presetName); static CMakeConfigItem cmakePresetConfigItem(const ProjectExplorer::Kit *k); + static void setKitDefaultConfigHash(ProjectExplorer::Kit *k); + static CMakeConfigItem kitDefaultConfigHashItem(const ProjectExplorer::Kit *k); + static QByteArray computeDefaultConfigHash(const CMakeConfig &config); + // KitAspect interface ProjectExplorer::Tasks validate(const ProjectExplorer::Kit *k) const final; void setup(ProjectExplorer::Kit *k) final; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index f8f536e22db..b2e0e6f12df 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -46,6 +46,7 @@ struct DirectoryData QString cmakePresetDisplayname; QString cmakePreset; + QByteArray cmakePresetDefaultConfigHash; // Kit Stuff FilePath cmakeBinary; @@ -441,6 +442,28 @@ static QString extractVisualStudioPlatformFromConfig(const CMakeConfig &config) return platform; } +void updateCompilerPaths(CMakeConfig &config, const Environment &env) +{ + auto updateRelativePath = [&config, env](const QByteArray &key) { + FilePath pathValue = config.filePathValueOf(key); + + if (pathValue.isAbsolutePath() || pathValue.isEmpty()) + return; + + pathValue = env.searchInPath(pathValue.fileName()); + + auto it = std::find_if(config.begin(), config.end(), [&key](const CMakeConfigItem &item) { + return item.key == key; + }); + QTC_ASSERT(it != config.end(), return); + + it->value = pathValue.path().toUtf8(); + }; + + updateRelativePath("CMAKE_C_COMPILER"); + updateRelativePath("CMAKE_CXX_COMPILER"); +} + QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, QString *warningMessage) const { @@ -518,6 +541,7 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, } } else { config = cache; + updateCompilerPaths(config, env); config << CMakeConfigItem("CMAKE_COMMAND", CMakeConfigItem::PATH, configurePreset.cmakeExecutable.value().toUtf8()); @@ -526,6 +550,8 @@ QList CMakeProjectImporter::examineDirectory(const FilePath &importPath, CMakeConfigItem::STRING, configurePreset.generator.value().toUtf8()); } + data->cmakePresetDefaultConfigHash = CMakeConfigurationKitAspect::computeDefaultConfigHash( + config); const FilePath qmake = qmakeFromCMakeCache(config); if (!qmake.isEmpty()) @@ -662,8 +688,16 @@ bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const bool haveCMakePreset = false; if (!data->cmakePreset.isEmpty()) { - auto presetConfigItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k); - if (data->cmakePreset != presetConfigItem.expandedValue(k)) + const auto presetConfigItem = CMakeConfigurationKitAspect::cmakePresetConfigItem(k); + const auto kitConfigHashItem = CMakeConfigurationKitAspect::kitDefaultConfigHashItem(k); + + const QString presetName = presetConfigItem.expandedValue(k); + const bool haveSameKitConfigHash = kitConfigHashItem.isNull() + ? true + : data->cmakePresetDefaultConfigHash + == kitConfigHashItem.value; + + if (data->cmakePreset != presetName || !haveSameKitConfigHash) return false; ensureBuildDirectory(*data, k); @@ -701,15 +735,6 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const CMakeGeneratorKitAspect::setPlatform(k, data->platform); CMakeGeneratorKitAspect::setToolset(k, data->toolset); - if (!data->cmakePresetDisplayname.isEmpty()) { - k->setUnexpandedDisplayName( - QString("%1 (CMake preset)").arg(data->cmakePresetDisplayname)); - - CMakeConfigurationKitAspect::setCMakePreset(k, data->cmakePreset); - } - if (!data->cmakePreset.isEmpty()) - ensureBuildDirectory(*data, k); - SysRootKitAspect::setSysRoot(k, data->sysroot); for (const ToolChainDescription &cmtcd : data->toolChains) { @@ -724,6 +749,16 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const ToolChainKitAspect::setToolChain(k, tcd.tcs.at(0)); } + if (!data->cmakePresetDisplayname.isEmpty()) { + k->setUnexpandedDisplayName( + QString("%1 (CMake preset)").arg(data->cmakePresetDisplayname)); + + CMakeConfigurationKitAspect::setCMakePreset(k, data->cmakePreset); + CMakeConfigurationKitAspect::setKitDefaultConfigHash(k); + } + if (!data->cmakePreset.isEmpty()) + ensureBuildDirectory(*data, k); + qCInfo(cmInputLog) << "Temporary Kit created."; }); } diff --git a/src/plugins/coreplugin/find/findtoolbar.cpp b/src/plugins/coreplugin/find/findtoolbar.cpp index ab207391bdb..6db9774afee 100644 --- a/src/plugins/coreplugin/find/findtoolbar.cpp +++ b/src/plugins/coreplugin/find/findtoolbar.cpp @@ -78,6 +78,7 @@ FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind) m_horizontalSpacer = new QSpacerItem(40, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); m_close = new QToolButton; + m_close->setObjectName("closeFindToolBarButton"); auto findButtonsWidget = new QWidget; diff --git a/src/plugins/coreplugin/generalsettings.cpp b/src/plugins/coreplugin/generalsettings.cpp index 5739933b003..0cd80ea6c62 100644 --- a/src/plugins/coreplugin/generalsettings.cpp +++ b/src/plugins/coreplugin/generalsettings.cpp @@ -163,10 +163,10 @@ void GeneralSettingsWidget::fillLanguageBox() const QStringList(QLatin1String("qtcreator*.qm"))); for (const FilePath &languageFile : languageFiles) { - const QString path = languageFile.path(); - int start = path.indexOf('_') + 1; - int end = path.lastIndexOf('.'); - const QString locale = path.mid(start, end-start); + const QString name = languageFile.fileName(); + int start = name.indexOf('_') + 1; + int end = name.lastIndexOf('.'); + const QString locale = name.mid(start, end - start); // no need to show a language that creator will not load anyway if (hasQmFilesForLocale(locale, creatorTrPath.toString())) { QLocale tmpLocale(locale); diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.cpp b/src/plugins/cppeditor/cppcodestylesettingspage.cpp index 67a785809d5..3fc0a3ba875 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.cpp +++ b/src/plugins/cppeditor/cppcodestylesettingspage.cpp @@ -165,6 +165,9 @@ void CppCodeStylePreferencesWidget::setCodeStyle(CppCodeStylePreferences *codeSt setCodeStyleSettings(m_preferences->currentCodeStyleSettings(), false); slotCurrentPreferencesChanged(m_preferences->currentPreferences(), false); + m_originalCppCodeStyleSettings = cppCodeStyleSettings(); + m_originalTabSettings = tabSettings(); + updatePreview(); } @@ -253,6 +256,12 @@ void CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged() if (m_blockUpdates) return; + if (m_preferences) { + auto current = qobject_cast(m_preferences->currentPreferences()); + if (current) + current->setCodeStyleSettings(cppCodeStyleSettings()); + } + emit codeStyleSettingsChanged(cppCodeStyleSettings()); updatePreview(); } @@ -262,6 +271,12 @@ void CppCodeStylePreferencesWidget::slotTabSettingsChanged(const TabSettings &se if (m_blockUpdates) return; + if (m_preferences) { + auto current = qobject_cast(m_preferences->currentPreferences()); + if (current) + current->setTabSettings(settings); + } + emit tabSettingsChanged(settings); updatePreview(); } @@ -344,19 +359,21 @@ void CppCodeStylePreferencesWidget::addTab(CppCodeStyleWidget *page, QString tab void CppCodeStylePreferencesWidget::apply() { - if (m_preferences) { - auto current = qobject_cast(m_preferences->currentPreferences()); - if (current) { - current->setTabSettings(tabSettings()); - current->setCodeStyleSettings(cppCodeStyleSettings()); - } - } + m_originalTabSettings = tabSettings(); + m_originalCppCodeStyleSettings = cppCodeStyleSettings(); emit applyEmitted(); } void CppCodeStylePreferencesWidget::finish() { + if (m_preferences) { + auto current = qobject_cast(m_preferences->currentDelegate()); + if (current) { + current->setCodeStyleSettings(m_originalCppCodeStyleSettings); + current->setTabSettings(m_originalTabSettings); + } + } emit finishEmitted(); } diff --git a/src/plugins/cppeditor/cppcodestylesettingspage.h b/src/plugins/cppeditor/cppcodestylesettingspage.h index 844cfc0337e..01a7860a190 100644 --- a/src/plugins/cppeditor/cppcodestylesettingspage.h +++ b/src/plugins/cppeditor/cppcodestylesettingspage.h @@ -8,13 +8,13 @@ #include #include +#include #include #include namespace TextEditor { class FontSettings; - class TabSettings; class SnippetEditorWidget; class CodeStyleEditor; class CodeStyleEditorWidget; @@ -72,6 +72,8 @@ private: CppCodeStylePreferences *m_preferences = nullptr; Ui::CppCodeStyleSettingsPage *m_ui; QList m_previews; + CppCodeStyleSettings m_originalCppCodeStyleSettings; + TextEditor::TabSettings m_originalTabSettings; bool m_blockUpdates = false; signals: void codeStyleSettingsChanged(const CppEditor::CppCodeStyleSettings &); diff --git a/src/plugins/debugger/debuggeractions.cpp b/src/plugins/debugger/debuggeractions.cpp index 0dec35b3fd4..eb1ebb2ee3c 100644 --- a/src/plugins/debugger/debuggeractions.cpp +++ b/src/plugins/debugger/debuggeractions.cpp @@ -159,7 +159,7 @@ DebuggerSettings::DebuggerSettings() cdbBreakPointCorrection.setSettingsKey(cdbSettingsGroup, "BreakpointCorrection"); cdbBreakPointCorrection.setDefaultValue(true); cdbBreakPointCorrection.setToolTip("

" + Tr::tr( - "Attempts to correct the location of a breakpoint based on file and line number should" + "Attempts to correct the location of a breakpoint based on file and line number should " "it be in a comment or in a line for which no code is generated. " "The correction is based on the code model.") + "

"); cdbBreakPointCorrection.setLabelText(Tr::tr("Correct breakpoint location")); diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 5c99329675a..aca6ab50098 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -1891,6 +1891,7 @@ void ClientPrivate::handleMethod(const QString &method, const MessageId &id, con Response response(id); ResponseError error; error.setCode(ResponseError::MethodNotFound); + error.setMessage(QString("The client cannot handle the method '%1'.").arg(method)); response.setError(error); sendResponse(response); } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 468c408adf5..cd3d4afb561 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -621,15 +621,22 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags, Macros predefinedMacros; QStringList toProcess; - for (const QString &arg : cxxflags) { - if (arg.startsWith("/D") || arg.startsWith("-D")) { - const QString define = arg.mid(2); - predefinedMacros.append(Macro::fromKeyValue(define)); - } else if (arg.startsWith("/U") || arg.startsWith("-U")) { - predefinedMacros.append( - {arg.mid(2).toLocal8Bit(), ProjectExplorer::MacroType::Undefine}); + for (auto arg = cxxflags.begin(); arg != cxxflags.end(); ++arg) { + if (arg->startsWith("/D") || arg->startsWith("-D")) { + if (arg->length() > 2) + predefinedMacros.append(Macro::fromKeyValue(arg->mid(2))); + else if (std::next(arg) != cxxflags.end()) + predefinedMacros.append(Macro::fromKeyValue(*++arg)); + } else if (arg->startsWith("/U") || arg->startsWith("-U")) { + if (arg->length() > 2) { + predefinedMacros.append({arg->mid(2).toLocal8Bit(), + MacroType::Undefine}); + } else if (std::next(arg) != cxxflags.end()) { + predefinedMacros.append({(++arg)->toLocal8Bit(), + MacroType::Undefine}); + } } else { - toProcess.append(arg); + toProcess.append(*arg); } } diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 3c4c0e39164..5f79be7ce14 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -551,6 +551,11 @@ QWidget *QMakeStep::createConfigWidget() BuildManager::buildLists({bc->cleanSteps()}); }); + connect(widget, &QObject::destroyed, this, [this] { + abisLabel = nullptr; + abisListWidget = nullptr; + }); + VariableChooser::addSupportForChildWidgets(widget, macroExpander()); return widget; diff --git a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp index 6953e992b9e..c94fbebe433 100644 --- a/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp +++ b/src/plugins/qmljseditor/qmljscomponentnamedialog.cpp @@ -24,6 +24,7 @@ ComponentNameDialog::ComponentNameDialog(QWidget *parent) : { setWindowTitle(Tr::tr("Move Component into Separate File")); m_componentNameEdit = new Utils::ClassNameValidatingLineEdit; + m_componentNameEdit->setObjectName("componentNameEdit"); m_componentNameEdit->setPlaceholderText(Tr::tr("Component Name")); m_messageLabel = new QLabel; m_pathEdit = new Utils::PathChooser; diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index f1cbc250b3b..b1f3c129712 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -930,29 +930,32 @@ static QStringList qtversionFilesToCheck() return Utils::transform(kSubdirsToCheck, [](const QString &dir) { return qtVersionsFile(dir); }); } -static std::optional settingsDirForQtDir(const QString &qtDir) +static std::optional settingsDirForQtDir(const FilePath &baseDirectory, + const FilePath &qtDir) { - const QStringList dirsToCheck = Utils::transform(kSubdirsToCheck, [qtDir](const QString &dir) { - return QString(qtDir + '/' + dir); + const FilePaths dirsToCheck = Utils::transform(kSubdirsToCheck, [qtDir](const QString &dir) { + return qtDir / dir; }); - const QString validDir = Utils::findOrDefault(dirsToCheck, [](const QString &dir) { - return QFile::exists(settingsFile(dir)) || QFile::exists(qtVersionsFile(dir)); + const FilePath validDir = Utils::findOrDefault(dirsToCheck, [baseDirectory](const FilePath &dir) { + return QFile::exists(settingsFile(baseDirectory.resolvePath(dir).toString())) + || QFile::exists(qtVersionsFile(baseDirectory.resolvePath(dir).toString())); }); if (!validDir.isEmpty()) return validDir; return {}; } -static bool validateQtInstallDir(FancyLineEdit *input, QString *errorString) +static bool validateQtInstallDir(PathChooser *input, QString *errorString) { - const QString qtDir = input->text(); - if (!settingsDirForQtDir(qtDir)) { + const FilePath qtDir = input->rawFilePath(); + if (!settingsDirForQtDir(input->baseDirectory(), qtDir)) { if (errorString) { const QStringList filesToCheck = settingsFilesToCheck() + qtversionFilesToCheck(); - *errorString = "" + Tr::tr( - "Qt installation information was not found in \"%1\". " - "Choose a directory that contains one of the files %2") - .arg(qtDir, "
" + filesToCheck.join('\n') + "
"); + *errorString = "" + + Tr::tr("Qt installation information was not found in \"%1\". " + "Choose a directory that contains one of the files %2") + .arg(qtDir.toUserOutput(), + "
" + filesToCheck.join('\n') + "
"); } return false; } @@ -988,13 +991,14 @@ void QtOptionsPageWidget::linkWithQt() auto pathInput = new PathChooser; pathLayout->addWidget(pathInput); pathInput->setExpectedKind(PathChooser::ExistingDirectory); + pathInput->setBaseDirectory(FilePath::fromString(QCoreApplication::applicationDirPath())); pathInput->setPromptDialogTitle(title); pathInput->setMacroExpander(nullptr); pathInput->setValidationFunction([pathInput](FancyLineEdit *input, QString *errorString) { if (pathInput->defaultValidationFunction() && !pathInput->defaultValidationFunction()(input, errorString)) return false; - return validateQtInstallDir(input, errorString); + return validateQtInstallDir(pathInput, errorString); }); const std::optional currentLink = currentlyLinkedQtDir(nullptr); pathInput->setFilePath(currentLink ? *currentLink : defaultQtInstallationPath()); @@ -1027,10 +1031,12 @@ void QtOptionsPageWidget::linkWithQt() dialog.exec(); if (dialog.result() == QDialog::Accepted) { - const std::optional settingsDir = settingsDirForQtDir(pathInput->rawFilePath().toString()); + const std::optional settingsDir = settingsDirForQtDir(pathInput->baseDirectory(), + pathInput->rawFilePath()); if (QTC_GUARD(settingsDir)) { - QSettings(settingsFile(Core::ICore::resourcePath().toString()), QSettings::IniFormat) - .setValue(kInstallSettingsKey, *settingsDir); + QSettings settings(settingsFile(Core::ICore::resourcePath().toString()), + QSettings::IniFormat); + settings.setValue(kInstallSettingsKey, settingsDir->toVariant()); askForRestart = true; } } diff --git a/src/plugins/texteditor/snippets/snippetoverlay.cpp b/src/plugins/texteditor/snippets/snippetoverlay.cpp index 6824c0470ac..f7b3cf80c91 100644 --- a/src/plugins/texteditor/snippets/snippetoverlay.cpp +++ b/src/plugins/texteditor/snippets/snippetoverlay.cpp @@ -38,8 +38,13 @@ void SnippetOverlay::setFinalSelection(const QTextCursor &cursor, const QColor & void SnippetOverlay::updateEquivalentSelections(const QTextCursor &cursor) { const int ¤tIndex = indexForCursor(cursor); + if (currentIndex == m_finalSelectionIndex) { + accept(); + return; + } if (currentIndex < 0) return; + QTC_ASSERT(currentIndex < m_selections.size(), return); const QString ¤tText = cursorForIndex(currentIndex).selectedText(); const QList &equivalents = m_variables.value(m_selections[currentIndex].variableIndex); for (int i : equivalents) { diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index d8077ad5f7e..1a37bf05280 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -4476,7 +4476,7 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data, const QTextLine textLine = blockData.layout->lineAt(0); const QRectF rect = textLine.naturalTextRect(); - qreal x = textLine.cursorToX(0) + data.offset.x() + qMax(0, q->cursorWidth() - 1) + qreal x = textLine.x() + data.offset.x() + qMax(0, q->cursorWidth() - 1) + horizontalAdvance * m_visualIndentOffset; int paintColumn = 0; @@ -4484,8 +4484,10 @@ void TextEditorWidgetPrivate::paintIndentDepth(PaintEventData &data, while (paintColumn < depth) { if (x >= 0) { int paintPosition = tabSettings.positionAtColumn(text, paintColumn); - if (blockData.layout->lineForTextPosition(paintPosition).lineNumber() != 0) + if (q->lineWrapMode() == QPlainTextEdit::WidgetWidth + && blockData.layout->lineForTextPosition(paintPosition).lineNumber() != 0) { break; + } const QPointF top(x, blockData.boundingRect.top()); const QPointF bottom(x, blockData.boundingRect.top() + rect.height()); const QLineF line(top, bottom); diff --git a/tests/system/objects.map b/tests/system/objects.map index 074275eba8c..09ef2505423 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -2,7 +2,7 @@ :*Qt Creator.Cancel Build_QToolButton {text='Cancel Build' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Continue_Core::Internal::FancyToolButton {name='Debug.Button' toolTip?='Continue *' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:*Qt Creator.Find_Find::Internal::FindToolBar {name='Core__Internal__FindWidget' type='Core::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'} +:*Qt Creator.Find_Find::Internal::FindToolBar {type='Core::Internal::FindToolBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'} :*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack {name='FormEditorStack' type='Designer::Internal::FormEditorStack' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Interrupt_Core::Internal::FancyToolButton {name='Debug.Button' toolTip='Interrupt' type='Core::Internal::FancyToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.ProjectSelectorDockWidget_QDockWidget {name='ProjectSelectorDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -61,7 +61,7 @@ :Dialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'} :Dialog.componentNameEdit_QLineEdit {name='componentNameEdit' type='Utils::ClassNameValidatingLineEdit' visible='1' window=':Dialog_QmlJSEditor::Internal::ComponentNameDialog'} :Dialog_Debugger::Internal::SymbolPathsDialog {name='Debugger__Internal__SymbolPathsDialog' type='Debugger::Internal::SymbolPathsDialog' visible='1' windowTitle='Dialog'} -:Dialog_QmlJSEditor::Internal::ComponentNameDialog {name='QmlJSEditor__Internal__ComponentNameDialog' type='QmlJSEditor::Internal::ComponentNameDialog' visible='1' windowTitle='Move Component into Separate File'} +:Dialog_QmlJSEditor::Internal::ComponentNameDialog {type='QmlJSEditor::Internal::ComponentNameDialog' unnamed='1' visible='1' windowTitle='Move Component into Separate File'} :Events.QmlProfilerEventsTable_QmlProfiler::Internal::QmlProfilerStatisticsMainView {container=':Qt Creator.Events_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QmlProfilerStatisticsMainView' visible='1'} :Failed to start application_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Failed to start application'} :File has been removed.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'} @@ -118,7 +118,7 @@ :QML Debugging_QMessageBox {text='The option will only take effect if the project is recompiled. Do you want to recompile now?' type='QMessageBox' unnamed='1' visible='1'} :Qt Creator.Add Bookmark_QToolButton {text='Add Bookmark' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.CloseDoc_QToolButton {toolTip?='Close Document *' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.CloseFind_QToolButton {name='close' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.CloseFind_QToolButton {name='closeFindToolBarButton' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'} :Qt Creator.Configure Project_QPushButton {text='Configure Project' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.DebugModeWidget_QSplitter {name='DebugModeWidget' type='QSplitter' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} @@ -132,8 +132,8 @@ :Qt Creator.QML debugging and profiling:_QLabel {text='QML debugging and profiling:' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration.' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.Replace_QToolButton {name='replaceButton' text='Replace' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.Replace All_QToolButton {text='Replace All' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} +:Qt Creator.Replace_QToolButton {text='Replace' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Timeline_QDockWidget {container=':Qt Creator.DebugModeWidget_QSplitter' name='QmlProfiler.Timeline.DockDockWidget' type='QDockWidget' visible='1'} :Qt Creator.Timeline_QTabBar {aboveWidget=':Qt Creator.Timeline_QDockWidget' container=':Qt Creator.DebugModeWidget_QSplitter' type='QTabBar' unnamed='1' visible='1'} diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 5d422f8ef08..05afc9c493f 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -209,8 +209,7 @@ def runVerify(): availableConfigs = iterateBuildConfigs() if not availableConfigs: test.fatal("Haven't found build configurations, quitting") - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() for kit, config in availableConfigs: selectBuildConfig(kit, config) test.log("Using build config '%s'" % config) diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 4aa008515eb..57a60fd6a97 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -336,9 +336,16 @@ def validateSearchResult(expectedCount): # this function invokes context menu and command from it def invokeContextMenuItem(editorArea, command1, command2 = None): - ctxtMenu = openContextMenuOnTextCursorPosition(editorArea) - snooze(1) - item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000) + for _ in range(2): + ctxtMenu = openContextMenuOnTextCursorPosition(editorArea) + snooze(1) + try: + item1 = waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000) + break + except: + test.warning("Context menu item not ready (%s) - trying once more." % command1) + type(editorArea, "") + if command2 and platform.system() == 'Darwin': mouseMove(item1) activateItem(item1) @@ -393,8 +400,7 @@ def openDocument(treeElement): def earlyExit(details="No additional information"): test.fail("Something went wrong running this test", details) - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() def openDocumentPlaceCursor(doc, line, additionalFunction=None): cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget" diff --git a/tests/system/suite_QMLS/tst_QMLS02/test.py b/tests/system/suite_QMLS/tst_QMLS02/test.py index cc931ae3239..c4bfdfd9efe 100644 --- a/tests/system/suite_QMLS/tst_QMLS02/test.py +++ b/tests/system/suite_QMLS/tst_QMLS02/test.py @@ -42,7 +42,5 @@ def main(): # wait for issues test.verify(waitFor("issuesModel.rowCount() == 0", 3000), "Verifying if error was properly cleared after code fix") - #save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index 63db543bcba..2c42c178cc0 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -46,16 +46,13 @@ def main(): waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000) except: test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer") - #save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() return test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") # open MyComponent.qml file for verification if not openDocument(myCompTE): test.fatal("Could not open MyComponent.qml.") - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() return editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") codeText = str(editorArea.plainText) diff --git a/tests/system/suite_QMLS/tst_QMLS08/test.py b/tests/system/suite_QMLS/tst_QMLS08/test.py index 21def06251d..7b7cca9979b 100644 --- a/tests/system/suite_QMLS/tst_QMLS08/test.py +++ b/tests/system/suite_QMLS/tst_QMLS08/test.py @@ -19,8 +19,7 @@ def verifyNextLineIndented(editorArea, expectedIndentation): def verifyIndentation(editorArea): #verify indentation if not placeCursorToLine(editorArea, "id: wdw"): - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() return False type(editorArea, "") expectedIndentations = [1,1,1,2,2,2,2,3,3,3,4,3,3,2,1] @@ -58,6 +57,4 @@ def main(): # verify invoked indentation if not verifyIndentation(editorArea): return - # save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() diff --git a/tests/system/suite_editors/tst_generic_highlighter/test.py b/tests/system/suite_editors/tst_generic_highlighter/test.py index f1f154376ec..490c6021681 100644 --- a/tests/system/suite_editors/tst_generic_highlighter/test.py +++ b/tests/system/suite_editors/tst_generic_highlighter/test.py @@ -196,9 +196,8 @@ def main(): if current.endswith(".lhs"): type(editor, ">") type(editor, "") + saveAndExit() - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") def init(): syntaxDirectory = __highlighterDefinitionsDirectory__() diff --git a/tests/system/suite_editors/tst_rename_macros/test.py b/tests/system/suite_editors/tst_rename_macros/test.py index cfa29e49863..6d329e44667 100644 --- a/tests/system/suite_editors/tst_rename_macros/test.py +++ b/tests/system/suite_editors/tst_rename_macros/test.py @@ -24,9 +24,7 @@ def main(): expectedHeaderName=headerName) if not testRenameMacroAfterSourceMoving(): return - # save and exit - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() def testRenameMacroAfterSourceModification(): def __deleteAnyClass__(): diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py index ddf4d368af5..63de1001e1b 100644 --- a/tests/system/suite_qtquick/tst_qml_outline/test.py +++ b/tests/system/suite_qtquick/tst_qml_outline/test.py @@ -21,8 +21,7 @@ def main(): qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"] checkOutlineFor(qmlFiles) testModify() - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() def checkOutlineFor(qmlFiles): for qmlFile in qmlFiles: diff --git a/tests/system/suite_tools/tst_codepasting/test.py b/tests/system/suite_tools/tst_codepasting/test.py index 1275052156c..fd389490eaf 100644 --- a/tests/system/suite_tools/tst_codepasting/test.py +++ b/tests/system/suite_tools/tst_codepasting/test.py @@ -53,6 +53,8 @@ def pasteFile(sourceFile, protocol): typeLines(editor, "// tst_codepasting %s" % datetime.utcnow()) sourceText = editor.plainText invokeMenuItem("Tools", "Code Pasting", "Paste Snippet...") + pasteView = waitForObject(":Send to Codepaster_CodePaster::PasteView") + waitFor("pasteView.isActiveWindow") selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol) pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit") test.compare(pasteEditor.plainText, sourceText, "Verify that dialog shows text from the editor") diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py index 229420a8b8c..f9e6b0bdc05 100644 --- a/tests/system/suite_tools/tst_designer_autocomplete/test.py +++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py @@ -7,7 +7,9 @@ def main(): startQC() if not startedWithoutPluginError(): return - createProject_Qt_GUI(tempDir(), "DesignerTestApp") + projectName = "DesignerTestApp" + createProject_Qt_GUI(tempDir(), projectName) + invokeMenuItem('Build', 'Build Project "%s"' % projectName) selectFromLocator("mainwindow.ui") dragAndDrop(waitForObject("{container=':qdesigner_internal::WidgetBoxCategoryListView'" "text='Push Button' type='QModelIndex'}"), 5, 5, @@ -46,5 +48,4 @@ def main(): 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName)) type(editor, "") # Delete line selectFromLocator("mainwindow.ui") - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit() diff --git a/tests/system/suite_tools/tst_designer_goto_slot/test.py b/tests/system/suite_tools/tst_designer_goto_slot/test.py index cb3c9eb743f..c43846d7f8c 100644 --- a/tests/system/suite_tools/tst_designer_goto_slot/test.py +++ b/tests/system/suite_tools/tst_designer_goto_slot/test.py @@ -33,5 +33,4 @@ def main(): type(editor, "") test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000), 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3])) - invokeMenuItem("File", "Save All") - invokeMenuItem("File", "Exit") + saveAndExit()