diff --git a/.clang-format b/.clang-format index 2d6d4493d07..2af05c07cd1 100644 --- a/.clang-format +++ b/.clang-format @@ -13,20 +13,22 @@ # [1] https://doc-snapshots.qt.io/qtcreator-extending/coding-style.html # [2] https://clang.llvm.org/docs/ClangFormatStyleOptions.html # +# yaml-language-server: $schema=https://json.schemastore.org/clang-format.json +# --- Language: Cpp AccessModifierOffset: -4 AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false +AlignConsecutiveAssignments: None +AlignConsecutiveDeclarations: None AlignEscapedNewlines: DontAlign -AlignOperands: true +AlignOperands: Align AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: Inline -AllowShortIfStatementsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false @@ -108,7 +110,7 @@ SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 -SpacesInAngles: false +SpacesInAngles: Never SpacesInContainerLiterals: false SpacesInCStyleCastParentheses: false SpacesInParentheses: false diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml index c32b57e4c3c..6ac4564da1e 100644 --- a/.github/workflows/build_cmake.yml +++ b/.github/workflows/build_cmake.yml @@ -14,7 +14,7 @@ env: CMAKE_VERSION: 3.21.1 NINJA_VERSION: 1.10.2 BUILD_TYPE: Release - CCACHE_VERSION: 4.6 + CCACHE_VERSION: 4.9 QT_MIRRORS: download.qt.io;mirrors.ocf.berkeley.edu/qt;ftp.fau.de/qtproject;mirror.bit.edu.cn/qtproject jobs: @@ -49,7 +49,8 @@ jobs: } - { name: "macOS Latest Clang", artifact: "macos-universal", - os: macos-latest, + # TODO: move back to macos-latest when macos-latest is 13 or higher + os: macos-13, cc: "clang", cxx: "clang++" } @@ -437,15 +438,32 @@ jobs: - name: Download ccache shell: cmake -P {0} run: | - set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz") - foreach(retry RANGE 10) - file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS) - file(SIZE ./ccache.tar.xz fileSize) - if (fileSize GREATER 0) - break() - endif() - endforeach() - execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz) + if ("${{ runner.os }}" STREQUAL "Windows") + set(ccache_dir "ccache-$ENV{CCACHE_VERSION}-windows-x86_64") + set(ccache_archive "${ccache_dir}.zip") + elseif ("${{ runner.os }}" STREQUAL "Linux") + set(ccache_dir "ccache-$ENV{CCACHE_VERSION}-linux-x86_64") + set(ccache_archive "${ccache_dir}.tar.xz") + elseif ("${{ runner.os }}" STREQUAL "macOS") + set(ccache_dir "ccache-$ENV{CCACHE_VERSION}-darwin") + set(ccache_archive "${ccache_dir}.tar.gz") + endif() + + set(ccache_url "https://github.com/ccache/ccache/releases/download/v$ENV{CCACHE_VERSION}/${ccache_archive}") + file(DOWNLOAD "${ccache_url}" ./${ccache_archive} SHOW_PROGRESS) + execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./${ccache_archive}) + + # Add to PATH environment variable + file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/${ccache_dir}" ccache_dir) + set(path_separator ":") + if ("${{ runner.os }}" STREQUAL "Windows") + set(path_separator ";") + endif() + file(APPEND "$ENV{GITHUB_PATH}" "$ENV{GITHUB_WORKSPACE}${path_separator}${ccache_dir}") + + if (NOT "${{ runner.os }}" STREQUAL "Windows") + execute_process(COMMAND chmod +x ${ccache_dir}/ccache) + endif() - name: Prepare ccache archive name id: ccache @@ -586,6 +604,14 @@ jobs: endif() endif() + find_program(llvm_link_exe llvm-link PATHS "${{ steps.libclang.outputs.libclang_dir }}/bin") + set(WITH_LLVM_LINK --add-config=-DCMAKE_LINKER=${llvm_link_exe}) + + # Not for MSVC + if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") + unset(WITH_LLVM_LINK) + endif() + execute_process( COMMAND python -u @@ -600,6 +626,7 @@ jobs: ${CDB_OPTION} ${ELFUTILS_OPTION} ${NO_DMG} + ${WITH_LLVM_LINK} --add-config=-DCMAKE_C_COMPILER_LAUNCHER=ccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache --add-config=-DIDE_REVISION_URL=https://github.com/$ENV{GITHUB_REPOSITORY}/commits/$ENV{GITHUB_SHA} diff --git a/.gitignore b/.gitignore index 7c56e80373d..6369b049a28 100644 --- a/.gitignore +++ b/.gitignore @@ -58,8 +58,8 @@ CMakeLists.txt.user* /src/plugins/**/*.json !/src/plugins/**/wizard.json /src/plugins/coreplugin/ide_version.h -/src/libs/qt-breakpad/bin /.cmake/ +/.vs/ app_version.h phony.c @@ -286,3 +286,4 @@ tmp/ # qbs builds /*-debug/ /*-release/ +/out/ diff --git a/CMakeLists.txt b/CMakeLists.txt index acab23d9641..2aefb1a58dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) qtc_handle_compiler_cache_support() +qtc_handle_llvm_linker() option(BUILD_LINK_WITH_QT "Link with Qt from the parent Qt Creator" OFF) qtc_link_with_qt() diff --git a/README.md b/README.md index b124562ba03..32b53aacb53 100644 --- a/README.md +++ b/README.md @@ -329,708 +329,9 @@ Note that the plugin is disabled by default. Qt Creator is available under commercial licenses from The Qt Company, and under the GNU General Public License version 3, annotated with The Qt Company GPL Exception 1.0. -See [LICENSE.GPL-EXCEPT](LICENSE.GPL-EXCEPT) for the details. +See [LICENSE.GPL3-EXCEPT](LICENSE.GPL3-EXCEPT) for the details. -Qt Creator furthermore includes the following third-party components, -we thank the authors who made this possible: +For more information about the third-party components that Qt Creator +includes, see the +[Acknowledgements section in the documentation](https://doc.qt.io/qtcreator/creator-acknowledgements.html). -### YAML Parser yaml-cpp (MIT License) - - https://github.com/jbeder/yaml-cpp - - QtCreator/src/libs/3rdparty/yaml-cpp - - Copyright (c) 2008-2015 Jesse Beder. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -### KSyntaxHighlighting - - Syntax highlighting engine for Kate syntax definitions - - This is a stand-alone implementation of the Kate syntax highlighting - engine. It's meant as a building block for text editors as well as - for simple highlighted text rendering (e.g. as HTML), supporting both - integration with a custom editor as well as a ready-to-use - QSyntaxHighlighter sub-class. - - Distributed under the: - - MIT License - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - The source code of KSyntaxHighlighting can be found here: - https://cgit.kde.org/syntax-highlighting.git - QtCreator/src/libs/3rdparty/syntax-highlighting - https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/src/libs/3rdparty/syntax-highlighting - -### Clazy - - https://github.com/KDE/clazy - - Copyright (C) 2015-2018 Clazy Team - - Distributed under GNU LIBRARY GENERAL PUBLIC LICENSE Version 2 (LGPL2). - - Integrated with patches from - https://code.qt.io/cgit/clang/clazy.git/. - -### LLVM/Clang - - https://github.com/llvm/llvm-project.git - - Copyright (C) 2003-2019 LLVM Team - - Distributed under the Apache 2.0 License with LLVM exceptions, - see https://github.com/llvm/llvm-project/blob/main/clang/LICENSE.TXT - - With backported/additional patches from https://code.qt.io/cgit/clang/llvm-project.git - -### std::span implementation for C++11 and later - - A single-header implementation of C++20's std::span, conforming to the C++20 - committee draft. It is compatible with C++11, but will use newer language - features if they are available. - - https://github.com/martinmoene/span-lite - - QtCreator/src/libs/3rdparty/span - - Copyright 2018-2021 Martin Moene - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) - -### Open Source front-end for C++ (license MIT), enhanced for use in Qt Creator - - Roberto Raggi - - QtCreator/src/libs/3rdparty/cplusplus - - Copyright 2005 Roberto Raggi - - Permission to use, copy, modify, distribute, and sell this software and its - documentation for any purpose is hereby granted without fee, provided that - the above copyright notice appear in all copies and that both that - copyright notice and this permission notice appear in supporting - documentation. - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -### Open Source tool for generating C++ code that classifies keywords (license MIT) - - Roberto Raggi - - QtCreator/src/tools/3rdparty/cplusplus-keywordgen - - Copyright (c) 2007 Roberto Raggi - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - the Software, and to permit persons to whom the Software is furnished to do so, - subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -### SQLite (version 3.8.10.2) - -SQLite is a C-language library that implements a small, fast, self-contained, -high-reliability, full-featured, SQL database engine. - -SQLite (https://www.sqlite.org) is in the Public Domain. - -### ClassView and ImageViewer plugins - - Copyright (C) 2016 The Qt Company Ltd. - - All rights reserved. - Copyright (C) 2016 Denis Mingulov. - - Contact: http://www.qt.io - - This file is part of Qt Creator. - - You may use this file under the terms of the BSD license as follows: - - "Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of The Qt Company Ltd and its Subsidiary(-ies) nor - the names of its contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - -### Source Code Pro font - - Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), - with Reserved Font Name 'Source'. All Rights Reserved. Source is a - trademark of Adobe Systems Incorporated in the United States - and/or other countries. - - This Font Software is licensed under the SIL Open Font License, Version 1.1. - - The font and license files can be found in QtCreator/src/libs/3rdparty/fonts. - -### JSON Library by Niels Lohmann - - Used by the Chrome Trace Format Visualizer plugin instead of QJson - because of QJson's current hard limit of 128 Mb object size and - trace files often being much larger. - - The sources can be found in `QtCreator/src/libs/3rdparty/json`. - - The class is licensed under the MIT License: - - Copyright © 2013-2019 Niels Lohmann - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the “Software”), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is furnished - to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - - The class contains the UTF-8 Decoder from Bjoern Hoehrmann which is - licensed under the MIT License (see above). Copyright © 2008-2009 Björn - Hoehrmann bjoern@hoehrmann.de - - The class contains a slightly modified version of the Grisu2 algorithm - from Florian Loitsch which is licensed under the MIT License (see above). - Copyright © 2009 Florian Loitsch - -### litehtml - - The litehtml HTML/CSS rendering engine is used as a help viewer backend - to display help files. - - The sources can be found in: - * QtCreator/src/plugins/help/qlitehtml - * https://github.com/litehtml - - Copyright (c) 2013, Yuri Kobets (tordex) - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -### gumbo - - The litehtml HTML/CSS rendering engine uses the gumbo parser. - - Copyright 2010, 2011 Google - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -### gumbo/utf8.c - - The litehtml HTML/CSS rendering engine uses gumbo/utf8.c parser. - - Copyright (c) 2008-2009 Bjoern Hoehrmann - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - -### SourceCodePro fonts - - Qt Creator ships with the following fonts licensed under OFL-1.1: - - * SourceCodePro-Regular.ttf - * SourceCodePro-It.ttf - * SourceCodePro-Bold.ttf - - SIL OPEN FONT LICENSE - - Version 1.1 - 26 February 2007 - - PREAMBLE - The goals of the Open Font License (OFL) are to stimulate worldwide - development of collaborative font projects, to support the font creation - efforts of academic and linguistic communities, and to provide a free and - open framework in which fonts may be shared and improved in partnership - with others. - - The OFL allows the licensed fonts to be used, studied, modified and - redistributed freely as long as they are not sold by themselves. The - fonts, including any derivative works, can be bundled, embedded, - redistributed and/or sold with any software provided that any reserved - names are not used by derivative works. The fonts and derivatives, - however, cannot be released under any other type of license. The - requirement for fonts to remain under this license does not apply - to any document created using the fonts or their derivatives. - - DEFINITIONS - "Font Software" refers to the set of files released by the Copyright - Holder(s) under this license and clearly marked as such. This may - include source files, build scripts and documentation. - - "Reserved Font Name" refers to any names specified as such after the - copyright statement(s). - - "Original Version" refers to the collection of Font Software components as - distributed by the Copyright Holder(s). - - "Modified Version" refers to any derivative made by adding to, deleting, - or substituting - in part or in whole - any of the components of the - Original Version, by changing formats or by porting the Font Software to a - new environment. - - "Author" refers to any designer, engineer, programmer, technical - writer or other person who contributed to the Font Software. - - PERMISSION & CONDITIONS - Permission is hereby granted, free of charge, to any person obtaining - a copy of the Font Software, to use, study, copy, merge, embed, modify, - redistribute, and sell modified and unmodified copies of the Font - Software, subject to the following conditions: - - 1) Neither the Font Software nor any of its individual components, - in Original or Modified Versions, may be sold by itself. - - 2) Original or Modified Versions of the Font Software may be bundled, - redistributed and/or sold with any software, provided that each copy - contains the above copyright notice and this license. These can be - included either as stand-alone text files, human-readable headers or - in the appropriate machine-readable metadata fields within text or - binary files as long as those fields can be easily viewed by the user. - - 3) No Modified Version of the Font Software may use the Reserved Font - Name(s) unless explicit written permission is granted by the corresponding - Copyright Holder. This restriction only applies to the primary font name as - presented to the users. - - 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font - Software shall not be used to promote, endorse or advertise any - Modified Version, except to acknowledge the contribution(s) of the - Copyright Holder(s) and the Author(s) or with their explicit written - permission. - - 5) The Font Software, modified or unmodified, in part or in whole, - must be distributed entirely under this license, and must not be - distributed under any other license. The requirement for fonts to - remain under this license does not apply to any document created - using the Font Software. - - TERMINATION - This license becomes null and void if any of the above conditions are - not met. - - DISCLAIMER - THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT - OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE - COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL - DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM - OTHER DEALINGS IN THE FONT SOFTWARE. - -### Qbs - - Qt Creator installations deliver Qbs. Its licensing and third party - attributions are listed in Qbs Manual at - https://doc.qt.io/qbs/attributions.html - -### conan.cmake - - CMake script used by Qt Creator's auto setup of package manager dependencies. - - The sources can be found in: - * QtCreator/src/share/3rdparty/package-manager/conan.cmake - * https://github.com/conan-io/cmake-conan - - The MIT License (MIT) - - Copyright (c) 2018 JFrog - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - -### TartanLlama/expected - - Implementation of std::expected compatible with C++11/C++14/C++17. - - https://github.com/TartanLlama/expected - - To the extent possible under law, the author(s) have dedicated all - copyright and related and neighboring rights to this software to the - public domain worldwide. This software is distributed without any warranty. - - http://creativecommons.org/publicdomain/zero/1.0/ - -### WinPty - - Implementation of a pseudo terminal for Windows. - - https://github.com/rprichard/winpty - - The MIT License (MIT) - - Copyright (c) 2011-2016 Ryan Prichard - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - IN THE SOFTWARE. - - -### ptyqt - - Pty-Qt is small library for access to console applications by pseudo-terminal interface on Mac, - Linux and Windows. On Mac and Linux it uses standard PseudoTerminal API and on Windows it uses - WinPty(prefer) or ConPty. - - https://github.com/kafeg/ptyqt - - MIT License - - Copyright (c) 2019 Vitaly Petrov, v31337@gmail.com - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - -### libvterm - - An abstract C99 library which implements a VT220 or xterm-like terminal emulator. - It doesn't use any particular graphics toolkit or output system, instead it invokes callback - function pointers that its embedding program should provide it to draw on its behalf. - It avoids calling malloc() during normal running state, allowing it to be used in embedded kernel - situations. - - https://www.leonerd.org.uk/code/libvterm/ - - The MIT License - - Copyright (c) 2008 Paul Evans - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -### terminal/shellintegrations - - The Terminal plugin uses scripts to integrate with the shell. The scripts are - located in the Qt Creator source tree in src/plugins/terminal/shellintegrations. - - https://github.com/microsoft/vscode/tree/main/src/vs/workbench/contrib/terminal/browser/media - - MIT License - - Copyright (c) 2015 - present Microsoft Corporation - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - -### terminal/shellintegrations/clink - - The Terminal plugin uses a lua script to integrate with the cmd shell when using clink. - - https://github.com/chrisant996/clink-gizmos - - MIT License - - Copyright (c) 2023 Chris Antos - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - -### QrCodeGenerator - - The QML Designer plugin uses QR Code Generator for Design Viewer integration. - - https://github.com/alex-spataru/Qt-QrCodeGenerator - - MIT License - - Copyright (c) 2023 Alex Spataru - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - -### cmake - - The CMake project manager uses the CMake lexer code for parsing CMake files - - https://gitlab.kitware.com/cmake/cmake.git - - CMake - Cross Platform Makefile Generator - Copyright 2000-2023 Kitware, Inc. and Contributors - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of Kitware, Inc. nor the names of Contributors - may be used to endorse or promote products derived from this - software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -### RSTParser - - RSTParser is an open-source C++ library for parsing reStructuredText - - https://github.com/vitaut-archive/rstparser - - License - ------- - - Copyright (c) 2013, Victor Zverovich - - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake index 66d9407787c..5cbd9cd4bf4 100644 --- a/cmake/QtCreatorAPI.cmake +++ b/cmake/QtCreatorAPI.cmake @@ -46,6 +46,7 @@ option(QTC_SEPARATE_DEBUG_INFO "Extract debug information from binary files." OF option(WITH_SCCACHE_SUPPORT "Enables support for building with SCCACHE and separate debug info with MSVC, which SCCACHE normally doesn't support." OFF) option(WITH_CCACHE_SUPPORT "Enables support for building with CCACHE and separate debug info with MSVC, which CCACHE normally doesn't support." "${ENV_WITH_CCACHE_SUPPORT}") option(QTC_STATIC_BUILD "Builds libraries and plugins as static libraries" OFF) +option(QTC_USE_LLVM_LINKER "Uses llvm-link linker if found." OFF) # If we provide a list of plugins, executables, libraries, then the BUILD__BY_DEFAULT will be set to OFF # and for every element we set BUILD__ to ON diff --git a/cmake/QtCreatorAPIInternal.cmake b/cmake/QtCreatorAPIInternal.cmake index 95fb83207d4..08167535e32 100644 --- a/cmake/QtCreatorAPIInternal.cmake +++ b/cmake/QtCreatorAPIInternal.cmake @@ -31,7 +31,10 @@ if (WIN32) if (NOT BUILD_WITH_PCH) list(APPEND DEFAULT_DEFINES - WIN32_LEAN_AND_MEAN) + WIN32_LEAN_AND_MEAN + WINVER=0x0A00 + _WIN32_WINNT=0x0A00 + ) endif() endif() @@ -141,6 +144,15 @@ function(qtc_handle_compiler_cache_support) endif() endfunction() +function(qtc_handle_llvm_linker) + if (QTC_USE_LLVM_LINKER) + find_program(LLVM_LINK_PROGRAM llvm-link) + if(LLVM_LINK_PROGRAM) + set(CMAKE_LINKER "${LLVM_LINK_PROGRAM}" CACHE STRING "LLVM linker" FORCE) + endif() + endif() +endfunction() + function(qtc_link_with_qt) # When building with Qt Creator 4.15+ do the "Link with Qt..." automatically if (BUILD_LINK_WITH_QT AND DEFINED CMAKE_PROJECT_INCLUDE_BEFORE) diff --git a/cmake/QtCreatorDocumentation.cmake b/cmake/QtCreatorDocumentation.cmake index 8fa0c58d93e..1ef9030a43a 100644 --- a/cmake/QtCreatorDocumentation.cmake +++ b/cmake/QtCreatorDocumentation.cmake @@ -225,7 +225,7 @@ endfunction() function(add_qtc_documentation qdocconf_file) cmake_parse_arguments(_arg "" "" - "INCLUDE_DIRECTORIES;FRAMEWORK_PATHS" ${ARGN}) + "INCLUDE_DIRECTORIES;FRAMEWORK_PATHS;ENVIRONMENT_EXPORTS" ${ARGN}) if (_arg_UNPARSED_ARGUMENTS) message(FATAL_ERROR "add_qtc_documentation has unknown arguments: ${_arg_UNPARSED_ARGUMENTS}.") endif() @@ -262,6 +262,7 @@ function(add_qtc_documentation qdocconf_file) QTC_DOCS_DIR QTC_VERSION QTC_VERSION_TAG QTCREATOR_COPYRIGHT_YEAR QT_INSTALL_DOCS QDOC_INDEX_DIR + ${_arg_ENVIRONMENT_EXPORTS} ) qdoc_build_qdocconf_file(${qdocconf_file} ${_qch_params} ${_qdoc_params} @@ -269,3 +270,25 @@ function(add_qtc_documentation qdocconf_file) FRAMEWORK_PATHS ${_arg_FRAMEWORK_PATHS} ) endfunction() + +function(add_qtc_doc_attribution target attribution_file output_file qdocconf_file) + get_filename_component(doc_target "${qdocconf_file}" NAME_WE) + set(html_target "html_docs_${doc_target}") + if (NOT TARGET ${html_target}) + # probably qdoc is missing, so other documentation targets are not there + return() + endif() + # make sure output directory exists + get_filename_component(output_dir "${output_file}" DIRECTORY) + file(MAKE_DIRECTORY ${output_dir}) + # add target + add_custom_target(${target} + Qt6::qtattributionsscanner -o "${output_file}" ${attribution_file} + COMMENT "Create attributions ${output_file} from ${attribution_file}" + DEPENDS "${attribution_file}" + SOURCES "${attribution_file}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + VERBATIM + ) + add_dependencies(${html_target} ${target}) +endfunction() diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index 17ad5c2acae..275454a6684 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,7 +1,7 @@ -set(IDE_VERSION "12.0.2") # The IDE version. -set(IDE_VERSION_COMPAT "12.0.0") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "12.0.2") # The IDE display version. -set(IDE_COPYRIGHT_YEAR "2023") # The IDE current copyright year. +set(IDE_VERSION "12.0.82") # The IDE version. +set(IDE_VERSION_COMPAT "12.0.82") # The IDE Compatibility version. +set(IDE_VERSION_DISPLAY "13.0.0-beta1") # The IDE display version. +set(IDE_COPYRIGHT_YEAR "2024") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. set(IDE_DISPLAY_NAME "Qt Creator") # The IDE display name. diff --git a/dist/changelog/changes-12.0.2.md b/dist/changelog/changes-12.0.2.md new file mode 100644 index 00000000000..84523b26baf --- /dev/null +++ b/dist/changelog/changes-12.0.2.md @@ -0,0 +1,163 @@ +Qt Creator 12.0.2 +================= + +Qt Creator version 12.0.2 contains bug fixes. + +The most important changes are listed in this document. For a complete list of +changes, see the Git log for the Qt Creator sources that you can check out from +the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline origin/v12.0.1..v12.0.2 + +General +------- + +### External Tools + +* Fixed that the output could be interspersed with newlines + ([QTCREATORBUG-29977](https://bugreports.qt.io/browse/QTCREATORBUG-29977)) + +Editing +------- + +* Fixed that modified documents lost their file icon, which potentially included + a short freeze + ([QTCREATORBUG-29999](https://bugreports.qt.io/browse/QTCREATORBUG-29999)) +* Fixed a crash when opening bookmarks + ([QTCREATORBUG-30283](https://bugreports.qt.io/browse/QTCREATORBUG-30283)) + +### C++ + +* Clang Format + * Fixed the update of the preview when settings change + ([QTCREATORBUG-30089](https://bugreports.qt.io/browse/QTCREATORBUG-30089)) + * Fixed an issue with `CRLF` line endings +* Fixed a freeze when looking up symbols + ([QTCREATORBUG-30155](https://bugreports.qt.io/browse/QTCREATORBUG-30155)) +* Fixed a crash while parsing + ([QTCREATORBUG-30044](https://bugreports.qt.io/browse/QTCREATORBUG-30044)) + +### Language Server Protocol + +* Fixed a crash when completing + +### Markdown + +* Fixed that clicking on file links cleared the preview instead of opening the + file + ([QTCREATORBUG-30120](https://bugreports.qt.io/browse/QTCREATORBUG-30120)) + +Projects +-------- + +* Fixed that trying to stop remote processes that were no longer reachable + resulted in a broken run control state +* Fixed a potential infinite loop + ([QTCREATORBUG-30067](https://bugreports.qt.io/browse/QTCREATORBUG-30067)) +* Fixed a crash when navigating in the Projects view + ([QTCREATORBUG-30035](https://bugreports.qt.io/browse/QTCREATORBUG-30035)) +* Fixed that custom compiler settings could vanish after restart + ([QTCREATORBUG-30133](https://bugreports.qt.io/browse/QTCREATORBUG-30133)) +* Fixed the restoring of per project C++ file name settings + +### CMake + +* Fixed that automatic re-configuration on saving files while a build is + running could fail + ([QTCREATORBUG-30048](https://bugreports.qt.io/browse/QTCREATORBUG-30048)) +* Fixed that the automatically added library path was wrong for targets with + the same name as special CMake targets (like "test") + ([QTCREATORBUG-30050](https://bugreports.qt.io/browse/QTCREATORBUG-30050)) +* Fixed that the `cm` locator filter did not show all targets + ([QTCREATORBUG-29946](https://bugreports.qt.io/browse/QTCREATORBUG-29946)) +* Fixed adding files with the wizards when triggered through `File > New File` + ([QTCREATORBUG-30170](https://bugreports.qt.io/browse/QTCREATORBUG-30170)) +* Fixed adding QML files to CMake files when variables like `${PROJECT_NAME}` + are used for the target name + ([QTCREATORBUG-30218](https://bugreports.qt.io/browse/QTCREATORBUG-30218)) +* Fixed adding files to `OBJECT` libraries + ([QTCREATORBUG-29914](https://bugreports.qt.io/browse/QTCREATORBUG-29914)) +* CMake Presets + * Fixed that display names were not updated when reloading presets + ([QTCREATORBUG-30237](https://bugreports.qt.io/browse/QTCREATORBUG-30237)) + +### Conan + +* Fixed that macOS sysroot was not passed on to Conan + ([QTCREATORBUG-29978](https://bugreports.qt.io/browse/QTCREATORBUG-29978)) +* Fixed that the MSVC runtime library was not passed on to Conan + ([QTCREATORBUG-30169](https://bugreports.qt.io/browse/QTCREATORBUG-30169)) + +### Autotools + +* Fixed that makefiles where no longer recognized as project files + +Debugging +--------- + +### CMake + +* Fixed that debugging required a successful build first + ([QTCREATORBUG-30045](https://bugreports.qt.io/browse/QTCREATORBUG-30045)) + +Terminal +-------- + +* Fixed a crash when double-clicking + ([QTCREATORBUG-30144](https://bugreports.qt.io/browse/QTCREATORBUG-30144)) + +Platforms +--------- + +### Android + +* Fixed that the prompt for configuring the Android setup was no longer shown + ([QTCREATORBUG-30131](https://bugreports.qt.io/browse/QTCREATORBUG-30131)) +* Fixed that Qt ABI detection could be wrong + ([QTCREATORBUG-30146](https://bugreports.qt.io/browse/QTCREATORBUG-30146)) + +### iOS + +* Fixed that multiple dialogs informing about devices that are not in developer + mode were opened simultaneously +* Fixed that a wrong warning about the provisioning profile could be shown + ([QTCREATORBUG-30158](https://bugreports.qt.io/browse/QTCREATORBUG-30158)) + +### Remote Linux + +* Fixed that deployment could fail when trying to kill the potentially running + application + ([QTCREATORBUG-30024](https://bugreports.qt.io/browse/QTCREATORBUG-30024)) + +### Boot2Qt + +* Fixed that SSH operations could silently fail after the connection got lost + ([QTCREATORBUG-29982](https://bugreports.qt.io/browse/QTCREATORBUG-29982)) + +### WASM + +* Fixed issues with spaces in the `emsdk` path + ([QTCREATORBUG-29981](https://bugreports.qt.io/browse/QTCREATORBUG-29981)) + +Credits for these changes go to: +-------------------------------- +Alessandro Portale +André Pönitz +Artem Sokolovskii +Christian Kandeler +Christian Stenger +Cristian Adam +Cristián Maureira-Fredes +David Faure +David Schulz +Eike Ziller +Fabian Vogt +Jaroslaw Kobus +Leena Miettinen +Marcus Tillmanns +Mathias Hasselmann +Robert Löhning +Sivert Krøvel +Thiago Macieira +Yasser Grimes diff --git a/dist/changelog/changes-13.0.0.md b/dist/changelog/changes-13.0.0.md new file mode 100644 index 00000000000..bd3fc5e3d51 --- /dev/null +++ b/dist/changelog/changes-13.0.0.md @@ -0,0 +1,270 @@ +Qt Creator 13 +============= + +Qt Creator version 13 contains bug fixes and new features. + +The most important changes are listed in this document. For a complete list of +changes, see the Git log for the Qt Creator sources that you can check out from +the public Git repository. For example: + + git clone git://code.qt.io/qt-creator/qt-creator.git + git log --cherry-pick --pretty=oneline origin/12.0..v13.0.0 + +What's new? +----------- + +* Added Qt Application Manager support + +### Qt Application Manager + +Adds support for Qt 6 based applications with CMake for creating, building, +deploying, running, and debugging on devices that use the +[Qt Application Manager](https://doc.qt.io/QtApplicationManager/). + +([Documentation](https://doc.qt.io/qtcreator/creator-overview-qtasam.html)) + +General +------- + +* Improved docking (Debug mode, Widget Designer) + * Fixed the style of titles and changed them to always be visible + (removed `View > Views > Automatically Hide View Titlebars`) + * Added an option to collapse panels + * Changed `Hide/Show Left/Right Sidebar` to hide and show the corresponding + dock area +* Added the option to show file paths relative to the active project to the + search results view + (QTCREATORBUG-29462) +* Added a `Current` button for selecting the directory of the current document + for searching in `Files in File System` +* Added `Copy to Clipboard` to the `About Qt Creator` dialog + (QTCREATORBUG-29886) + +Editing +------- + +* Made syntax highlighting asynchronous +* Fixed that `Shift+Tab` did not always unindent + (QTCREATORBUG-29742) +* Fixed that `Surround text selection with brackets` did nothing for `<` +* Fixed following links without a file name in documents without a file name + +### C++ + +* Added the `Move Definition Here` refactoring action that moves an existing + function definition to its declaration + (QTCREATORBUG-9515) +* Enabled the completion inside comments and strings by falling back to the + built-in code model + (QTCREATORBUG-20828) +* Improved the position of headers inserted by refactoring operations + (QTCREATORBUG-21826) +* Improved the coding style settings by separating Clang Format and other coding + style settings, and using a plain text editor for custom Clang Format settings +* Fixed that the class wizards used the class name for the include guard + instead of the file name + (QTCREATORBUG-30140) +* Fixed that renaming classes did not change the include directive for the + renamed header in the source file + (QTCREATORBUG-30154) +* Fixed issues with refactoring template functions + (QTCREATORBUG-29408) +* Clangd + * Fixed that `Follow Symbol Under Cursor` only worked for exact matches + (QTCREATORBUG-29814) + +### QML + +* Added navigation from QML components to the C++ code in the project + (QTCREATORBUG-28086) +* Added a button for launching the QML Preview on the current document to + the editor tool bar +* Added color previews when hovering Qt color functions + (QTCREATORBUG-29966) + +### Python + +* Fixed that global and virtual environments were polluted with `pylsp` and + `debugpy` installations + +### Language Server Protocol + +* Added automatic setup up of language servers for `YAML`, `JSON`, and `Bash` + (requires `npm`) + +### Widget Designer + +* Fixed the indentation of the code that is inserted by `Go to slot` + (QTCREATORBUG-11730) + +### Compiler Explorer + +* Added highlighting of the matching source lines when hovering over the + assembly + +### Markdown + +* Added the common text editor tools (line and column, encoding, and line +endings) to the tool bar +* Added support for following links to the text editor + +Projects +-------- + +* Added a section `Vanished Targets` to `Projects` mode in case the project + was configured for kits that have vanished, as a replacement for the automatic + creation of "Replacement" kits +* Added the status of devices to the device lists + (QTCREATORBUG-20941) +* Added the `Preferences > Build & Run > General > Application environment` + option for globally modifying the environment for all run configurations + (QTCREATORBUG-29530) +* Added a file wizard for Qt translation (`.ts`) files + (QTCREATORBUG-29775) +* Increased the maximum width of the target selector + (QTCREATORBUG-30038) +* Fixed that the `Left` cursor key did not always collapse the current item + (QTBUG-118515) +* Fixed inconsistent folder hierarchies in the project tree + (QTCREATORBUG-29923) + +### CMake + +* Added support for custom output parsers for the configuration of projects + (QTCREATORBUG-29992) +* Made cache variables available even if project configuration failed + +### Python + +* Added `Generate Kit` to the Python interpreter preferences for generating a + Python kit with this interpreter +* Added the target setup page when loading unconfigured Python projects +* Fixed that the same Python interpreter could be auto-detected multiple times + under different names + +Debugging +--------- + +### C++ + +* Fixed that breakpoints were not hit while the message dialog about missing + debug information was shown + (QTCREATORBUG-30168) + +### Debug Adapter Protocol + +* Added support for function breakpoints + +Analyzer +-------- + +### Clang + +* Added `Edit Checks as Strings` for Clazy + (QTCREATORBUG-24846) + +### Axivion + +* Added fetching and showing issues + +Terminal +-------- + +* Added `Select All` to the context menu + (QTCREATORBUG-29922) +* Fixed the startup performance on Windows + (QTCREATORBUG-29840) +* Fixed the integration of the `fish` shell +* Fixed that `Ctrl+W` closed the terminal even when shortcuts were blocked + (QTCREATORBUG-30070) + +Version Control Systems +----------------------- + +### Git + +* Added the upstream status for untracked branches to `Branches` view + +Test Integration +---------------- + +### Qt Test + +* Added a locator filter for Qt Test data tags (`qdt`) + +Platforms +--------- + +### Android + +* Add support for target-based android-build directories (??? is that ready? Qt 6.8+ ???) + (QTBUG-117443) + +### iOS + +* Fixed the detection of iOS 17 devices +* Fixed deployment and running applications for iOS 17 devices + (application output, debugging, and profiling are not supported) + (QTCREATORBUG-29682) + +### Remote Linux + +* Fixed that debugging unnecessarily downloaded files from the remote system + (QTCREATORBUG-29614) + +Credits for these changes go to: +-------------------------------- +Aaron McCarthy +Aleksei German +Alessandro Portale +Alexey Edelev +Ali Kianian +Amr Essam +Andre Hartmann +André Pönitz +Andreas Loth +Artem Sokolovskii +Brook Cronin +Burak Hancerli +Christian Kandeler +Christian Stenger +Cristian Adam +Daniel Trevitz +David Faure +David Schulz +Dominik Holland +Eike Ziller +Esa Törmänen +Fabian Kosmale +Friedemann Kleint +Henning Gruendl +Jaroslaw Kobus +Johanna Vanhatapio +Karim Abdelrahman +Knud Dollereder +Leena Miettinen +Mahmoud Badri +Marco Bubke +Marcus Tillmanns +Mathias Hasselmann +Mats Honkamaa +Mehdi Salem +Miikka Heikkinen +Mitch Curtis +Olivier De Cannière +Orgad Shaneh +Pranta Dastider +Robert Löhning +Sami Shalayel +Samuel Jose Raposo Vieira Mira +Serg Kryvonos +Shrief Gabr +Sivert Krøvel +Tasuku Suzuki +Thomas Hartmann +Tim Jenßen +Vikas Pachdha +Volodymyr Zibarov +Xavier Besson +Yasser Grimes +Yuri Vilmanis diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 23cada05909..00786024dfd 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -33,25 +33,30 @@ function(_find_all_includes _ret_includes _ret_framework_paths) endif() endfunction() -if (WITH_DOCS) - add_qtc_documentation(${IDE_DOC_FILE}) +function(_add_doc _doc_file _dev_doc_file) + set(GENERATED_ATTRIBUTIONS_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_attributions) + add_qtc_documentation(${_doc_file} + ENVIRONMENT_EXPORTS GENERATED_ATTRIBUTIONS_DIR + ) + add_qtc_doc_attribution(doc_attributions + "${CMAKE_CURRENT_SOURCE_DIR}/../qt_attributions.json" + "${GENERATED_ATTRIBUTIONS_DIR}/creator-attributions.qdoc" + ${_doc_file} + ) if (BUILD_DEVELOPER_DOCS) _find_all_includes(_all_includes _framework_paths) - add_qtc_documentation("qtcreatordev/qtcreator-dev.qdocconf" + add_qtc_documentation(${_dev_doc_file} INCLUDE_DIRECTORIES ${_all_includes} FRAMEWORK_PATHS ${_framework_paths} ) endif() +endfunction() + +if (WITH_DOCS) + _add_doc(${IDE_DOC_FILE} "qtcreatordev/qtcreator-dev.qdocconf") endif() if(WITH_ONLINE_DOCS) - add_qtc_documentation(${IDE_DOC_FILE_ONLINE}) - if (BUILD_DEVELOPER_DOCS) - _find_all_includes(_all_includes _framework_paths) - add_qtc_documentation("qtcreatordev/qtcreator-dev-online.qdocconf" - INCLUDE_DIRECTORIES ${_all_includes} - FRAMEWORK_PATHS ${_framework_paths} - ) - endif() + _add_doc(${IDE_DOC_FILE_ONLINE} "qtcreatordev/qtcreator-dev-online.qdocconf") endif() install(DIRECTORY config diff --git a/doc/qtcreator/config/qtcreator-project.qdocconf b/doc/qtcreator/config/qtcreator-project.qdocconf index d36bba7595c..c5f1819964c 100644 --- a/doc/qtcreator/config/qtcreator-project.qdocconf +++ b/doc/qtcreator/config/qtcreator-project.qdocconf @@ -13,7 +13,8 @@ ignorewords += \ MinGW headerdirs = -sourcedirs = ../src +sourcedirs = ../src \ + $$GENERATED_ATTRIBUTIONS_DIR imagedirs = ../images @@ -27,6 +28,7 @@ depends += qtwidgets \ qtcore \ qtqml \ qtquick \ + qtquickcontrols \ qmake \ qtdesigner \ qtdoc \ diff --git a/doc/qtcreator/config/style/qt5-sidebar.html b/doc/qtcreator/config/style/qt5-sidebar.html index a9676ff4539..3bcc686adc6 100644 --- a/doc/qtcreator/config/style/qt5-sidebar.html +++ b/doc/qtcreator/config/style/qt5-sidebar.html @@ -17,27 +17,6 @@ - -

Coding

diff --git a/doc/qtdesignstudio/images/icons/close.png b/doc/qtcreator/images/icons/close.png similarity index 100% rename from doc/qtdesignstudio/images/icons/close.png rename to doc/qtcreator/images/icons/close.png diff --git a/doc/qtcreator/images/icons/final.png b/doc/qtcreator/images/icons/final.png new file mode 100644 index 00000000000..b6adfc54607 Binary files /dev/null and b/doc/qtcreator/images/icons/final.png differ diff --git a/doc/qtcreator/images/icons/history.png b/doc/qtcreator/images/icons/history.png new file mode 100644 index 00000000000..e1636abfb87 Binary files /dev/null and b/doc/qtcreator/images/icons/history.png differ diff --git a/doc/qtcreator/images/icons/parallel.png b/doc/qtcreator/images/icons/parallel.png new file mode 100644 index 00000000000..b6760c39482 Binary files /dev/null and b/doc/qtcreator/images/icons/parallel.png differ diff --git a/doc/qtcreator/images/icons/state.png b/doc/qtcreator/images/icons/state.png new file mode 100644 index 00000000000..12c6a7e5e6e Binary files /dev/null and b/doc/qtcreator/images/icons/state.png differ diff --git a/doc/qtcreator/images/icons/transition.png b/doc/qtcreator/images/icons/transition.png new file mode 100644 index 00000000000..6f8ae2a1535 Binary files /dev/null and b/doc/qtcreator/images/icons/transition.png differ diff --git a/doc/qtcreator/images/qmldesigner-run-custom-exe.png b/doc/qtcreator/images/qmldesigner-run-custom-exe.png deleted file mode 100644 index c30f6d21857..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-run-custom-exe.png and /dev/null differ diff --git a/doc/qtcreator/images/qmldesigner-run-settings.png b/doc/qtcreator/images/qmldesigner-run-settings.png deleted file mode 100644 index 457a1a9286a..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-run-settings.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-clang-diagnostic-configurations.webp b/doc/qtcreator/images/qtcreator-clang-diagnostic-configurations.webp new file mode 100644 index 00000000000..87b9eb990ef Binary files /dev/null and b/doc/qtcreator/images/qtcreator-clang-diagnostic-configurations.webp differ diff --git a/doc/qtcreator/images/qtcreator-clang-tools-settings.webp b/doc/qtcreator/images/qtcreator-clang-tools-settings.webp index 046b984c75e..15ebfa0b229 100644 Binary files a/doc/qtcreator/images/qtcreator-clang-tools-settings.webp and b/doc/qtcreator/images/qtcreator-clang-tools-settings.webp differ diff --git a/doc/qtcreator/images/qtcreator-cmake-build-steps.webp b/doc/qtcreator/images/qtcreator-cmake-build-steps.webp index d90c97cb81f..dc05bbb67d9 100644 Binary files a/doc/qtcreator/images/qtcreator-cmake-build-steps.webp and b/doc/qtcreator/images/qtcreator-cmake-build-steps.webp differ diff --git a/doc/qtcreator/images/qtcreator-code-model-inspector.webp b/doc/qtcreator/images/qtcreator-code-model-inspector.webp new file mode 100644 index 00000000000..95346d72c8f Binary files /dev/null and b/doc/qtcreator/images/qtcreator-code-model-inspector.webp differ diff --git a/doc/qtcreator/images/qtcreator-code-style-built-in-indenter.webp b/doc/qtcreator/images/qtcreator-code-style-built-in-indenter.webp new file mode 100644 index 00000000000..f8eaa1dac52 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-code-style-built-in-indenter.webp differ diff --git a/doc/qtcreator/images/qtcreator-code-style-clang-format-global.webp b/doc/qtcreator/images/qtcreator-code-style-clang-format-global.webp index c012f83ce9a..ddfc428e8c4 100644 Binary files a/doc/qtcreator/images/qtcreator-code-style-clang-format-global.webp and b/doc/qtcreator/images/qtcreator-code-style-clang-format-global.webp differ diff --git a/doc/qtcreator/images/qtcreator-code-style-clang-format-project.webp b/doc/qtcreator/images/qtcreator-code-style-clang-format-project.webp index dc4aefecd15..5c210034ec8 100644 Binary files a/doc/qtcreator/images/qtcreator-code-style-clang-format-project.webp and b/doc/qtcreator/images/qtcreator-code-style-clang-format-project.webp differ diff --git a/doc/qtcreator/images/qtcreator-code-style-settings-edit-qtquick.png b/doc/qtcreator/images/qtcreator-code-style-settings-edit-qtquick.png deleted file mode 100644 index 34473e4bd89..00000000000 Binary files a/doc/qtcreator/images/qtcreator-code-style-settings-edit-qtquick.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-editor-line-column.webp b/doc/qtcreator/images/qtcreator-editor-line-column.webp deleted file mode 100644 index e46f50d94d9..00000000000 Binary files a/doc/qtcreator/images/qtcreator-editor-line-column.webp and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-editor-multicursor.webp b/doc/qtcreator/images/qtcreator-editor-multicursor.webp new file mode 100644 index 00000000000..1148dbad280 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-editor-multicursor.webp differ diff --git a/doc/qtcreator/images/qtcreator-editor-open-files.webp b/doc/qtcreator/images/qtcreator-editor-open-files.webp new file mode 100644 index 00000000000..3ec7e58ae9d Binary files /dev/null and b/doc/qtcreator/images/qtcreator-editor-open-files.webp differ diff --git a/doc/qtcreator/images/qtcreator-editor-symbols.webp b/doc/qtcreator/images/qtcreator-editor-symbols.webp new file mode 100644 index 00000000000..70bcc2b442c Binary files /dev/null and b/doc/qtcreator/images/qtcreator-editor-symbols.webp differ diff --git a/doc/qtcreator/images/qtcreator-editor-toolbar.webp b/doc/qtcreator/images/qtcreator-editor-toolbar.webp new file mode 100644 index 00000000000..4158934e48c Binary files /dev/null and b/doc/qtcreator/images/qtcreator-editor-toolbar.webp differ diff --git a/doc/qtcreator/images/qtcreator-editortoolbar-symbols.webp b/doc/qtcreator/images/qtcreator-editortoolbar-symbols.webp deleted file mode 100644 index 4c26207b89c..00000000000 Binary files a/doc/qtcreator/images/qtcreator-editortoolbar-symbols.webp and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-fakevim-options-general-plugin-emulation.png b/doc/qtcreator/images/qtcreator-fakevim-options-general-plugin-emulation.png deleted file mode 100644 index 7fcb4dad333..00000000000 Binary files a/doc/qtcreator/images/qtcreator-fakevim-options-general-plugin-emulation.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-fakevim-options.png b/doc/qtcreator/images/qtcreator-fakevim-options.png deleted file mode 100644 index 8b825ef7c61..00000000000 Binary files a/doc/qtcreator/images/qtcreator-fakevim-options.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-language-client-inspector-capabilities.png b/doc/qtcreator/images/qtcreator-language-client-inspector-capabilities.png deleted file mode 100644 index e2e12e3624a..00000000000 Binary files a/doc/qtcreator/images/qtcreator-language-client-inspector-capabilities.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-language-client-inspector-capabilities.webp b/doc/qtcreator/images/qtcreator-language-client-inspector-capabilities.webp new file mode 100644 index 00000000000..3da16397fc4 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-language-client-inspector-capabilities.webp differ diff --git a/doc/qtcreator/images/qtcreator-language-client-inspector-log.png b/doc/qtcreator/images/qtcreator-language-client-inspector-log.png deleted file mode 100644 index f522fe87d4b..00000000000 Binary files a/doc/qtcreator/images/qtcreator-language-client-inspector-log.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-language-client-inspector-log.webp b/doc/qtcreator/images/qtcreator-language-client-inspector-log.webp new file mode 100644 index 00000000000..5ad06e8fe4f Binary files /dev/null and b/doc/qtcreator/images/qtcreator-language-client-inspector-log.webp differ diff --git a/doc/qtcreator/images/qtcreator-language-client-inspector-memory-usage.png b/doc/qtcreator/images/qtcreator-language-client-inspector-memory-usage.png deleted file mode 100644 index 862c88d17e3..00000000000 Binary files a/doc/qtcreator/images/qtcreator-language-client-inspector-memory-usage.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-language-client-inspector-memory-usage.webp b/doc/qtcreator/images/qtcreator-language-client-inspector-memory-usage.webp new file mode 100644 index 00000000000..fdefe07e757 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-language-client-inspector-memory-usage.webp differ diff --git a/doc/qtcreator/images/qtcreator-language-server-json.webp b/doc/qtcreator/images/qtcreator-language-server-json.webp new file mode 100644 index 00000000000..0906a8d9969 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-language-server-json.webp differ diff --git a/doc/qtcreator/images/qtcreator-model-editor-component-diagram.webp b/doc/qtcreator/images/qtcreator-model-editor-component-diagram.webp new file mode 100644 index 00000000000..e28a94e0a2a Binary files /dev/null and b/doc/qtcreator/images/qtcreator-model-editor-component-diagram.webp differ diff --git a/doc/qtcreator/images/qtcreator-options-code-style-nim.png b/doc/qtcreator/images/qtcreator-options-code-style-nim.png deleted file mode 100644 index 67427858909..00000000000 Binary files a/doc/qtcreator/images/qtcreator-options-code-style-nim.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-options-code-style-qml.png b/doc/qtcreator/images/qtcreator-options-code-style-qml.png deleted file mode 100644 index 93bf1bdfb8b..00000000000 Binary files a/doc/qtcreator/images/qtcreator-options-code-style-qml.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-preferences-beautifier-general.webp b/doc/qtcreator/images/qtcreator-preferences-beautifier-general.webp index f416df0f347..9fabac2ff14 100644 Binary files a/doc/qtcreator/images/qtcreator-preferences-beautifier-general.webp and b/doc/qtcreator/images/qtcreator-preferences-beautifier-general.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-environment-interface.webp b/doc/qtcreator/images/qtcreator-preferences-environment-interface.webp index a03cb3d5794..3268b10299d 100644 Binary files a/doc/qtcreator/images/qtcreator-preferences-environment-interface.webp and b/doc/qtcreator/images/qtcreator-preferences-environment-interface.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-fakevim-general.webp b/doc/qtcreator/images/qtcreator-preferences-fakevim-general.webp new file mode 100644 index 00000000000..c69a24c0f41 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-fakevim-general.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-nim-code-style.webp b/doc/qtcreator/images/qtcreator-preferences-nim-code-style.webp new file mode 100644 index 00000000000..8fa9bb08376 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-nim-code-style.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-nim-tools.webp b/doc/qtcreator/images/qtcreator-preferences-nim-tools.webp new file mode 100644 index 00000000000..e96ac6f0590 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-nim-tools.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-qtquick-code-style.webp b/doc/qtcreator/images/qtcreator-preferences-qtquick-code-style.webp new file mode 100644 index 00000000000..574f30dd64d Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-qtquick-code-style.webp differ diff --git a/doc/qtcreator/images/qtcreator-preferences-quick-fixes-function-locations.webp b/doc/qtcreator/images/qtcreator-preferences-quick-fixes-function-locations.webp new file mode 100644 index 00000000000..e0a2b5c85b6 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-preferences-quick-fixes-function-locations.webp differ diff --git a/doc/qtcreator/images/qtcreator-project-kits.png b/doc/qtcreator/images/qtcreator-project-kits.png deleted file mode 100644 index 16bf3a0dad0..00000000000 Binary files a/doc/qtcreator/images/qtcreator-project-kits.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-projects-kits.webp b/doc/qtcreator/images/qtcreator-projects-kits.webp index 6f863df9a50..827037b0223 100644 Binary files a/doc/qtcreator/images/qtcreator-projects-kits.webp and b/doc/qtcreator/images/qtcreator-projects-kits.webp differ diff --git a/doc/qtcreator/images/qtcreator-projects-settings-clangd.webp b/doc/qtcreator/images/qtcreator-projects-settings-clangd.webp new file mode 100644 index 00000000000..d49b9403e01 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-projects-settings-clangd.webp differ diff --git a/doc/qtcreator/images/qtcreator-projects-settings-language-server.webp b/doc/qtcreator/images/qtcreator-projects-settings-language-server.webp new file mode 100644 index 00000000000..28dbf53ddd6 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-projects-settings-language-server.webp differ diff --git a/doc/qtcreator/images/qtcreator-projects-vanished-targets.webp b/doc/qtcreator/images/qtcreator-projects-vanished-targets.webp new file mode 100644 index 00000000000..f4acd354b1c Binary files /dev/null and b/doc/qtcreator/images/qtcreator-projects-vanished-targets.webp differ diff --git a/doc/qtcreator/images/qtcreator-python-interpreters.webp b/doc/qtcreator/images/qtcreator-python-interpreters.webp index 901b3427bfe..597b99e720d 100644 Binary files a/doc/qtcreator/images/qtcreator-python-interpreters.webp and b/doc/qtcreator/images/qtcreator-python-interpreters.webp differ diff --git a/doc/qtcreator/images/qtcreator-run-settings-custom-executable.webp b/doc/qtcreator/images/qtcreator-run-settings-custom-executable.webp new file mode 100644 index 00000000000..66dfb298a87 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-run-settings-custom-executable.webp differ diff --git a/doc/qtcreator/images/qtcreator-scxml-editor-state-toolbar.webp b/doc/qtcreator/images/qtcreator-scxml-editor-state-toolbar.webp new file mode 100644 index 00000000000..7be3f366c27 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-scxml-editor-state-toolbar.webp differ diff --git a/doc/qtcreator/images/qtcreator-scxml-editor.png b/doc/qtcreator/images/qtcreator-scxml-editor.png deleted file mode 100644 index c9512046ddf..00000000000 Binary files a/doc/qtcreator/images/qtcreator-scxml-editor.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-scxml-editor.webp b/doc/qtcreator/images/qtcreator-scxml-editor.webp new file mode 100644 index 00000000000..d57a50dfb76 Binary files /dev/null and b/doc/qtcreator/images/qtcreator-scxml-editor.webp differ diff --git a/doc/qtcreator/images/qtquick-designer.webp b/doc/qtcreator/images/qtquick-designer.webp new file mode 100644 index 00000000000..528ff5a26d3 Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer.webp differ diff --git a/doc/qtcreator/images/qtquick-ui-prototype-run-settings.webp b/doc/qtcreator/images/qtquick-ui-prototype-run-settings.webp new file mode 100644 index 00000000000..7f564c475ca Binary files /dev/null and b/doc/qtcreator/images/qtquick-ui-prototype-run-settings.webp differ diff --git a/doc/qtcreator/src/analyze/creator-analyze.qdoc b/doc/qtcreator/src/analyze/creator-analyze.qdoc index f1eb052ea02..7438249701f 100644 --- a/doc/qtcreator/src/analyze/creator-analyze.qdoc +++ b/doc/qtcreator/src/analyze/creator-analyze.qdoc @@ -54,7 +54,7 @@ Detect problems in memory management by using the Memcheck tool and find cache misses in the code by using the Callgrind tool. - \li \l{Using Clang Tools}{Clang Tools} + \li \l{Clang Tools} Detect problems in C, C++, and Objective-C programs by using Clang-Tidy and Clazy. diff --git a/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc b/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc index 804d47f3734..c13e626edc6 100644 --- a/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc +++ b/doc/qtcreator/src/analyze/creator-clang-static-analyzer.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,13 +8,14 @@ // ********************************************************************** /*! - \previouspage creator-running-valgrind-remotely.html \page creator-clang-tools.html - \nextpage creator-heob.html + \previouspage creator-how-tos.html - \title Using Clang Tools + \ingroup creator-how-to-analyze - \QC integrates the following Clang tools for finding problems in C, C++, and + \title Analyze code with Clang-Tidy and Clazy + + \QC comes with the following Clang tools for finding problems in C, C++, and Objective-C source code by using static analysis: \list @@ -34,14 +35,7 @@ the checks, you must create a custom configuration for the Clang tools and enable them for Clang-Tidy. - \QC comes with the Clang tools, so you do not need to set them up separately. - - In addition to running the tools to collect diagnostics, you can select - \inlineimage icons/open.png - to load diagnostics from \l{https://yaml.org/}{YAML} files that you exported - using the \c {-export fixes} option. - - \section1 Running Clang-Tidy and Clazy + \section1 Analyze the current file To run Clang-Tidy or Clazy to analyze the currently open file: @@ -54,6 +48,8 @@ \uicontrol {Analyze Current File with Clazy}. \endlist + \section1 Analyze an open project + To run Clang-Tidy or Clazy to analyze an open project: \list 1 @@ -69,9 +65,12 @@ \endlist + \section1 View diagnostics + The \uicontrol {Clang-Tidy} or \uicontrol {Clazy} view shows the issues: \image qtcreator-clang-tidy-view.webp {Clang-Tidy view} + \caption Diagnostics in the Clang-Tidy view. \note If you select \uicontrol Debug in the mode selector to open the \uicontrol Debug mode and then select \uicontrol {Clang-Tidy} or @@ -91,21 +90,68 @@ \inlineimage icons/refactormarker.png icon, hover the mouse pointer over the line. + Select the \inlineimage icons/settings.png + button to customize diagnostics for the current project. + + \section1 Disable checks + To disable checks of a particular type either globally or for a particular project, select \uicontrol {Disable This Check} or \uicontrol {Disable These Checks} in the context menu. - Select the \inlineimage icons/settings.png - button to customize Clang diagnostics for the current project. + \section1 Load diagnostics from YAML files - \image qtcreator-clang-tools-settings.webp {Clang Tools customized settings} + In addition to running the tools to collect diagnostics, you can select + \inlineimage icons/open.png + to load diagnostics from \l{https://yaml.org/}{YAML} files that you exported + using the \c {-export fixes} option. + + \sa {Configure Clang Diagnostics}, {Speficy Clang tools settings}, + {Clang Tools} +*/ + +/*! + \page creator-how-to-override-clang-tools-preferences.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects-configure + + \title Speficy Clang tools settings + + To set Clang-Tidy and Clazy checks to run for the current project: + + \list 1 + \li Select \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {Clang Tools}. + \image qtcreator-clang-tools-settings.webp {Clang Tools customized settings} + \li Deselect \uicontrol {Use global settings}. + \li Specify \uicontrol preferences for the project. + \li In \uicontrol {Suppressed diagnostics}, you can view the suppression + list for a project and to remove diagnostics from it. + \endlist To restore the global settings, select \uicontrol {Restore Global Settings}. To view and modify the global settings, select the link in - \uicontrol {Use global settings}. To open the Clang static analyzer, - select \uicontrol {Go to Analyzer}. + \uicontrol {Use global settings}. - \section1 Configuring Clang Tools + To open the \uicontrol Clang-Tidy view, select \uicontrol {Go to Clang-Tidy}. + To open the \uicontrol Clazy view, select \uicontrol {Go to Clazy}. + + \sa {Configure Clang diagnostics}, {Analyze code with Clang-Tidy and Clazy}, {Clang Tools} +*/ + +/*! + \page creator-preferences-analyzer-clang-tools.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences-analyzer + + \title Clang Tools + + \brief Set preferences for Clang-Tidy and Clazy. + + Detect problems in C, C++, and Objective-C programs with Clang-Tidy + and Clazy. To configure Clang diagnostics globally for Clang tools: @@ -119,6 +165,14 @@ \li In the \uicontrol Clang-Tidy and \uicontrol Clazy-Standalone fields, set the paths to the executables to use. + \li The \uicontrol {Diagnostic configuration} field shows the + checks to perform. Click the value of the field to open the + \uicontrol {Diagnostic Configurations} dialog, where you can + select and edit the checks to perform. + + To perform checks from a Clang-Tidy configuration file instead, + select \uicontrol {Prefer .clang-tidy file, if present}. + \li To build the project before running the Clang tools, select the \uicontrol {Build the project before analysis} check box. The Clang tools do not require that you build the project before analysis, but @@ -132,6 +186,31 @@ \li In the \uicontrol {Parallel jobs} field, select the number of jobs to run in parallel to make the analysis faster on multi-core processors. + \endlist + + \sa {Configure Clang diagnostics}, {Analyze code with Clang-Tidy and Clazy}, + {Speficy Clang tools settings} +*/ + +/*! + \page creator-how-to-configure-clang-diagnostics.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-analyze + + \title Configure Clang diagnostics + + Detect problems in C, C++, and Objective-C programs with Clang-Tidy + and Clazy. + + To select and edit the Clang checks to perform: + + \list 1 + + \li Select \preferences > \uicontrol Analyzer > + \uicontrol {Clang Tools}. + + \image qtcreator-preferences-analyzer-clang-tools.webp {Clang Tools preferences} \li The \uicontrol {Diagnostic configuration} field shows the checks to perform. Click the value of the field to open the @@ -140,7 +219,7 @@ \image qtcreator-clang-tools-diagnostics-configuration.png {Diagnostics Configuration dialog} - To perform checks from a Clang Tidy configuration file instead, + To perform checks from a Clang-Tidy configuration file instead, select \uicontrol {Prefer .clang-tidy file, if present} in the \uicontrol {Clang Tools} tab. @@ -188,6 +267,8 @@ \endlist + \section2 Suppressing Diagnostics + To suppress diagnostics, select \uicontrol {Suppress This Diagnostic} in the context menu. To view the suppression list for a project and to remove diagnostics from it, select \uicontrol Projects > @@ -225,4 +306,6 @@ To add more checks using \QC later on, copy the checks from your .clang-tidy file into the \uicontrol {Edit Checks as String} field, select additional checks, and copy-paste the contents of the field to the .clang-tidy file. + + \sa {Analyze code with Clang-Tidy and Clazy}, {Speficy Clang tools settings}, {Clang Tools} */ diff --git a/doc/qtcreator/src/analyze/creator-coco.qdoc b/doc/qtcreator/src/analyze/creator-coco.qdoc index 7dcc9a29397..341db9fc096 100644 --- a/doc/qtcreator/src/analyze/creator-coco.qdoc +++ b/doc/qtcreator/src/analyze/creator-coco.qdoc @@ -85,5 +85,5 @@ \li Implicit Manual Coverage Validation \endlist - \sa {Enable and disable plugins}, {Specifying Text Editor Settings} + \sa {Enable and disable plugins}, {Font & Colors} */ diff --git a/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc b/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc index bd3d21f7516..61aca06cfd2 100644 --- a/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc +++ b/doc/qtcreator/src/analyze/creator-valgrind-overview.qdoc @@ -50,4 +50,5 @@ \endlist + \sa {Specify Valgrind settings for a project} */ diff --git a/doc/qtcreator/src/android/androiddev.qdoc b/doc/qtcreator/src/android/androiddev.qdoc index c16c80d4e70..69947c4fc03 100644 --- a/doc/qtcreator/src/android/androiddev.qdoc +++ b/doc/qtcreator/src/android/androiddev.qdoc @@ -19,7 +19,7 @@ To enable helpful code editing features for Java, such as code completion, highlighting, function tooltips, and navigating in code, add a - \l{Java Language Server}{Java language server}. + \l{Add a Java language server}{Java language server}. \QC integrates the Android Debug Bridge (\c adb) command-line tool for deploying applications to Android devices, running them, and reading their diff --git a/doc/qtcreator/src/android/creator-projects-settings-run-android.qdocinc b/doc/qtcreator/src/android/creator-projects-settings-run-android.qdoc similarity index 62% rename from doc/qtcreator/src/android/creator-projects-settings-run-android.qdocinc rename to doc/qtcreator/src/android/creator-projects-settings-run-android.qdoc index 6d0b5cc17ad..8904f697850 100644 --- a/doc/qtcreator/src/android/creator-projects-settings-run-android.qdocinc +++ b/doc/qtcreator/src/android/creator-projects-settings-run-android.qdoc @@ -1,16 +1,27 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! -//! [run settings android] + \page creator-run-settings-android.html + \previouspage creator-reference.html - \section1 Specifying Run Settings for Android Devices + \ingroup creator-reference-run-configurations + + \title Android Run Settings + + \brief Settings for running applications on Android devices. + + Specify settings for running applications on the \l {kits-tab}{Run device} that + you select for a kit in \uicontrol Projects > \uicontrol {Build & Run} > + \uicontrol Run > \uicontrol {Run Settings}. To run and debug an application on an Android device, you must create connections from the development host to the device, as instructed in \l {Connecting Android Devices}. - A default set of Android Activity manager (am) start options is applied when + \section1 am Start Options + + \QC applies a default set of Android Activity manager (am) start options when starting applications. You can specify additional start options in the \uicontrol {Activity manager start arguments} field. However, if the default options conflict with the added options, the application might not start. @@ -30,10 +41,12 @@ For example, to run the application as a particular user, enter the start option \c {--user 10}, where \c 10 is the user ID of the user account. - \image qtcreator-android-run-settings.png + \image qtcreator-android-run-settings.png {Run Settings for an Android device} - You can specify shell commands to run before the application is started - and after it is quit. For example, enter the following commands into + \section1 Shell Commands + + You can specify shell commands to run before the application starts + and after it quits. For example, enter the following commands into \uicontrol{Pre-launch on-device shell commands} to unlock the screen and to switch to the user account \c 10 on the device before running the application: @@ -52,5 +65,6 @@ input keyevent 82 \endcode -//! [run settings android] + \sa {Activate kits for a project}, {Configure projects for running}, + {Connecting Android Devices} */ diff --git a/doc/qtcreator/src/android/deploying-android.qdoc b/doc/qtcreator/src/android/deploying-android.qdoc index 0e1c2e7fde7..2926d7739bd 100644 --- a/doc/qtcreator/src/android/deploying-android.qdoc +++ b/doc/qtcreator/src/android/deploying-android.qdoc @@ -36,7 +36,7 @@ \uicontrol {Build Android APK} > \uicontrol Details. For more information about options that you have for running applications, - see \l {Specifying Run Settings for Android Devices}. + see \l {Android Run Settings}. \section1 Packaging Applications @@ -65,7 +65,7 @@ \uicontrol Manage. For more information about specifying additional start options for - applications, see \l{Specifying Run Settings for Android Devices}. + applications, see \l{Android Run Settings}. To remove previously installed files from the device, select \uicontrol {Uninstall the existing app before deployment}. diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc index 0ac1ae4ba96..90ffd7cd809 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-building.qdoc @@ -2,19 +2,26 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-build-settings.html \page creator-build-settings-cmake.html - \nextpage creator-build-settings-cmake-presets.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-configurations \title CMake Build Configuration + \brief Settings for building applications with CMake. + + Specify build settings for the selected \l{glossary-buildandrun-kit}{kit} in + \uicontrol Projects > \uicontrol {Build & Run} > \uicontrol Build > + \uicontrol {Build Settings}. + Configuring medium-sized to large CMake projects in \QC can be a challenge due to the number of variables that you need to pass to CMake to configure the project correctly. To make this easier, \QC creates an initial configuration for you based on the kit settings and displays it in \uicontrol {Initial Configuration} in - the \l{Specifying Build Settings}{Build Settings} of the project. - Alternatively, you can use CMake presets to configure CMake. + the \uicontrol {Build Settings} of the project. + Or, you can use CMake presets to configure CMake. The \uicontrol Configure field displays the effective CMake call that \QC constructs using the values of the \uicontrol {Build directory} and @@ -243,8 +250,8 @@ \section1 Using CMake with Conan - \QC can automatically set up the \l {Setting Up Conan} - {Conan package manager} for use with CMake. + \QC can automatically set up the \l {Conan Package Manager} for use with + CMake. Select \preferences > \uicontrol CMake \uicontrol General > \uicontrol {Package manager auto setup} to set the @@ -267,4 +274,7 @@ \image qtcreator-cmake-clean-steps.webp {CMake clean steps} The build errors and warnings are parsed and displayed in \l Issues. + + \sa {Activate kits for a project}, {Configure projects for building}, + {Configure projects for running}, {Open projects}, {CMake} */ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc index 3a51034199e..050b0b1f8c7 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake-presets.qdoc @@ -2,12 +2,15 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-build-settings-cmake.html \page creator-build-settings-cmake-presets.html - \nextpage creator-build-settings-qmake.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-configurations \title CMake Presets + \brief Examples of supported CMake presets. + \c CMakePresets.json has options for project-wide builds, whereas \c CMakeUserPresets.json has options for your local builds. @@ -224,4 +227,6 @@ ] } \endcode + + \sa {CMake Build Configuration}, {CMake} */ diff --git a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc index 3d2babbc53c..f4abbfa86ee 100644 --- a/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc +++ b/doc/qtcreator/src/cmake/creator-projects-cmake.qdoc @@ -37,20 +37,20 @@ \list \li For CMake version 3.5 or later, generate a \l{CMake: CMAKE_EXPORT_COMPILE_COMMANDS}{compilation database} and - open that in \QC, as described in \l{Using Compilation Databases}. + open that in \QC, as described in \l{Use compilation databases}. \li Create an ad-hoc project file for a qmake build using \c{qmake -project} and \l{Open projects}{open} that in \QC. Typically, you cannot compile such projects without manual changes. \li Manually create an ad-hoc project file for a - \l{Setting Up a Generic Project}{generic project} and + \l{Import an existing project}{generic project} and open that in \QC. Typically, you cannot compile such projects without manual changes. \endlist - \sa {Build with CMake}{How To: Build with CMake}, {Open projects}, - {CMake Build Configuration}, {Debug CMake project files}, - {Specifying Build Settings}, {Specifying Run Settings}, - {Deploying to Remote Linux} + \sa {Build with CMake}{How To: Build with CMake}, {CMake Build Configuration}, + {Configure projects for building}, {Configure projects for running}, + {Debug CMake project files}, {Deploying to Remote Linux}, {Open projects}, + {Use compilation databases} */ /*! @@ -183,7 +183,7 @@ \image qtcreator-kits-cmake.png {Kits preferences} - \sa {CMake}, {Add kits}, {Kits} + \sa {CMake}, {Add kits}, {kits-tab}{Kits} */ /*! @@ -235,7 +235,7 @@ Warnings and errors are displayed in \l {Issues}. \sa {CMake}, {Add libraries to CMake projects}, {Complete CMake code}, - {Completing Code Snippets}, {Format CMake files} + {Format CMake files}, {Completion}, {Snippets} */ /*! @@ -260,8 +260,10 @@ \li \c{$ENV} for environment variables \endlist - \sa {CMake}, {Completing Code}, {Completing Code Snippets}, - {Edit CMake configuration files} + Press \key Tab or \key Enter to accept the selected suggestion and complete + the code. + + \sa {CMake}, {Edit CMake configuration files}, {Completion}, {Snippets} */ /*! @@ -286,17 +288,17 @@ \c {cmake-format.exe}. \li Select \uicontrol {Automatic formatting on file save} to automatically format CMake files when you save them. - \li In \uicontrol {Restrict to MIME types}, add the \l{Editing MIME Types} - {MIME types} of the files to format, separated by semicolons. The - default value, \c {text/x-cmake} formats CMake files. If the field is - empty, all files are formatted. + \li In \uicontrol {Restrict to MIME types}, add the MIME types of the + files to format, separated by semicolons. The default value, + \c {text/x-cmake} formats CMake files. If the field is empty, all + files are formatted. \li Select the \uicontrol {Restrict to files contained in the current project} check box to only format CMake files that belong to the current project. \endlist \sa {CMake},{Complete CMake code}, {Edit CMake configuration files}, - {Editing MIME Types} + {Edit MIME types} */ /*! @@ -364,7 +366,7 @@ For CMake projects that have external dependencies, use \l{CMake: Find Modules}{Find.cmake} modules that expose imported targets. You can use the pre-defined \c sample_find_module - \l{Completing Code Snippets}{code snippet} to add sample commands + \l{Snippets}{code snippet} to add sample commands to a \c .cmake file. You can then change the commands as necessary. Place Find modules in the \c ${CMAKE_CURRENT_SOURCE_DIR}/cmake directory, and @@ -376,5 +378,5 @@ \endcode \sa {CMake}, {Edit CMake configuration files}, {Complete CMake code}, - {Completing Code Snippets} + {Completion}, {Snippets} */ diff --git a/doc/qtcreator/src/conan/creator-projects-conan-building.qdoc b/doc/qtcreator/src/conan/creator-projects-conan-building.qdoc index a82f1d14be2..55f71c40d05 100644 --- a/doc/qtcreator/src/conan/creator-projects-conan-building.qdoc +++ b/doc/qtcreator/src/conan/creator-projects-conan-building.qdoc @@ -2,22 +2,23 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-build-settings-incredibuild.html \page creator-build-settings-conan.html - \nextpage creator-run-settings.html + \previouspage creator-reference.html + + \ingroup creator-reference-build-configurations \title Conan Build Configuration - You can specify build steps for Conan. + \brief Settings for building applications with the Conan package manager. - For more information about configuring Conan, see \l{Setting Up Conan}. - - \section1 Conan Build Steps + Specify build settings for the selected \l{glossary-buildandrun-kit}{kit} in + \uicontrol Projects > \uicontrol {Build & Run} > \uicontrol Build > + \uicontrol {Build Settings}. To configure a project to be built using the Conan package manager, select \uicontrol {Add Build Step} > \uicontrol {Run Conan Install}. - \image qtcreator-build-steps-conan-install.png "Conan Install build step" + \image qtcreator-build-steps-conan-install.png {Conan Install build step} In the \uicontrol {Conan file} field, enter the location of the \e conanfile.txt file for the project. @@ -28,4 +29,6 @@ Select \uicontrol {Build missing} to build packages from source if binary packages are not found. + + \sa {Conan Package Manager} */ diff --git a/doc/qtcreator/src/conan/creator-projects-conan.qdoc b/doc/qtcreator/src/conan/creator-projects-conan.qdoc index 3136e2a5888..0e1f60e664b 100644 --- a/doc/qtcreator/src/conan/creator-projects-conan.qdoc +++ b/doc/qtcreator/src/conan/creator-projects-conan.qdoc @@ -7,7 +7,7 @@ \ingroup creator-reference-build-systems - \title Setting Up Conan + \title Conan Package Manager \brief The experimental Conan plugin integrates the Conan package manager. @@ -43,10 +43,10 @@ {conanfile.txt} file that specifies the needed libraries and packages. Then, you must edit the build settings of the project to specify the location of the file and the contents of the Conan install command. - For more information, see \l {Conan Build Steps}. Alternatively, you can automatically set up the Conan package manager for - use with CMake. For more information, see \l{Using CMake with Conan}. + use with CMake. - \sa {Enable and disable plugins} + \sa {Conan Build Configuration}, {Enable and disable plugins}, + {Using CMake with Conan} */ diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc index 39fd8013715..53780c96a5d 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger-setup.qdoc @@ -16,7 +16,7 @@ \title Setting Up Debugger The main debugger preferences are associated with the - \l{Kits}{kit} you build and run your project with. To + \l{kits-tab}{kit} you build and run your project with. To specify the debugger and compiler to use for each kit, select \preferences > \uicontrol Kits. diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index a39e561badd..101bd3a1889 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -674,7 +674,7 @@ \row \li Editor \li Open the current source file in the text editor for changing it. - \li \l {Working in Edit Mode} + \li \l {Edit Mode} \endtable \note The \uicontrol Views menu shows some views only while you are @@ -696,9 +696,6 @@ \uicontrol View > \uicontrol Views > \uicontrol {Reset to Default Layout} to reset the views to their original sizes and positions. - To save space on the screen, select \uicontrol View > \uicontrol Views > - \uicontrol {Automatically Hide View Titlebars}. - To show and hide columns in views, toggle \uicontrol {Show Column} in the context menu. diff --git a/doc/qtcreator/src/debugger/qtquick-debugging.qdoc b/doc/qtcreator/src/debugger/qtquick-debugging.qdoc index 56cefd70e62..a9d297419cd 100644 --- a/doc/qtcreator/src/debugger/qtquick-debugging.qdoc +++ b/doc/qtcreator/src/debugger/qtquick-debugging.qdoc @@ -36,8 +36,8 @@ \if defined(qtcreator) The process of setting up debugging for Qt Quick projects depends on the - \l{Creating Qt Quick Projects}{type of the project}: Qt Quick UI or Qt Quick - Application, and the Qt version used. + \e type of the project: \uicontrol {Qt Quick UI Prototype} or + \uicontrol {Qt Quick Application}, and the Qt version. \section2 Debugging Qt Quick UI Projects \endif diff --git a/doc/qtcreator/src/docker/creator-docker.qdoc b/doc/qtcreator/src/docker/creator-docker.qdoc index ae1dced8cea..15f147d475c 100644 --- a/doc/qtcreator/src/docker/creator-docker.qdoc +++ b/doc/qtcreator/src/docker/creator-docker.qdoc @@ -18,7 +18,7 @@ To build, run, and debug applications on Docker devices, you must install and configure \c docker-cli on the development host. \QC automatically detects - \l{Kits}{build and run kit} items, such \l{Add debuggers} + \l{kits-tab}{build and run kit} items, such \l{Add debuggers} {debuggers} and \l{Add Qt versions}{Qt versions}, in the Docker container and creates kits for the devices. diff --git a/doc/qtcreator/src/editors/creator-code-completion.qdoc b/doc/qtcreator/src/editors/creator-code-completion.qdoc index e608400f35d..4281f77b672 100644 --- a/doc/qtcreator/src/editors/creator-code-completion.qdoc +++ b/doc/qtcreator/src/editors/creator-code-completion.qdoc @@ -1,64 +1,36 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-checking-code-syntax.html \page creator-completing-code.html - \nextpage creator-indenting-code.html + \if defined(qtdesignstudio) + \previouspage creator-editor-functions.html + \else + \previouspage creator-how-tos.html + \endif - \title Completing Code + \ingroup creator-how-to-edit + + \title Complete code As you write code, \QC suggests properties, IDs, and code snippets to complete the code. It shows a list of suggestions to - the statement currently under your cursor. Press \key Tab - or \key Enter to accept the selected suggestion and complete the code. + the statement currently under your cursor. + + Press \key Tab or \key Enter to accept the selected suggestion and complete + the code. \if defined(qtcreator) - The following image displays suggestions for completing C++ code: - \image qtcreator-codecompletion.png + \caption Suggestions for completing C++ code. \endif - The following image displays suggestions for completing QML code: - \image qml-code-completion.png + \caption Suggestions for completing QML code. To open the list of suggestions at any time, press \key {Ctrl+Space}. If only one option is available, \QC inserts it automatically. - \section1 Specifying Completion Settings - - To specify settings for code completion, select \preferences > - \uicontrol {Text Editor} > \uicontrol Completion. - - \image qtcreator-preferences-texteditor-completion.webp "Text Editor Completion preferences" - - By default, code completion does not consider case. To apply full or - first-letter case-sensitivity, select \uicontrol Full or - \uicontrol {First Letter} in the \uicontrol {Case-sensitivity} field. - - By default, code completion is always invoked, but you can change this - behavior in the \uicontrol {Activate completion} field to invoke - it \uicontrol Manually or \uicontrol {When Triggered}. - - You can set a timeout in milliseconds for code completion in the - \uicontrol {Timeout in ms} field. - - In the \uicontrol {Character threshold} field, specify the number of - characters you need to enter before code completion is triggered. - - When completion is invoked manually, \QC completes the common prefix of the - list of suggestions. This is especially useful for classes with several - similarly named members. To disable this functionality, deselect the - \uicontrol {Autocomplete common prefix} check box. - - Select the \uicontrol {Automatically split strings} check box to split - a string to two lines by adding an end quote at the cursor position when - you press \key Enter and a start quote at the beginning of the next line, - before the rest of the string. In addition, pressing \key {Shift+Enter} - inserts an escape character at the cursor position and moves the rest of - the string to the next line. - \section1 Summary of Available Types The following table lists available types for code completion and icon used @@ -131,7 +103,7 @@ \endif \endtable - \section1 Completing Code Snippets + \section1 Complete code snippets Code snippets can consist of multiple variables that you specify values for. Select an item in the list and press \key Tab or \key Enter to complete the @@ -140,71 +112,128 @@ within the snippet are renamed. \if defined(qtcreator) - The following image shows a C++ code snippet: - \image qmldesigner-code-completion.png "Completing C++ code" + \caption C++ code snippet. \endif - The following image shows a QML code snippet: - \image qml-code-snippet.png - - \section2 Editing Code Snippets - - Code snippets specify code constructs. You can add, modify, - and remove snippets in the snippet editor. To open the editor, select - \preferences > \uicontrol {Text Editor} > - \uicontrol Snippets. + \caption QML code snippet. \if defined(qtcreator) - The following image shows built-in C++ code snippets: - - \image qtcreator-edit-code-snippets.png "C++ snippet preferences" + \sa {Complete CMake code}, {Nim} \endif - The following image shows built-in QML code snippets: + \sa {Add code snippets to the auto-complete menu}, {Completion}, {Snippets} +*/ - \image qml-snippet-editor.png +/*! + \page creator-preferences-text-editor-completion.html + \if defined(qtdesignstudio) + \previouspage creator-completing-code.html + \else + \previouspage creator-reference.html + \endif + + \ingroup creator-reference-preferences-text-editor + + \title Completion + + \brief Set preferences for code completion and inserting matching characters + in the text editor. + + To set preferences for code completion, select \preferences > + \uicontrol {Text Editor} > \uicontrol Completion. + + \image qtcreator-preferences-texteditor-completion.webp {Text Editor Completion preferences} + + \section1 Code Completion Behavior + + By default, code completion does not consider case. To apply full or + first-letter case-sensitivity, select \uicontrol Full or + \uicontrol {First Letter} in the \uicontrol {Case-sensitivity} field. + + By default, code completion is always invoked, but you can change this + behavior in the \uicontrol {Activate completion} field to invoke + it \uicontrol Manually or \uicontrol {When Triggered}. + + You can set a timeout in milliseconds for code completion in the + \uicontrol {Timeout in ms} field. + + In the \uicontrol {Character threshold} field, specify the number of + characters you need to enter before code completion is triggered. + + When completion is invoked manually, \QC completes the common prefix of the + list of suggestions. This is especially useful for classes with several + similarly named members. To disable this functionality, deselect the + \uicontrol {Autocomplete common prefix} check box. + + Select the \uicontrol {Automatically split strings} check box to split + a string to two lines by adding an end quote at the cursor position when + you press \key Enter and a start quote at the beginning of the next line, + before the rest of the string. In addition, pressing \key {Shift+Enter} + inserts an escape character at the cursor position and moves the rest of + the string to the next line. + + \section1 Automatically Inserting Matching Characters + + When you have selected code and enter brackets or quotes, the matching + closing character is added automatically at the end of the selection. + + By default, the automatically inserted text is highlighted and animated, + skipped when you type, and removed when you press \key Backspace. + + \if defined(qtcreator) + \sa {Complete CMake code}, {Enclose code in brackets or quotes}, {Nim} + \endif + + \sa {Complete code}, {Snippets} +*/ + +/*! + \page creator-preferences-text-editor-shippets.html + \if defined(qtdesignstudio) + \previouspage creator-completing-code.html + \else + \previouspage creator-reference.html + \endif + + \ingroup creator-reference-preferences-text-editor + + \title Snippets + + \brief Add, change, and remove snippets in the snippet editor. + + To add, change, and remove snippets in the snippet editor, select + \preferences > \uicontrol {Text Editor} > \uicontrol Snippets. \QC has built-in snippets in the following categories: \list - \li Text snippets, which can have any text string. For example, code comments - \if defined(qtcreator) \li C++ code snippets, which specify C++ code constructs - \li CMake code snippets that you can use when editing \c CMakeLists.txt files in the CMake editor \endif - \li QML code snippets, which specify QML code constructs - \if defined(qtcreator) \li Nim code snippets, which specify Nim code constructs \endif - \endlist - \section2 Adding and Editing Snippets - - Select a snippet in the list to edit it in the snippet editor. To add a new - snippet, select \uicontrol Add. Specify a trigger and, if the trigger is - already in use, an optional variant, which appear in the list of suggestions - when you write code. \if defined(qtcreator) - Also specify a text string or C++ or QML code construct - in the snippet editor, depending on the snippet category. - - You can use \l{Use Qt Creator variables}{predefined variables} in - snippets. - \else - Also specify a text string or QML code in the snippet editor, depending on - the snippet category. + \image qtcreator-edit-code-snippets.png {C++ snippet preferences} + \caption Built-in C++ code snippets. \endif + \image qml-snippet-editor.png + \caption Built-in QML code snippets. + + \section1 Editing Snippets + + Select a snippet in the list to edit it in the snippet editor. + The snippet editor offers: \list @@ -270,7 +299,7 @@ To discard the changes you made to a built-in snippet, select \uicontrol {Revert Built-in}. - \section2 Removing Snippets + \section1 Removing Snippets The list of suggestions might show several similar built-in snippets for different use cases. To make it shorter when you write code, remove the @@ -281,7 +310,7 @@ \uicontrol Remove. To restore the removed snippets, select \uicontrol {Restore Removed Built-ins}. - \section2 Resetting Snippets + \section1 Resetting Snippets To remove all added snippets and to restore all removed snippets, select \uicontrol {Reset All}. @@ -290,16 +319,50 @@ lose all your own snippets. \if defined(qtcreator) - \section1 Completing Nim Code - - You can use the \l{https://nim-lang.org/docs/nimsuggest.html}{Nimsuggest} - tool to query \c {.nim} source files and obtain suggestions for code - completion. - - To use Nimsuggest, you must install it on the development PC. Then select - \preferences > \uicontrol Nim > \uicontrol Tools, - and enter the path to the tool executable in the \uicontrol Path field. - - \sa {Document code}, {Use Qt Creator variables} + \sa {Complete CMake code}, {Document code}, {Use Qt Creator variables}, + {Nim} \endif + + \sa {Add code snippets to the auto-complete menu}, {Complete code}, + {Completion} +*/ + +/*! + \page creator-how-to-add-code-snippets.html + \if defined(qtdesignstudio) + \previouspage creator-completing-code.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-configure-editors + + \title Add code snippets to the auto-complete menu + + To add code or text snippets in the snippet editor: + + \list 1 + \li Select \preferences > \uicontrol {Text Editor} > \uicontrol Snippets. + \image qtcreator-snippet-modifiers.png {Snippets preferences} + \li In \uicontrol Group, select the type of snippet to add. + \li Select \uicontrol Add. + \li Specify a trigger. If the trigger is already in use, add an optional + variant. They appear in the list of suggestions when you write code. + \if defined(qtcreator) + Also specify a text string or C++ or QML code construct + in the snippet editor, depending on the snippet category. + + You can use \l{Use Qt Creator variables}{predefined variables} in + snippets. + \else + Also specify a text string or QML code in the snippet editor, depending on + the snippet category. + \endif + \endlist + + \if defined(qtcreator) + \sa {Complete CMake code}, {Complete code}, {Use Qt Creator variables}, + {Nim} + \endif + \sa {Completion}, {Snippets} */ diff --git a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc index 285ab394799..eab5601c25f 100644 --- a/doc/qtcreator/src/editors/creator-code-refactoring.qdoc +++ b/doc/qtcreator/src/editors/creator-code-refactoring.qdoc @@ -1,13 +1,18 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \page creator-editor-refactoring.html \previouspage creator-jump-to-the-code.html - \nextpage creator-editor-quick-fixes.html + \nextpage creator-editor-options.html \title Refactoring + \e {Code refactoring} is the process of improving and simplifying code + without modifying the existing functionality of an application. You + can easily find and rename symbols and apply predefined actions to + refactor code. + Refactor code to: \list @@ -17,9 +22,8 @@ \li Simplify code structure \endlist - \QC allows you to quickly and conveniently apply actions to refactor your - code by selecting them in a context menu. For more information, see - \l{Applying Refactoring Actions}. + To quickly and conveniently apply actions to refactor your + code, \l{Apply quick fixes}{select quick fixes in a context menu}. By default, the refactored files are saved automatically. To disable this feature, deselect \preferences > \uicontrol Environment > @@ -33,13 +37,13 @@ \uicontrol {C++} > \uicontrol {Find References to Symbol Under Cursor} or press \key {Ctrl+Shift+U}. - \image qtcreator-find-references-to-symbol-under-cursor.png "Search results for finding references to symbols" + \image qtcreator-find-references-to-symbol-under-cursor.png {Search results for finding references to symbols} To view the same results color-coded according to the access type, such as read, write, or declaration, select \uicontrol Tools > \uicontrol {C++} > \uicontrol {Find References with Access Type}. - \note You can also select \uicontrol Edit > \uicontrol {Find/Replace} > + \note Select \uicontrol Edit > \uicontrol {Find/Replace} > \uicontrol {Advanced Find} > \uicontrol {C++ Symbols} to search for classes, functions, enums, and declarations (including type aliases) either from files listed as part of the project or from all files that are used by @@ -76,7 +80,7 @@ \image qml-find-usages.png \endif - You can browse the search results in the following ways: + Browse the search results in the following ways: \list \li To go directly to an instance, double-click the instance in @@ -138,7 +142,12 @@ box to also change the filenames that match the class name. \note Renaming local symbols does not open \uicontrol {Search Results}. - The instances of the symbol are highlighted in code and you can edit + The instances of the symbol are highlighted in code, and you can edit the symbol. All instances of the local symbol are changed as you type. + + \sa {Specify settings for quick fixes}, {Quick Fixes}, {C++ Quick Fixes} + \endif - */ + + \sa {Apply quick fixes}, {QML Quick Fixes} +*/ diff --git a/doc/qtcreator/src/editors/creator-code-syntax.qdoc b/doc/qtcreator/src/editors/creator-code-syntax.qdoc index ad86edbf2d9..636a9006017 100644 --- a/doc/qtcreator/src/editors/creator-code-syntax.qdoc +++ b/doc/qtcreator/src/editors/creator-code-syntax.qdoc @@ -34,7 +34,7 @@ You can use the icons in the tooltip popup to copy the error or warning message to the clipboard, to hide messages of a particular type, - or to \l{Configuring clangd}{change the diagnostics settings}. Select + or to \l{Clangd}{change the diagnostics settings}. Select the \uicontrol {Annotation Settings} link to specify the position of the line annotations. @@ -662,7 +662,7 @@ \li M325 \li Warning \li Logical value does not depend on actual values - \li + \li Removed: This warning is no longer being used since Qt Creator version 12. \row \li M326 @@ -712,7 +712,9 @@ \uicontrol {Disable messages for non Qt Quick UI}. You cannot enable messages just for non-Qt Quick UI files. - \sa {QML Language Server} + \if defined(qtcreator) + \sa {Turn on QML language server} + \endif \section1 Resetting the Code Model diff --git a/doc/qtcreator/src/editors/creator-coding.qdoc b/doc/qtcreator/src/editors/creator-coding.qdoc index b74b3b627da..67f8b6ac44d 100644 --- a/doc/qtcreator/src/editors/creator-coding.qdoc +++ b/doc/qtcreator/src/editors/creator-coding.qdoc @@ -50,14 +50,6 @@ can easily find and rename symbols and apply predefined actions to refactor code. - \if defined(qtcreator) - \li \l{Beautifying Source Code} - - Beautifying code means applying indentation and style to source - code files. You can use the Artistic Style, ClangFormat, or - Uncrustify tool to format source files. - \endif - \li \l{Configuring the Editor} You can change the fonts, colors, highlighting, and indentation. @@ -69,48 +61,6 @@ \endlist \if defined(qtcreator) - \section1 Related Topics - - \list - - \li \l{Editing Markdown Files} - - Edit and preview markdown (.md) files. - - \li \l{Using Language Servers} - - The language client offers code completion, highlighting of the - symbol under cursor, and jumping to the symbol definition for other - programming languages besides C++. In addition, it integrates - diagnostics from the language server. - - \li \l {Using GitHub Copilot} - - The Copilot plugin (disabled by default) integrates - \l{https://github.com/features/copilot}{GitHub Copilot} into \QC. - You can view suggestions from Copilot in the code editor. - - \li \l{Editing MIME Types} - - \QC uses the MIME type of a file to determine which mode and editor - to use for opening the file. If your files do not match the - predefined MIME types, you can edit the MIME types. - - \li \l{Modeling} - - You can use the model editor to create Universal Modeling Language - (UML) style models with structured and behavioral diagrams that - show your system in many ways and store them in XML format. - - \li \l{Editing State Charts} - - You can use \QC to create applications that embed state machines. A - project wizard creates \l{https://www.w3.org/TR/scxml/} - {State Chart XML (SCXML)} files with boilerplate code that you can - edit using an SCXML editor. You can use the classes in - the Qt SCXML module to embed state machines created from the files - in Qt applications. - - \endlist + \sa {Using GitHub Copilot} \endif */ diff --git a/doc/qtcreator/src/editors/creator-diff-editor.qdoc b/doc/qtcreator/src/editors/creator-diff-editor.qdoc index 92e25c5dcac..dfeb7f5b4ac 100644 --- a/doc/qtcreator/src/editors/creator-diff-editor.qdoc +++ b/doc/qtcreator/src/editors/creator-diff-editor.qdoc @@ -55,7 +55,7 @@ If \QC cannot detect the encoding of the files to compare, an info bar appears that displays the option to reload the document using some other - encoding. For more information, see \l {File Encoding}. + encoding. For more information, see \l {Change text encoding}. \section1 Viewing the Changes diff --git a/doc/qtcreator/src/editors/creator-editors-options-text.qdoc b/doc/qtcreator/src/editors/creator-editors-options-text.qdoc index a9352a5bc36..33c2d02160f 100644 --- a/doc/qtcreator/src/editors/creator-editors-options-text.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options-text.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,27 +8,27 @@ // ********************************************************************** /*! - \page creator-editor-options-text.html - \previouspage creator-editor-options.html + \page creator-preferences-text-editor-font-colors.html \if defined(qtdesignstudio) + \previouspage creator-editor-options.html \nextpage studio-debugging.html \else - \nextpage creator-editor-fakevim.html + \previouspage creator-reference.html \endif - \if defined(qtdesignstudio) - \title Specifying Code View Settings - \else - \title Specifying Text Editor Settings - \endif + \ingroup creator-reference-preferences-text-editor - Set the font preferences and apply color schemes for syntax highlighting, - diff editor, and code analysis results in \preferences > + \title Font & Colors + + \brief Set the font preferences and apply color schemes for syntax + highlighting, diff editor, and code analysis results. + + To set editor font and colors, select \preferences > \uicontrol {Text Editor} > \uicontrol {Font & Colors}. - \image qtcreator-font-colors.png "Text editor preferences" + \image qtcreator-font-colors.png {Font & Colors tab in Text Editor preferences} - \section2 Configuring Fonts + \section1 Configuring Fonts You can select the font family and size. You can specify a zoom setting in percentage for viewing the text. You can also zoom in or out by pressing @@ -44,17 +44,33 @@ on the screen. Deselect the \uicontrol Antialias check box to turn off antialiasing. - \section2 Defining Color Schemes + \sa {Behavior}, {Change editor colors} +*/ - You can select one of the predefined color schemes or create customized - color schemes. +/*! + \page creator-how-to-change-editor-colors.html + \if defined(qtdesignstudio) + \previouspage creator-editor-options.html + \nextpage studio-debugging.html + \else + \previouspage creator-how-tos.html + \endif + + \ingroup creator-how-to-configure-editors + + \title Change editor colors + + You can select one of the predefined color schemes for the text editor + or create customized color schemes. + + \image qtcreator-font-colors.png {Font & Colors tab in Text Editor preferences} To create a color scheme: \list 1 \li Select \preferences > \uicontrol {Text Editor} > - \uicontrol {Fonts & Color} > \uicontrol Copy. + \uicontrol {Font & Colors} > \uicontrol Copy. \li Enter a name for the color scheme and click \uicontrol OK. @@ -80,11 +96,11 @@ format. The latter makes sure that syntax highlighting is preserved when pasting to a rich-text editor. - \section2 Exporting and Importing Color Schemes + \section1 Export and import color schemes To share color schemes with others, export and import them as XML files. To export a color scheme, select \preferences > - \uicontrol {Text Editor} > \uicontrol {Fonts & Color} > \uicontrol Export, + \uicontrol {Text Editor} > \uicontrol {Font & Colors} > \uicontrol Export, and then select the filename and location for the XML file. To import a color scheme, select \uicontrol Import, and then select the XML @@ -94,29 +110,7 @@ \image qtcreator-import-color-scheme.png "Import Color Scheme dialog" When you select \uicontrol OK, the color scheme is added to the list of - color schemes in the \uicontrol {Fonts & Color} tab. - - \section2 File Encoding - - To define the default file encoding, select \preferences > - \uicontrol {Text Editor} > \uicontrol Behavior, and - then select a suitable option in \uicontrol {Default encoding}. - - \image qtcreator-options-texteditor-behavior-file-encodings.png "File encoding preferences" - - Qt 5 and Qt 6 require UTF-8 encoded source files, and therefore the default - encoding is set to \uicontrol UTF-8. - Detecting the correct encoding is tricky, so \QC will not try to do so. - Instead, it displays the following error message when you try to edit a file - that is not UTF-8 encoded: \uicontrol {Error: Could not decode "filename" with - "UTF-8"-encoding. Editing not possible.} - - To resolve the issue, use a file conversion tool to convert the file - encoding to UTF-8 when developing Qt 5 applications. Otherwise, conversion - of string constants to QString might not work as expected. - - If you develop only Qt 4 applications or other than Qt applications, you - can set other encoding options as the default encoding. Select the - \uicontrol System option to use the file encoding used by your system. + color schemes in the \uicontrol {Font & Colors} tab. + \sa {Behavior}, {Font & Colors} */ diff --git a/doc/qtcreator/src/editors/creator-editors-options.qdoc b/doc/qtcreator/src/editors/creator-editors-options.qdoc index c0bc25e56e1..152b89e6b15 100644 --- a/doc/qtcreator/src/editors/creator-editors-options.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-options.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -14,7 +14,7 @@ \else \previouspage creator-beautifier.html \endif - \nextpage creator-editor-options-text.html + \nextpage creator-preferences-text-editor-font-colors.html \title Configuring the Editor @@ -32,15 +32,9 @@ You can perform the following configuration actions: \list - \if defined(qtdesignstudio) - \li Set the \l{Specifying Code View Settings}{font preferences and + \li Set the \l{Font & Colors}{font preferences and apply color schemes} for syntax highlighting in \uicontrol {Font & Colors}. - \else - \li Set the \l{Specifying Text Editor Settings}{font preferences and - apply color schemes} for syntax highlighting in - \uicontrol {Font & Colors}. - \endif \li Specify \l{Generic Highlighting} {definition files for syntax highlighting} for other types of files than C++ or QML in \uicontrol {Generic Highlighter}. @@ -52,7 +46,7 @@ {highlighting} or \l{Folding Blocks}{folding} blocks or text wrapping in \uicontrol Display. - \li Add, modify, and remove \l{Editing Code Snippets}{code snippets} in + \li Add, modify, and remove \l{Snippets}{code snippets} in \uicontrol Snippets. \if defined(qtcreator) @@ -60,12 +54,12 @@ in \uicontrol Macros. \endif - \li Configure \l{Completing Code}{code completion} in \uicontrol Completion. + \li Configure \l{Completion}{code completion} in \uicontrol Completion. \endlist \if defined(qtcreator) - \sa {Specify editor settings}, {Using FakeVim Mode} + \sa {Specify editor settings}, {Edit like in Vim}, {Completion}, {Snippets} \endif */ diff --git a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc index 78f9fbd84a5..5706b2d70dd 100644 --- a/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc +++ b/doc/qtcreator/src/editors/creator-editors-writing-code.qdoc @@ -23,14 +23,6 @@ in-line error indicators while you are typing. \list - \if defined(qtcreator) - \li \l{Working in Edit Mode} - - You can use the editor toolbar to navigate between open files - and symbols in use. You can also split the view to work on - several files simultaneously, add bookmarks, and move between - symbol definitions and declarations. - \endif \li \l{Semantic Highlighting} \QC enables you to write well formatted code by highlighting @@ -46,7 +38,7 @@ static checks on the QML and JavaScript code in your project to find common problems. - \li \l{Completing Code} + \li \l{Complete code} \QC anticipates what you are going to write and completes code and code snippets for elements, properties, and IDs. @@ -79,25 +71,10 @@ keyboard sequence as a macro. You can then play the macro to repeat the sequence. You can save the latest macro and assign a keyboard shortcut for running it or run it from the locator. - \endlist - - \section1 Related Topics - - \list - - \li \l{Comparing Files} - - You can use a diff editor to compare two versions of a file and - view the differences side-by-side in the \uicontrol Edit mode. - - \li \l{Parsing C++ Files with the Clang Code Model} - - The Clang code model offers some of the same services as the - built-in C/C++ code model, such as code - completion, syntactic and semantic highlighting, diagnostics, - tooltips, outline of symbols, and renaming of local symbols. \endif - \endlist + \if defined(qtcreator) + \sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Comparing Files} + \endif */ diff --git a/doc/qtcreator/src/editors/creator-locator.qdoc b/doc/qtcreator/src/editors/creator-locator.qdoc index 18bc1d36027..bcdc5278757 100644 --- a/doc/qtcreator/src/editors/creator-locator.qdoc +++ b/doc/qtcreator/src/editors/creator-locator.qdoc @@ -28,10 +28,10 @@ \li Select \uicontrol Tools > \uicontrol Locate. \li Select \uicontrol Edit > \uicontrol {Go to Line}. - + \if defined(qtcreator) \li Click the line and column indicator on the - \l{Using the Editor Toolbar}{editor toolbar}. - + \l{Edit Mode}{editor toolbar}. + \endif \endlist \section1 Using Locator Filters @@ -72,54 +72,6 @@ \endlist - \section2 Locating Files - - You can locate files in the local file system or on connected devices. By - default, the file system filter shows the files in the same folder as the - currently open file and lets you navigate the file system. Also, it shows - items that let you switch to another device root. - - For example, to open a QML file called \e HelloWorld.qml in the currently - open project using the locator: - - \list 1 - - \li Press \key {Ctrl+K} to activate the locator. - - \li Start typing the filename. - - \image qtcreator-locator-open.webp "List of files found in the locator" - - \li Use the arrow keys to move to the filename in the list and press - \key Enter. - - The file opens in the editor. - - \li To move to a line in the file, enter the line number in the locator. - - \endlist - - If the path to a file is very long, it might not fit into the locator - window. To view the full path, press \key Alt when the filename is selected - or use the handle next to the locator window to increase the window width. - - \if defined(qtcreator) - If the locator does not find some files, see \l{Specify project contents} - for how to make them known to the locator. - \endif - - \section2 Locating Files from Global File System Index - - You can install tools such as Spotlight, Locate, or Everything and use them - to locate files from a global file system index. Use the \c md locator - filter to locate the files. - - To use the sorting from the selected tool instead of from \QC, - deselect the \uicontrol {Sort results} check box in the \c md - locator filter configuration. - - \image qtcreator-locator-filter-edit-md.webp {Filter Configuration dialog} - \section2 Locating Lines and Columns To move directly to a particular line and column in the document when you @@ -133,33 +85,6 @@ HelloWorld.qml:41:2 \endcode - \if defined(qtcreator) - \section2 Locating Symbols - - For example, to locate symbols matching \c {QGuiApplication}: - - \list 1 - - \li Activate the locator. - - \li Enter a colon (:) followed by a space and the upper case letters in - the symbol name (here, \c {QGuiApplication}): - - \code - : qga - \endcode - - The locator lists the results. - - \image qtcreator-locator-example.webp "List of files matching the locator filter" - - \endlist - - Filters locating files also accept paths, such as \c {tools/*main.cpp}. - Filters locating class and function definitions also accept namespaces, - such as \c {Utils::*View}. - \endif - \section2 Creating Files and Directories from Locator To create a new file and open it in the editor, type \c f diff --git a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc index 0f0a2d8e67f..b8b9efda4b5 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-beautifier.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,14 +8,16 @@ // ********************************************************************** /*! - \previouspage creator-editor-quick-fixes.html \page creator-beautifier.html - \nextpage creator-editor-options.html + \previouspage creator-how-tos.html - \title Beautifying Source Code + \ingroup creator-how-to-configure-editors - You can use the experimental Beautifier plugin to format your source code - by using the following external tools: + \title Beautify source code + + Beautifying code means applying indentation and style to source code files. + Use the experimental Beautifier plugin to format your source code with the + following external tools: \list @@ -28,22 +30,14 @@ \endlist The Beautifier plugin parses the source code into component structures, such - as assignment statements, if blocks, loops, and so on, and formats them as - specified in the Beautifier preferences. You can use a predefined style or + as assignment statements, if blocks, loops, and so on, and formats them + according to the Beautifier preferences. You can use a predefined style or define your own style. - \note Enable the Beautifier plugin to use it. Since \QC 10.0.0, the - ClangFormat plugin is enabled by default. Select \preferences > - \uicontrol {C++} > \uicontrol {Formatting mode} > \uicontrol Disable - to turn off ClangFormat if you enable Beautifier because combining - them can lead to unexpected results. - - To use the Beautifier plugin: + To automatically format files when you save them: \list 1 - \li Download and install the tool to use for formatting source code: - \list \li \l{http://sourceforge.net/projects/astyle/files/astyle} {Artistic Style} @@ -51,19 +45,87 @@ \li \l{http://sourceforge.net/projects/uncrustify/files/uncrustify} {Uncrustify} \endlist + \note You might have to build the tools from sources for some + platforms. + \li Enable the Beautifier plugin. + \note Since \QC 10.0.0, the ClangFormat plugin is enabled by default. + Go to \preferences > \uicontrol {C++} > \uicontrol {Formatting mode}, + and select \uicontrol Disable to turn off ClangFormat if you enable + Beautifier because combining them can lead to unexpected results. + \li Go to \preferences > \uicontrol Beautifier > \uicontrol General to + select the tool to use. + \image qtcreator-preferences-beautifier-general.webp {General Beautifier preferences} + \li Select \uicontrol {Automatic formatting on file save} to + automatically beautify files when you save them using the tool you + select in the \uicontrol Tool field. + \li Go to \uicontrol {Artistic Style}, \uicontrol {ClangFormat}, or + \uicontrol Uncrustify to set the path to the tool executable and + to select the configuration file that defines the style to use. + \image beautifier_options.png {Uncrustify Beautifier preferences} + \caption Beautifier Uncrustify preferences + \endlist - You might have to build the tools from sources for some platforms. + \section1 Format the currently open file - \li Select \preferences > - \uicontrol Beautifier to specify settings for beautifying files. + Go to \uicontrol Tools > \uicontrol Beautifier > \uicontrol {Artistic Style}, + \uicontrol ClangFormat, or \uicontrol Uncrustify to select actions for + formatting text in the current file. - \li Select the \uicontrol {Automatic formatting on file save} check box to + You can \l{Keyboard Shortcuts}{create keyboard shortcuts} for the + actions. + + Go to \uicontrol {Format Current File} to format the currently open file. + + \section2 Format at cursor with ClangFormat + + Go to \uicontrol Tools > \uicontrol Beautifier > \uicontrol ClangFormat > + \uicontrol {Format at Cursor} when no text is selected to format the + syntactic entity under the cursor. + + Go to \uicontrol {Format Line(s)} to format the selected lines. + + Go to \uicontrol {Disable Formatting for Selected Text} to wrap selected + lines within \c {// clang-format off} and \c {// clang-format on}. + + \section2 Format selected text with Uncrustify + + Go to \uicontrol Tools > \uicontrol Beautifier > \uicontrol Uncrustify > + \uicontrol {Format Selected Text} when no text is selected to format + the whole file by default. + + To turn off this behavior, clear + \uicontrol {Format entire file if no text was selected} in + \preferences > \uicontrol Beautifier > \uicontrol Uncrustify. + + \sa {Enable and disable plugins}, {Beautifier} +*/ + +/*! + \page creator-preferences-beautifier.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences + + \title Beautifier + + \brief Format source code with Artistic Style, ClangFormat, or Uncrustify. + + Automatically apply indentation and style to source code files when you save + them. Use a predefined style or define your own style. + + To specify settings for beautifying files: + + \list 1 + + \li Go to \preferences > \uicontrol Beautifier > \uicontrol General. + + \li Select \uicontrol {Automatic formatting on file save} to automatically beautify files when you save them using the tool you select in the \uicontrol Tool field. \image qtcreator-preferences-beautifier-general.webp {General Beautifier preferences} - \li In the \uicontrol {Restrict to MIME types} field, define the MIME + \li In \uicontrol {Restrict to MIME types}, define the MIME types of the files to beautify, separated by semicolons. Leave the field empty to apply the tool on all files. @@ -72,97 +134,90 @@ format the currently open file, specify this option in the tool-specific tab. - \li Select the \uicontrol {Restrict to files contained in the current - project} check box to only beautify files that belong to the - current project. + \li Select \uicontrol {Restrict to files contained in the current project} + to only beautify files that belong to the current project. - \li Select \uicontrol {Artistic Style}, \uicontrol {ClangFormat}, or + \li Go to \uicontrol {Artistic Style}, \uicontrol {ClangFormat}, or \uicontrol Uncrustify to specify settings for the tool you want to use. - \image beautifier_options.png "Uncrustify Beautifier preferences" + \image beautifier_options.png {Uncrustify Beautifier preferences} - \li In the \uicontrol Configuration group, specify the path to - the tool executable in the \uicontrol {Artistic Style command}, - \uicontrol {ClangFormat command}, or - \uicontrol {Uncrustify command} field. + \li In \uicontrol Configuration, specify the path to the + tool executable in \uicontrol {Artistic Style command}, + \uicontrol {ClangFormat command}, or \uicontrol {Uncrustify command}. - \li In the \uicontrol {Restrict to MIME types} field, define the MIME + \li In \uicontrol {Restrict to MIME types}, define the MIME types of the files to beautify. This setting is applied when you select the menu item to format the currently open file. - \li In the \uicontrol Options group, select the configuration file that + \li In \uicontrol Options, select the configuration file that defines the style to use in the source files. If you select several options, they are applied from top down. The available options depend on the tool. - \list - - \li Select \uicontrol {Use file *.astylerc defined in project files} - or \uicontrol {Use file uncrustify.cfg defined in project files}, - to use the configuration file \l{Specify project contents} - {defined in the project file} as the configuration file - for the selected tool. - - \li Select \uicontrol {Use specific config file} or - \uicontrol {Use file specific uncrustify.cfg} to - use the specified file as the configuration file for the - selected tool. - - \li Select \uicontrol {Use file uncrustify.cfg in <$HOME>} or - \uicontrol {Use file .astylerc or acstylerc in <$HOME>} to - use the specified file in the user's home directory as the - configuration file for the selected tool. - - \li For ClangFormat, you can use a predefined style, by - selecting the \uicontrol {Use predefined style} radio - button, and then selecting the style to use from the list of - available styles. - - \image qtcreator-beautifier-options-clangformat.png "ClangFormat Beautifier preferences" - - Select \uicontrol File to load the style configuration from - the \c .clang-format or \c _clang-format file located in the - same directory as the source file or in one of its parent - directories. - - To specify a fallback style to use if the style configuration - file is not available, use the \uicontrol {Fallback style} - combo box. Select \uicontrol Default to use the default style. - Select \uicontrol None to skip formatting. - - \li Select the \uicontrol {Use customized style} option, and - then \uicontrol Add to define your own style. - - Define code formatting in the - \uicontrol {Add Configuration} dialog. It offers syntax - highlighting, auto-completion, and context-sensitive help. - For these features, you must have the tool installed. - - \image beautifier_editor.png "Add Configuration dialog" - - \endlist - - \li Select \preferences > \uicontrol Beautifier - > \uicontrol {Artistic Style}, \uicontrol ClangFormat, or - \uicontrol Uncrustify > \uicontrol {Format Current File} to format - the currently open file. - - You can \l{Keyboard Shortcuts}{create keyboard shortcuts} for the - functions. - \endlist - In addition, ClangFormat has the \uicontrol {Format at Cursor} command. If you - select it when no text is selected, the syntactic entity under the cursor - is formatted. The \uicontrol {Disable Formatting for Selected Text} command - wraps selected lines within \c {// clang-format off} and - \c {// clang-format on}. + \section1 Beautifier Tool Options - Uncrustify has the \uicontrol {Format Selected Text} command. If you - select it when no text is selected, the whole file is formatted by default. - To disable this behavior, deselect the - \uicontrol {Format entire file if no text was selected} check box. + To set the following options, you must have one of the tools installed. - \sa {Enable and disable plugins} + \table + \header + \li Option + \li Value + \row + \li \uicontrol {Use file *.astylerc defined in project files} + + \uicontrol {Use file uncrustify.cfg defined in project files} + \li Use the configuration file \l{Specify project contents} + {defined in the project file} as the configuration file + for the selected tool. + \row + \li \uicontrol {Use specific config file} + + \uicontrol {Use file specific uncrustify.cfg} + \li The file to use as the configuration file for the selected tool. + \row + \li \uicontrol {Use file uncrustify.cfg in <$HOME>} + + \uicontrol {Use file .astylerc or acstylerc in <$HOME>} + \li Use the specified file in the user's home directory as the + configuration file for the selected tool. + \row + \li \uicontrol {Use customized style} + \li Set your own code style. + \row + \li \uicontrol {Format entire file if no text was selected} + \li Format the whole file when no text is selected in the editor and + you select \uicontrol {Format Selected Text}. + \endtable + + \section2 Using a Predefined ClangFormat Style + + To use a predefined ClangFormat style, go to \uicontrol {ClangFormat} and + select a style in \uicontrol {Use predefined style}. + + \image qtcreator-beautifier-options-clangformat.png {ClangFormat Beautifier preferences} + + Select \uicontrol File to load the style configuration from the + \c .clang-format or \c _clang-format file located in the same + directory as the source file or in one of its parent directories. + + In \uicontrol {Fallback style}, select a fallback style to use if the style + configuration file is not available. Select \uicontrol Default to use the + default style. Select \uicontrol None to skip formatting. + + \section2 Defining a Style + + To define your own style, select \uicontrol {Use customized style}, and then + select \uicontrol Add. + + Set the code style in the \uicontrol {Add Configuration} dialog. + It offers syntax highlighting, auto-completion, and context-sensitive + help. + + \image beautifier_editor.png {Add Configuration dialog} + + \sa {Beautify source code}, {Enable and disable plugins} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc index ed812bed750..1bc7cd48bc9 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,11 +8,14 @@ // ********************************************************************** /*! - \previouspage creator-diff-editor.html \page creator-clang-codemodel.html - \nextpage creator-finding-overview.html + \previouspage creator-reference.html - \title Parsing C++ Files with the Clang Code Model + \ingroup creator-reference + + \title Clang Code Model + + \brief Offers code editing services for C++. The \e {code model} is the part of an IDE that understands the language you are using to write your application. It is the framework that allows \QC @@ -20,12 +23,12 @@ \list - \li \l{Completing Code}{Code completion} + \li \l{Complete code}{Code completion} \li Syntactic and \l{Semantic Highlighting}{semantic highlighting} \li Navigating in the code by using the \l{Searching with the Locator} - {locator}, \l{Moving to Symbol Definition or Declaration} + {locator}, \l{Move to symbol definition or declaration} {following symbols}, and so on \li Inspecting code by using the \l{Class View}{class browser}, the @@ -37,7 +40,7 @@ \li \l{Finding Symbols}{Finding and renaming symbols} - \li \l{Applying Refactoring Actions}{Refactoring actions} + \li \l{Apply quick fixes}{Quick fixes} \endlist @@ -73,7 +76,7 @@ \li Code completion \li Syntactic and semantic highlighting - \li \l{Using Clang Tools}{Diagnostics} + \li \l{Clang Checks}{Diagnostics} \li Outline of symbols \li Tooltips \li Following symbols @@ -84,17 +87,57 @@ To use the built-in code model instead, select \preferences > \uicontrol C++ > \uicontrol clangd, and deselect the \uicontrol {Use clangd} check box. - This setting also exists on the project level, so that you can have the clang-based + This setting also exists on the project level, so that you can have the Clang-based services generally enabled, but switch them off for certain projects, or vice versa. - You can configure Clang diagnostics either globally or separately for: + You can configure Clang diagnostics for: \list - \li Clang code model (globally or at project level) - \li \l{Using Clang Tools}{Clang tools} (globally or at project level) + \li \l{Clang Checks}{Clang code model} (globally or at project level) + \li \l{Configure Clang diagnostics}{Clang tools} (globally or at project + level) \endlist - \section1 Configuring Clang Code Model + \section1 Clangd Indexing + + The clangd \e index provides exact and complete results for services such + as finding references, following symbols under cursor, and using the + locator, even for complex constructs. When you \l{Open projects} + {open a project}, clangd scans the source files to generate the index. For + large projects, this can take a while, but the index is persistent and + re-scanning is incremental, so nothing is lost by closing and re-starting + \QC. + + To temporarily disable global indexing, select + \uicontrol {Toggle Progress Details} (1), and then select \uicontrol X on + the progress bar. + + \image qtcreator-toggle-progress-bar.webp {Toggle Progress Details button} + + By default, \QC runs one clangd process per project. If you have created + \l{Manage sessions}{sessions} that have related projects, you can + specify that the projects in the session should be managed by a single + clangd process. + + The document outline in the \l{Outline} view is backed by clangd's document + symbol support, which makes the results more reliable than before. + + \sa {Code Model}, {Clangd}, {Specify clangd settings}, + {Speficy Clang tools settings}, {Use compilation databases} +*/ + +/*! + \page creator-preferences-cpp-code-model.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences-cpp + + \title Code Model + + \brief Sets global preferences for the code model. + + The Clang code model offers services such as code completion, syntactic and + semantic highlighting, and diagnostics. To configure the Clang code model globally: @@ -132,36 +175,29 @@ \endlist - \section1 Configuring clangd + \sa {Specify clangd settings}, {Clang Code Model}, {Clangd} +*/ - The clangd \e index provides exact and complete results for services such - as finding references, following symbols under cursor, and using the - locator, even for complex constructs. When you \l{Open projects} - {open a project}, clangd scans the source files to generate the index. For - large projects, this can take a while, but the index is persistent and - re-scanning is incremental, so nothing is lost by closing and re-starting - \QC. +/*! + \page creator-preferences-cpp-clangd.html + \previouspage creator-reference.html - To temporarily disable global indexing, select - \uicontrol {Toggle Progress Details} (1), and then select \uicontrol X on - the progress bar. + \ingroup creator-reference-preferences-cpp - \image qtcreator-toggle-progress-bar.webp {Toggle Progress Details button} + \title Clangd - By default, \QC runs one clangd process per project. If you have created - \l{Manage sessions}{sessions} that have related projects, you can - specify that the projects in the session should be managed by a single - clangd process. + \brief Sets global preferences for the clangd code model. - The document outline in the \l{Outline} view is backed by clangd's document - symbol support, which makes the results more reliable than before. + The Clang project has libraries for parsing C language family source files + and providing you with detailed diagnostics. The clangd \e index provides + exact and complete results for services such as code completion. - To specify settings for clangd: + To set preferences for clangd: \list 1 \li Select \preferences > \uicontrol C++ > \uicontrol Clangd > \uicontrol {Use clangd}. - \image qtcreator-preferences-clangd.webp "Clangd preferences" + \image qtcreator-preferences-clangd.webp {Clangd preferences} \li In \uicontrol {Path to executable}, enter the path to clangd version 14, or later. \li In the \uicontrol {Background indexing} field, select \uicontrol Off @@ -195,24 +231,30 @@ by ignoring big files. Specify the maximum size of files to parse in the field next to the check box. \li The \uicontrol {Diagnostic configuration} field shows the Clang - checks to perform. Click the value of the field to open the - \uicontrol {Diagnostic Configurations} dialog, where you can - select and edit the checks to perform. + checks to perform. Click the value of the field to select and edit + the checks to perform. \li Select \uicontrol Add to select sessions that should use a single clangd process for indexing. \endlist \section1 Clang Checks + Click the value of the \uicontrol {Diagnostic configuration} field to open + the \uicontrol {Diagnostic Configurations} dialog, where you can select and + edit the checks to perform. + + \image qtcreator-clang-diagnostic-configurations.webp {Diagnostic Configurations dialog} + In addition to using the built-in checks, you can select \uicontrol Copy to create copies of them and edit the copies to fit your needs. - \uicontrol {Build-system warnings} displays warnings as specified - by the build system. - - \uicontrol {Checks for questionable constructs} combines the \c -Wall and - \c -Wextra checks for easily avoidable questionable constructions and some - additional issues. + \list + \li \uicontrol {Build-system warnings} shows warnings as specified + by the build system. + \li \uicontrol {Checks for questionable constructs} combines the \c -Wall + and \c -Wextra checks for easily avoidable questionable constructions + and some additional issues. + \endlist Clang checks begin with \c -W. Each check also has a negative version that begins with \c -Wno. @@ -221,11 +263,27 @@ see \l{https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html} {Options to Request or Suppress Warnings} or the GCC or Clang manual pages. - \section1 Specifying Clang Code Model Settings at Project Level - - You can specify Clang code model settings at project level by selecting - \uicontrol Projects > \uicontrol {clangd}. - - \include creator-compilation-database.qdocinc using compilation databases - + \sa {Specify clangd settings}, {Clang Code Model}, {Code Model} +*/ + +/*! + \page creator-how-to-override-clangd-preferences.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects-configure + + \title Specify clangd settings + + To set clangd preferences for the current project: + + \list 1 + \li Select \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {Clangd}. + \image qtcreator-projects-settings-clangd.webp {Clangd preferences for a project} + \li Deselect \uicontrol {Use global settings}. + \li Select \uicontrol {Use clangd}. + \li Specify \uicontrol Clangd preferences for the project. + \endlist + + \sa {Clang Code Model}, {Clangd}, {Code Model} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc index 6a649e96db7..fdabb4f96c2 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-coding-edit-mode.qdoc @@ -1,209 +1,572 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-editor-functions.html \page creator-coding-navigating.html - \nextpage creator-highlighting.html + \previouspage creator-reference.html - \title Working in Edit Mode + \ingroup creator-reference-editors - You can write code in the \uicontrol Edit mode. + \title Edit Mode - \section1 Using the Editor Toolbar + \brief Edit and navigate code and other resources in your projects. - The editor toolbar is located at the top of the editor view. It is context - sensitive and shows items relevant to the file currently open in the editor. + Write and navigate code in the \uicontrol Edit mode. - \image qtcreator-editortoolbar-symbols.webp {Edit mode toolbar} + \image qtcreator-spliteditorview.png {Code editor} - To add more space around the toolbar items, select \preferences > + \section1 Editing Code + + The \QC code editor offers code editing services, such as: + + \list + \li \l {Semantic Highlighting}{Semantic highlighting} + + \QC helps you to write well formatted code by highlighting + code elements and blocks. You can use syntax highlighting + also for other types of files than C++ or QML. + + \li \l {Checking Code Syntax}{Checking code syntax} + + \QC checks for errors when you write code and displays inline + error and warning messages. Similarly, it checks the data + structure of an instance of a JavaScript object notation (JSON) + entity. Run static checks on the QML and JavaScript code in your + project to find common problems. + + \li \l {Complete code}{Code completion} + + \QC anticipates what you are going to write and completes code + and code snippets for elements, properties, and IDs. + + \li \l {Indent text or code}{Indenting text or code} + + \QC indents text and code according to rules that you + specify separately for files that have C++, QML, or + Nim (experimental) code and for other text files. + \endlist + + \section1 Navigating Code + + Split the editor view to work on several files simultaneously and move + between files and symbols in the following ways: + + \list + \li Locate them with the locator. + \li Use the \l{Sidebar Views}{views} in the sidebar. + \li Go to the \uicontrol Edit and \uicontrol Window menu. + \li Use keyboard shortcuts. + \li Bookmark code. + \li Select buttons on the editor toolbar. + \endlist + + \section1 Editor Toolbar + + The editor toolbar is context sensitive and shows items relevant to the file + currently open in the editor. + + \image qtcreator-editor-toolbar.webp {Edit mode toolbar} + + \table + \header + \li Button or Field + \li Purpose + \li Read More + \row + \li \inlineimage icons/prev.png + \inlineimage icons/next.png + \li Browse backward or forward through your location history. + \li + \row + \li \inlineimage numbers/01.png + \li Shows the currently open file. + \li \l{Move between files} + \row + \li \inlineimage numbers/02.png + \li Shows the current symbol. + \li \l{Move to symbols} + \row + \li \uicontrol # + \li Change the active parse context. + \li \l {Parse files} + \row + \li \inlineimage numbers/03.png + \li Switch between Windows line endings (CRLF) and Unix line endings (LF). + \li \l{Select line ending style} + \row + \li \inlineimage numbers/04.png + \li Change the text encoding. + \li \l{Change text encoding} + \row + \li \inlineimage icons/languageclient.png + \li View the language server for the current project, restart it, select + another one, \l{Inspect language clients}{inspect the communication} + between \QC and language servers, view server capabilities, and set + language server preferences. + \li \l {Language Servers} + \row + \li \inlineimage icons/debugger_singleinstructionmode.png + \li Run Clang-Tidy or Clazy to analyze the currently open file. + \li \l{Analyze code with Clang-Tidy and Clazy} + \row + \li \inlineimage numbers/05.png + \li Jump to a line and column in the current file. The line and column + indicator shows information about the current cursor positions, + including the length of the selection for selected text. + \li + + \endtable + + \section1 Adding Space Around Toolbar Items + + To add more space around the toolbar items, go to \preferences > \uicontrol Environment > \uicontrol Interface, and then select \uicontrol Relaxed in the \uicontrol {Toolbar style} field. \image qtcreator-preferences-environment-interface.webp {Interface tab in Environment preferences} - \section2 Navigating Between Open Files and Symbols + \section1 Resizing Views - Use the toolbar, \uicontrol Window menu items, or - \l{General Keyboard Shortcuts}{keyboard shortcuts} - to navigate between open files and symbols in use. + To resize the editor views and splits, move the cursor to the edge of the + view or split. When the cursor changes, drag the edge of the view or split + to another position. - To browse backward or forward through your - location history, click \inlineimage icons/prev.png - (\uicontrol {Go Back}) and \inlineimage icons/next.png - (\uicontrol {Go Forward}). + If the cursor does not change, go to \preferences > \uicontrol Environment > + \uicontrol Interface and select \uicontrol {Override cursors for views}. - To return to the last location where you made a change, select - \uicontrol Window > \uicontrol {Go to Last Edit}. + \section1 Copying File Information - To go to any open file, select it from the \uicontrol {Open files} drop-down - menu (1). To open a context menu that has commands for managing open - files, right-click the file name or icon on the toolbar. In addition to the - commands also available in the \uicontrol File menu, you can copy the path - and name of the current file and the number of the line where the cursor is - currently located to the clipboard by selecting \uicontrol {Copy Full Path}, - \uicontrol {Copy File Name}, or \uicontrol {Copy Path and Line Number}. - - To jump to any symbol used in the current file, select it from the - \uicontrol Symbols drop-down menu (2). By default, the symbols are displayed - in the order in which they appear in the file. Right-click the menu title - and select \uicontrol {Sort Alphabetically} to arrange the symbols in - alphabetic order. - - To jump to a line and column in the current file, select the line and column - indicator (3) or press \key {Ctrl+K} (or \key {Cmd+K} on \macos) to open the - \l{Searching with the Locator}{locator}. Enter the line number and column - number in the locator, separated by a colon (:). - - The line and column indicator shows more information about the current - cursor positions, including the length of the selection for selected text. - - \image qtcreator-editor-line-column.webp {Line and column indicator on the Edit mode toolbar} - - \note You can also use the \l{Show and hide sidebars}{sidebars} to - move around in \QC. - - \section2 Selecting Parse Context - - Code might be interpreted differently in different contexts. A file can be - used by different projects or subprojects with different defines, or it can - be included in the context of C, C++, Objective-C, or Objective-C++. To - change the active parse context, select an available parse context in the - \uicontrol {Active Parse Context} menu (4). The menu is visible only when - several parse contexts are available. To reset the parse context, - right-click on the menu to open a context menu, and then select - \uicontrol {Clear Preferred Parse Context}. - If the information needed for parsing the project is still incomplete or - incorrect, select \uicontrol {Additional Preprocessor Directives} to - add preprocessor directives. - - \section2 Changing Text Encoding - - To show the file encoding of the current file on the editor toolbar (5), - select \preferences > \uicontrol {Text Editor} > - \uicontrol Display > \uicontrol {Display file encoding}. - - To change the text encoding, click it on the toolbar and select new - encoding in the \uicontrol {Text Encoding} dialog: - - \image qtcreator-text-encoding.png "Text Encoding dialog" - - To reload the file with the selected encoding, select - \uicontrol {Reload with Encoding}. To save the file with - the new encoding, select \uicontrol {Save with Encoding}. - - \section2 Selecting Line Ending Style - - To switch between Windows line endings (CRLF) and Unix line endings (LF), - select the ending style on the editor toolbar (6). To hide this field, - select \preferences > \uicontrol {Text Editor} - > \uicontrol Display, and deselect \uicontrol {Display file line ending}. - - To set the line endings to use for all projects by default, select - \preferences > \uicontrol {Text Editor} > - \uicontrol Behavior, and then select the ending style in the - \uicontrol {Default line endings} field. - - To set the line endings to use for a project, select \uicontrol Projects > - \uicontrol {Project Settings} > \uicontrol Editor. - - For more information, see \l {Specify editor settings}. - - \section2 Managing Language Servers - - Select the \inlineimage icons/languageclient.png - icon on the editor toolbar (7) to view the \l{Using Language Servers} - {language server} for the current project. You can restart the language - server or select another one in the menu. Also, you can - \l{Inspecting Language Clients}{inspect the communication} between \QC - and language servers and view server capabilities, as well as - \l{Specifying Settings for Language Clients}{set language server preferences}. + To open a context menu that has commands for managing open files, right-click + the file name or icon on the toolbar (1). It has the same commands as the + \uicontrol File menu, as well as commands that copy the path and name of the + current file and the number of the line where the cursor is + currently located to the clipboard: \uicontrol {Copy Full Path}, + \uicontrol {Copy File Name}, and \uicontrol {Copy Path and Line Number}. \section1 Editing Selected Lines - The \uicontrol Edit > \uicontrol Advanced menu has options for editing - selected lines of text. + In the \uicontrol Edit mode, go to \uicontrol Edit > \uicontrol Advanced + to edit lines of text that you select in the editor: - To duplicate the selected lines, select \uicontrol {Duplicate Selection}. - To format the duplicated lines as a comment, select - \uicontrol {Duplicate Selection and Comment}. + \list + \li To duplicate the selected lines, go to + \uicontrol {Duplicate Selection}. + \li To format the duplicated lines as a comment, go to + \uicontrol {Duplicate Selection and Comment}. + \li To turn selected text into lowercase, go to + \uicontrol {Lowercase Selection} or press \key {Alt+U}. + \li To turn selected text into uppercase, go to + \uicontrol {Uppercase Selection} or press \key {Alt+Shift+U}. + \li To sort selected lines alphabetically, go to + \uicontrol {Sort Selected Lines} or press \key {Alt+Shift+S}. + \li To add a cursor at the next occurrence of selected text for multi-cursor + editing, go to \uicontrol {Add Next Occurrence to Selection} or press \key {Ctrl+D} + \endlist - To turn selected text into lowercase, select \uicontrol {Lowercase Selection} - or press \key {Alt+U}. To turn it into uppercase, select - \uicontrol {Uppercase Selection} or press \key {Alt+Shift+U}. + \sa {Edit Code}{How To: Edit Code}, + {Manage Language Servers}{How To: Manage Language Servers}, + {Searching with the Locator}, {Keyboard Shortcuts}, {Sidebar Views} +*/ - To sort selected lines alphabetically, select \uicontrol {Sort Selected Lines} - or press \key {Alt+Shift+S}. +/*! + \page creator-how-to-move-between-open-files.html + \previouspage creator-how-tos.html - Select \uicontrol {Add Next Occurrence to Selection} or press \key {Ctrl+D} - to add a cursor at the next occurrence of selected text for multi-cursor - editing. + \ingroup creator-how-to-edit - \section1 Multi-Cursor Editing + \title Move between files - To apply a change to several places simultaneously, press and hold \key Alt, - and click to place cursors in several places. Any changes you make are - applied simultaneously at all the cursor positions. + The editor toolbar shows the file that is currently open (1) in the editor. - Use the arrow keys to move all the cursors up and down. The \key Home and - \key End key move all the cursors to the beginning or to the end of the - line. + \image qtcreator-editor-open-files.webp {Current file shown on Edit mode toolbar} - Press and hold \key Alt and double-click strings to select several strings - simultaneously. + Use the locator, \l{Sidebar Views}{sidebar views}, \uicontrol Window menu + items, \l{General Keyboard Shortcuts}{keyboard shortcuts}, or + \l{Editor Toolbar}{editor toolbar} to move between files. - Press \key {Alt+Shift+I} to create cursors at the ends of selected lines. + \section1 Locate files - Press \key Esc to remove all the cursors and selections. + Activate the locator to find files in the local file system or on connected + devices. By default, the locator shows open documents and all files from all + projects. The file system filter (\c f) shows all files in the same folder + as the currently open file, and you can navigate the file system from there. + Also, you can switch to another device root. - \section1 Splitting the Editor View + For example, to open a QML file called \e HelloWorld.qml in the currently + open project using the locator: - Split the editor view or open the editor in a new window when you want to - work on and view multiple files on the same screen or on multiple screens. + \list 1 + \li Press \key {Ctrl+K} to activate the locator. + \li Start typing the filename. + \image qtcreator-locator-open.webp {List of files in the locator} + \li Use the arrow keys to move to the filename in the list and press + \key Enter. - \image qtcreator-spliteditorview.png + The file opens in the editor. + \li To move to a line in the file, enter the line number in the locator. + \endlist - You can view multiple files simultaneously in the following ways: + Filters locating files also accept paths, such as \c {tools/*main.cpp}. + If the path to a file is very long, it might not fit into the locator + window. To view the full path, press \key Alt when the filename is selected + or drag the right edge of the locator to make it wider. + + If the locator does not find some files, see \l{Specify project contents} + for how to make them known to the locator. + + \section1 Locate files from global file system index + + You can install tools such as Spotlight, Locate, or Everything and use them + to locate files from a global file system index. Use the \c md locator + filter to locate the files. + + To use the sorting from the selected tool instead of from \QC, + deselect the \uicontrol {Sort results} check box in the \c md + locator filter configuration. + + \image qtcreator-locator-filter-edit-md.webp {Filter Configuration dialog} + + \section1 Browse location history + + To browse backward or forward through your location history, click + \inlineimage icons/prev.png (\uicontrol {Go Back}) and + \inlineimage icons/next.png (\uicontrol {Go Forward}) on the editor toolbar. + + To return to the last location where you made a change, go to + \uicontrol Window > \uicontrol {Go to Last Edit}. + + \section1 Navigate with the keyboard + + Use keyboard shortcuts: + + \list + \li To quickly move between currently open files, press \key Ctrl+Tab. + \li To move forward in the location history, press \key {Alt+Right} + (\key {Cmd+Opt+Right} on \macos). + \li To move backward, press \key {Alt+Left} (\key {Cmd+Opt+Left} on \macos). + For example, after you use the \uicontrol Locator + to jump to a symbol in the same file, press \key {Alt+Left} to jump + back to your original location in that file. + \endlist + + \sa {Edit Code}{How To: Edit Code}, {Edit Mode}, + {Searching with the Locator}, {File System}, {Projects} +*/ + +/*! + \page creator-how-to-move-to-symbols.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-edit + + \title Move to symbols + + The editor toolbar shows the symbol currently under the cursor (1). + + \image qtcreator-editor-symbols.webp {Symbol under the cursor shown on Edit mode toolbar} + + By default, the list of symbols shows them in the order in which they appear + in the file. Right-click the field and go to \uicontrol {Sort Alphabetically} + to arrange the symbols in alphabetic order. + + Use the locator, \l{Sidebar Views}{views}, \uicontrol Window menu items, + \l{General Keyboard Shortcuts} {keyboard shortcuts}, or \l{Editor Toolbar} + {editor toolbar}, to navigate between symbols in open files. + + \section1 Locate symbols + + To jump to a symbol in the current file, activate the locator, + enter a period (.) or colon (:), and start typing the symbol name. Then + select the symbol in the list. + + For example, to locate symbols matching \c {QGuiApplication}: + + \list 1 + + \li Press \key {Ctrl+K} to activate the locator. + + \li Enter a colon (:) followed by a space and the upper case letters in + the symbol name (here, \c {QGuiApplication}): + + \code + : qga + \endcode + + \endlist + + The locator lists the results. + + \image qtcreator-locator-example.webp {List of files matching the locator filter} + + Filters locating class and function definitions also accept namespaces, + such as \c {Utils::*View}. + + \section1 Move to symbol definition or declaration + + To move directly to the definition or declaration of a symbol in the + \uicontrol Edit mode, move the cursor on the symbol and press \key {F2}. + + Or, hold the \key Ctrl key (\key Cmd on \macos) and click + the symbol. If you have multiple splits opened, open the link in the next + split by holding \key Ctrl and \key Alt while clicking the symbol. + + To enable this moving function, go to \preferences > \uicontrol {Text Editor} + > \uicontrol Behavior > \uicontrol {Enable mouse navigation}. + + \image qtcreator-preferences-texteditor-behavior.webp {Text Editor Behavior preferences} + + \section2 Follow symbols + + Go to the context menu or to \uicontrol Tools > \uicontrol C++ or + \uicontrol QML/JS for more ways to move to the definition or declaration + of a symbol in the current split or the next split: + + \list + \li To follow namespaces, classes, functions, variables, include + statements, and macros, go to \uicontrol {Follow Symbol Under Cursor} + or \uicontrol {Follow Symbol Under Cursor in Next Split}. + \li To move to the type definition of a symbol, go to + \uicontrol {Follow Symbol Under Cursor to Type} (\key {Ctrl+Shift+F2}) + or \uicontrol {Follow Symbol Under Cursor to Type in Next Split} + (\key {Ctrl+E, Ctrl+Shift+F2}). + \endlist + + \section2 Switch between function definition and decalaration + + To switch between the definition and declaration of a function, place the + cursor on either and press \key {Shift+F2} or right-click and go to + \uicontrol {Switch Between Function Declaration/Definition} or + \uicontrol {Open Function Declaration/Definition in Next Split}. + For example, this allows you to navigate from anywhere within a function + body directly to the function declaration. + + To switch between C++ header and source files, right-click anywhere in a + file and go to \uicontrol {Switch Header/Source} (\key F4) or + \uicontrol {Open Corresponding Header/Source in Next Split} + (\key {Ctrl+E,F4}). + + \section2 Open links in another split + + Links open in the same split by default. To open them in the next + split, press \key {Ctrl+E} first. For example, press \key {Ctrl+E,F2} to + follow the symbol into the next split. If necessary, the view is + automatically split. + + To change the default behavior, go to \preferences > + \uicontrol {Text Editor} > \uicontrol Display and select + \uicontrol {Always open links in another split}. The symbol, + definition, or declaration opens in another split. Also, the + shortcuts for opening link targets in the next split are used + to open them in the current split. + + \image qtcreator-options-text-editor-display.png {Text Editor Display preferences} + + \section1 Open resource files for editing + + When the cursor is on a string literal and the string is a Qt resource file + (.qrc) path, following the symbol opens the specified resource file for + editing in the \uicontrol {Resource Browser}. + + \image qtcreator-add-resource.png {Resource Browser} + + \sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Editing Keyboard Shortcuts}, + {Searching with the Locator} +*/ + +/*! + \page creator-how-to-change-text-encoding.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-configure-editors + + \title Change text encoding + + \image qtcreator-editor-toolbar.webp {Edit mode toolbar} + + To show the file encoding of the current file on the editor toolbar (4) in + the \uicontrol Edit mode, go to \preferences > \uicontrol {Text Editor} > + \uicontrol Display > \uicontrol {Display file encoding}. + + \image qtcreator-options-text-editor-display.png {Text Editor Display preferences} + + To change the text encoding, select it on the toolbar, and then select new + encoding in the \uicontrol {Text Encoding} dialog: + + \image qtcreator-text-encoding.png {Text Encoding dialog} + + To reload the file with the selected encoding, select + \uicontrol {Reload with Encoding}. + + To save the file with the new encoding, go to + \uicontrol {Save with Encoding}. + + \section1 Set default encoding + + To define the default file encoding, select \preferences > + \uicontrol {Text Editor} > \uicontrol Behavior, and + then select a suitable option in \uicontrol {Default encoding}. + + \image qtcreator-options-texteditor-behavior-file-encodings.png {File encoding preferences} + + Qt 5 and Qt 6 require UTF-8 encoded source files, and therefore the default + encoding is set to \uicontrol UTF-8. + Detecting the correct encoding is tricky, so \QC will not try to do so. + Instead, it displays the following error message when you try to edit a file + that is not UTF-8 encoded: \uicontrol {Error: Could not decode "filename" with + "UTF-8"-encoding. Editing not possible.} + + To resolve the issue, use a file conversion tool to convert the file + encoding to UTF-8 when developing Qt 5 applications. Otherwise, conversion + of string constants to QString might not work as expected. + + If you develop only Qt 4 applications or other than Qt applications, you + can set other encoding options as the default encoding. Select the + \uicontrol System option to use the file encoding used by your system. + + \sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Behavior} +*/ + +/*! + \page creator-how-to-select-line-endings.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-configure-editors + + \title Select line ending style + + To switch between Windows line endings (CRLF) and Unix line endings (LF), + select the ending style on the editor toolbar (3) in the \uicontrol Edit + mode. + + \image qtcreator-editor-toolbar.webp {Edit mode toolbar} + + To hide this field, go to \preferences > \uicontrol {Text Editor} + > \uicontrol Display, and clear \uicontrol {Display file line ending}. + + \section1 Set default style + + To set the line endings to use for all projects by default, go to + \preferences > \uicontrol {Text Editor} > \uicontrol Behavior and + select the ending style in \uicontrol {Default line endings}. + + \image qtcreator-options-texteditor-behavior-file-encodings.png {Default file ending preferences} + + To set the line endings to use for a project, go to \uicontrol Projects > + \uicontrol {Project Settings} > \uicontrol Editor. + + \image qtcreator-editor-settings.webp {Editor settings for a project} + + \sa {Edit Code}{How To: Edit Code}, {Specify editor settings}, {Edit Mode} +*/ + +/*! + \page creator-how-to.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-edit + + \title Insert multiple cursors + + To apply a change to several places simultaneously in the editor in the + \uicontrol Edit mode, press and hold \key Alt, and click to place cursors + in several places in the file. Any changes you make are applied + simultaneously at all the cursor positions. + + \image qtcreator-editor-multicursor.webp {Multiple cursors in the editor} + + To manage cursors: + + \list + \li Press the arrow keys to move all the cursors up and down. + \li Press the \key Home and \key End key to move all the cursors + to the beginning or to the end of the line. + \li Press and hold \key Alt and double-click strings to select + several strings simultaneously. + \li Press \key {Alt+Shift+I} to create cursors at the ends of + selected lines. + \li Press \key Esc to remove all the cursors and selections. + \endlist + + \sa {Edit Code}{How To: Edit Code}, {Editing Selected Lines}, {Edit Mode} +*/ + +/*! + \page creator-how-to-split-editor-views.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-edit + + \title Split the editor view + + Split the editor view or open the editor in a new window to work on + and view many files on the same screen or on many screens. + + \image qtcreator-spliteditorview.png {Editor view split horizontally and vertically} + + View many files at the same time: \list - \li To split the editor view into a top and bottom view, select + \li To split the editor view into a top and bottom view, go to \uicontrol Window > \uicontrol Split, press \key {Ctrl+E, 2}, or select the \inlineimage icons/splitbutton_horizontal.png (\uicontrol Split) button and then select \uicontrol Split. - Split command creates views below the currently active editor view. + The \uicontrol Split command creates views below the currently active + editor view. - \li To split the editor view into adjacent views, select + \li To split the editor view into adjacent views, go to \uicontrol Window > \uicontrol {Split Side by Side}, press \key {Ctrl+E, 3}, or select \uicontrol Split > \uicontrol {Split Side by Side}. - Side by side split command creates views to the right of the - currently active editor view. + The \uicontrol {Split Side by Side} command creates views to the right + of the currently active editor view. \li To open the editor in a detached window, press \key {Ctrl+E, 4}, or - select \uicontrol Window > \uicontrol {Open in New Window}. + go to \uicontrol Window > \uicontrol {Open in New Window}. - The new window behaves basically in the same way as the editor area + The new window behaves in the same way as the editor area in the main window. For example, you can split this window, as well. Documents are opened in the currently active editor window. \endlist - To move between split views and detached editor windows, select + \section1 Move between views and windows + + To move between split views and detached editor windows, go to \uicontrol Window > \uicontrol {Go to Next Split or Window} or press \key {Ctrl+E, O}. - To remove a split view, place the cursor within the view you want to - remove and select \uicontrol Window > \uicontrol {Remove Current Split}, - press \key {Ctrl+E, 0}, or select the \inlineimage icons/splitbutton_closetop.png - (\uicontrol {Remove Split}) button. To remove all but the currently selected - split view, select \uicontrol Window > \uicontrol {Remove All Splits} or - press \key {Ctrl+E, 1}. + \section1 Remove splits - \section1 Using Bookmarks + To remove a split view: + + \list + \li Place the cursor within the view you want to remove and go to + \uicontrol Window > \uicontrol {Remove Current Split}. + \li Press \key {Ctrl+E, 0}. + \li Select the \inlineimage icons/splitbutton_closetop.png + (\uicontrol {Remove Split}) button. + \endlist + + To remove all but the currently selected split view: + + \list + \li Go to \uicontrol Window > \uicontrol {Remove All Splits}. + \li Press \key {Ctrl+E, 1}. + \endlist + + \sa {Edit Code}{How To: Edit Code}, {Detach views}, {Edit Mode} +*/ + +/*! + \page creator-how-to-use-bookmarks.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-edit + + \title Bookmark code To insert or delete a bookmark in the \uicontrol Edit mode: @@ -219,31 +582,33 @@ \image qtcreator-togglebookmark.png - \section2 Adding Notes to Bookmarks + \section1 Add notes to bookmarks To add a note to a bookmark: \list - \li Select \uicontrol Tools > \uicontrol Bookmarks > + \li Go to \uicontrol Tools > \uicontrol Bookmarks > \uicontrol {Edit Bookmark}. \li Press \key {Ctrl+Shift+M}. - \li Right-click a bookmark and select \uicontrol {Edit Bookmark} + \li Right-click a bookmark and go to \uicontrol {Edit Bookmark} in the context menu. \endlist To view the note, move the mouse pointer over the bookmark or open the \uicontrol Bookmarks view in the \l{Show and hide sidebars}{sidebar}. - \section2 Navigating Bookmarks + \section1 Navigate bookmarks - To go to the previous bookmark in the current session, select + To move to the previous bookmark in the current session, go to \uicontrol Tools > \uicontrol Bookmarks > \uicontrol {Previous Bookmark} or press \key {Ctrl+,}. - To go to the next bookmark in the current session, select \uicontrol Tools > + To move to the next bookmark in the current session, go to \uicontrol Tools > \uicontrol Bookmarks > \uicontrol {Previous Bookmark} or press \key {Ctrl+.}. + \section2 Locate bookmarks + To use the locator to go to a bookmark, press \key {Ctrl+K} (or \key {Cmd+K} on \macos) to open the locator. Enter \e b and a space to display a list of bookmarks. To filter the bookmarks by line number or a text string, enter @@ -252,80 +617,66 @@ \image qtcreator-locator-bookmark-filtering.png "Filtering bookmarks in locator" - \section2 Viewing Bookmarks + \section1 View bookmarks - Bookmarks are listed in the \uicontrol Bookmarks view in the sidebar. To + The \uicontrol Bookmarks view in the sidebar lists bookmarks. To move between bookmarks, select the \uicontrol {Previous Bookmark} or \uicontrol {Next Bookmark} button or use the keyboard shortcuts. \image qtcreator-bookmarks-view.png "Listing bookmarks in Bookmarks view" + \sa {Edit Code}{How To: Edit Code}, {Edit Mode} +*/ - \section1 Moving to Symbol Definition or Declaration +/*! + \page creator-how-to-reparse-files.html + \previouspage creator-how-tos.html - You can move directly to the definition or the declaration of a symbol - in the \uicontrol Edit mode by - holding the \key Ctrl key and clicking the symbol. If you have multiple - splits opened, you can open the link in the next split by holding \key Ctrl - and \key Alt while clicking the symbol. + \ingroup creator-how-to-edit - To enable this moving function, select \preferences > \uicontrol {Text Editor} - > \uicontrol Behavior > \uicontrol {Enable mouse navigation}. + \title Parse files - There are several additional ways of moving between symbol definitions and - declarations. All the functions described below are also available from the - \uicontrol Tools > \uicontrol C++ menu. The functions supported for QML and - JavaScript code are available from the \uicontrol Tools > \uicontrol QML/JS - menu. + When you open a project, \QC parses the source files in the project and + performs a semantic analysis to build up the information that it needs for + code editing services, such as navigation and finding usages. - You can select the symbol and press \key F2, or right-click the symbol - and select \uicontrol {Follow Symbol Under Cursor} to move to its definition - or declaration. To follow the symbol in the next split, select - \uicontrol {Follow Symbol Under Cursor in Next Split}. Following symbols is - supported for namespaces, classes, functions, variables, include statements, - and macros. + \section1 Select parse context - To move to the type definition of a symbol, select - \uicontrol {Follow Symbol Under Cursor to Type} or press - \key {Ctrl+Shift+F2}. To follow the symbol in the next split, select - \uicontrol {Follow Symbol Under Cursor to Type in Next Split} or - press \key {Ctrl+E, Ctrl+Shift+F2}. + Code might be interpreted differently in different contexts. A file can be + used by different projects or subprojects with different defines, or it can + be included in the context of C, C++, Objective-C, or Objective-C++. - When the cursor is on a string literal and the string is a QRC file path, - following the symbol opens the specified resource file for editing in the - \uicontrol {Resource Browser}. + To change the active parse context, select an available parse context on the + \uicontrol Edit mode toolbar in \uicontrol #. The button is visible only when + several parse contexts are available. - To switch between the definition and declaration of a function, place the - cursor on either and press \key {Shift+F2} or right-click and select - \uicontrol {Switch Between Function Declaration/Definition} or - \uicontrol {Open Function Declaration/Definition in Next Split}. - For example, this allows you to navigate from anywhere within a function - body directly to the function declaration. + \image qtcreator-editor-open-files.webp {Edit mode toolbar} - Links are opened in the same split by default. To open links in the next - split, prepend \key {Ctrl+E} to the shortcut. For example, press - \key {Ctrl+E,F2} to follow the symbol in the next split. If necessary, the - view is automatically split. To change the default behavior, select - \preferences > \uicontrol {Text Editor} > \uicontrol Display > - \uicontrol {Always open links in another split}. - Additional symbols are - displayed and switching between definition and declaration is done in - another split. If you change the default behavior, the shortcuts for opening - link targets in the next split are used to open them in the current split. + To reset the parse context, go to \uicontrol # > + \uicontrol {Clear Preferred Parse Context}. - To switch between C++ header and source files, right-click anywhere in a - file and select \uicontrol {Switch Header/Source} or - \uicontrol {Open Corresponding Header/Source in Next Split}. You can also - press \key F4 or \key {Ctrl+E,F4}, respectively. + If the information needed for parsing the project is still incomplete or + incorrect, go to \uicontrol {Additional Preprocessor Directives} to + add preprocessor directives. - \section1 Reparsing Externally Changed Files + \section1 Reparse externally changed files - If source files are modified from outside \QC, the opened files will be - reparsed automatically. For all other files, you can use \uicontrol Tools > + If source files are modified from outside \QC, the open files (1) are + reparsed automatically. To update other files, go to \uicontrol Tools > \uicontrol {C++} > \uicontrol {Reparse Externally Changed Files} to update the code model. - \section1 Inspecting the Code Model + \sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Clang Code Model}, + {Code Model} +*/ + +/*! + \page creator-how-to-inspect-code-model.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-edit + + \title Inspect the code model When you \l{https://bugreports.qt.io/}{report a bug} that is related to the C++ code model, the \QC developers might ask you to write information about @@ -337,11 +688,15 @@ select \uicontrol Tools > \uicontrol {Debug \QC } > \uicontrol {Inspect C++ Code Model} or press \key {Ctrl+Shift+F12}. + \image qtcreator-code-model-inspector.webp {Code Model Inspector dialog} + \QC generates the code model inspection log file in a temporary folder. - \QC underlines semantic errors in olive in the C++ code editor. To check the - correct paths for includes that are not resolved or that are resolved to the - wrong file, select \uicontrol {Project Parts} > \uicontrol {Header Paths}. + \QC underlines semantic errors in olive in the C++ code editor in the + \uicontrol Edit mode. To check the correct paths for includes that are not + resolved or that are resolved to the wrong file, + go to \uicontrol {Project Parts} > \uicontrol {Header Paths}. - \sa {Detach views} + \sa {Edit Code}{How To: Edit Code}, {Edit Mode}, {Clang Code Model}, + {Code Model} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdoc similarity index 77% rename from doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc rename to doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdoc index d7e74fc9128..4bc641fb091 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdocinc +++ b/doc/qtcreator/src/editors/creator-only/creator-compilation-database.qdoc @@ -1,10 +1,13 @@ -// Copyright (C) 2020 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! -//! [using compilation databases] + \page creator-how-to-use-compilation-databases.html + \previouspage creator-how-tos.html - \section1 Using Compilation Databases + \ingroup creator-how-to-build + + \title Use compilation databases The \l{https://clang.llvm.org/docs/JSONCompilationDatabase.html} {JSON compilation database format} specifies how to replay single builds @@ -31,10 +34,8 @@ \uicontrol C++ > \uicontrol {Switch Header/Source}. You can specify custom build steps and run settings for compilation - database projects in the \uicontrol Projects mode. For more information, - see \l{Adding Custom Build Steps} and \l {Specifying Run Settings}. + database projects in the \uicontrol Projects mode. - \sa {Enable and disable plugins} - -//! [using compilation databases] + \sa {Enable and disable plugins}, {Add custom build steps}, + {Configure projects for running}, {Code Model} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc index 6717a526199..8855d4017fa 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-copilot.qdoc @@ -70,14 +70,15 @@ \section1 Receiving Suggestions - When you write code in the \l {Working in Edit Mode}{Edit} mode and + When you write code in the \l {Edit Mode}{Edit} mode and \uicontrol {Auto request} is enabled, Copilot automatically makes suggestions when you type. \image qtcreator-copilot.gif {Receiving suggestions from Copilot in the editor} To manually request a suggestion at the current editor's cursor position, - select \uicontrol {Request Copilot Suggestion} in the context menu. + enter \uicontrol {t} (\uicontrol {Request Copilot Suggestion}) in the + \l{Searching with the Locator}{locator}. Hover the mouse over a suggestion to show a toolbar with \inlineimage icons/prev.png diff --git a/doc/qtcreator/src/editors/creator-only/creator-cpp-quick-fixes.qdoc b/doc/qtcreator/src/editors/creator-only/creator-cpp-quick-fixes.qdoc new file mode 100644 index 00000000000..0651d02ae38 --- /dev/null +++ b/doc/qtcreator/src/editors/creator-only/creator-cpp-quick-fixes.qdoc @@ -0,0 +1,803 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only + +/*! + \page creator-reference-preferences-cpp-quick-fixes.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences-cpp + + \title Quick Fixes + + \brief Set global preferences for C++ quick fixes. + + To set global preferences for C++ quick fixes, go to \preferences > + \uicontrol C++ > \uicontrol {Quick Fixes}. + + \section1 Function Locations + + In the \uicontrol {Generated Function Locations} group, set + whether quick fixes should generate getter and setter functions + in the header file (inside or outside the class) or in the implementation + file. + + \image qtcreator-preferences-quick-fixes-function-locations.webp {Generated Function Locations group in Quick Fixes preferences} + + \section1 Function Names and Attributes + + In the \uicontrol {Getter Setter Generation Properties} group, + specify additional settings for getter and setter names, attributes, and + parameters. You can specify that setter functions should be created as + \e slots and that signals should be generated with the new value as a + parameter. + + \image qtcreator-refactoring-options-generation.png {Getter and Setter generation settings} + + \section1 Namespace Handling + + In the \uicontrol {Missing Namespace Handling} group, select whether to + generate missing namespaces, add \c {using namespace} where necessary, or + rewrite types to match the existing namespaces. + + \image qtcreator-refactoring-options-namespaces.png "Namespace handling settings" + + \section1 Custom Parameter Types + + In the \uicontrol {Custom Getter Setter Templates} group, specify how the + code of a getter or setter function for a certain data type should look + like. This is necessary for types where assignment cannot use \c operator=, + as in the pre-defined settings for \c unique_ptr or where \c operator== is + not suitable for comparison, as in the pre-defined settings for + floating-point types. For example, if you have a special type \c MyClass, + you can specify that a function, \c myCompare, should be used for comparison + rather than the default of \c ==. + + To specify special handling for a custom parameter type, select + \uicontrol Add and set the parameter type, comparison, return expression, + and return type. In the \uicontrol {Return type} field, use \c + and \c to access the parameter and current value. Use \c to + access the type and \c for the template parameter. + + \image qtcreator-refactoring-options-templates.png {Settings for handling custom parameter types} + + Usually, arguments are passed by using a \c const reference. To pass + arguments of a particular type as values, list them in the + \uicontrol {Value types} field. Namespaces and template arguments are + removed. The real Type must contain the given Type. For example, \c int + matches \c int32_t but not \c vector, and \c vector matches + \c {std::pmr::vector} but not \c {std::optional>}. + + To return non-trivial objects by using a \c const reference, select the + \uicontrol {Return non-value types by const reference} check box. + + \sa {Apply quick fixes}, {Specify settings for quick fixes}, + {C++ Quick Fixes}, {QML Quick Fixes}, {Refactoring} +*/ + +/*! + \page creator-reference-cpp-quick-fixes.html + \previouspage creator-reference.html + + \ingroup creator-reference + + \title C++ Quick Fixes + + \brief Summary of quick fixes for C++ code. + + If you use the \l{Clang Code Model}{Clang code model} to parse the C++ files, + you get \l{http://clang.llvm.org/diagnostics.html}{Clang fix-it hints} in the + \uicontrol Edit mode. Use the standard ways of activating quick fixes, or + select the fixes that are applicable on a line in the context menu in the + left margin of the code editor. + + Apply the following types of quick fixes to C++ code: + + \list + \li Change binary operands + \li Simplify if and while conditions (for example, move declarations out + of if conditions) + \li Modify strings (for example, set the encoding for a string to + Latin-1, mark strings translatable, and convert symbol names to + camel case) + \li Create variable declarations + \li Create function declarations and definitions + \endlist + + The following table summarizes the quick fixes for C++ code. The + fix is available when the cursor is in the position described in the + Activation column. + + \table + \header + \li Quick Fix + \li Description + \li Activation + \row + \li Add Curly Braces + \li Adds curly braces to an if statement that does not have a + compound statement. For example, rewrites + + \code + if (a) + b; + \endcode + + as + + \code + if (a) { + b; + } + \endcode + \li \c if + \row + \li Move Declaration out of Condition + \li Moves a declaration out of an if or while condition to simplify + the condition. For example, rewrites + + \code + if (Type name = foo()) {} + \endcode + + as + + \code + Type name = foo; + if (name) {} + \endcode + \li Name of the introduced variable + \row + \li Rewrite Condition Using || + \li Rewrites the expression according to De Morgan's laws. For + example, rewrites: + \code + !a && !b + \endcode + + as + + \code + !(a || b) + \endcode + \li \c && + \row + \li Rewrite Using \e operator + \li Rewrites an expression negating it and using the inverse + operator. For example, rewrites: + + \list + + \li \code + a op b + \endcode + + as + + \code + !(a invop b) + \endcode + + \li \code + (a op b) + \endcode + + as + + \code + !(a invop b) + \endcode + + \li \code + !(a op b) + \endcode + + as + + \code + (a invob b) + \endcode + + \endlist + + \li \c {<=}, \c {<}, \c {>}, \c {>=}, \c {==} or \c {!=} + \row + \li Split Declaration + \li Splits a simple declaration into several declarations. For + example, rewrites: + \code + int *a, b; + \endcode + + as + + \code + int *a; + int b; + \endcode + \li Type name or variable name + \row + \li Split if Statement + \li Splits an if statement into several statements. For example, + rewrites: + + \code + if (something && something_else) { + } + \endcode + + as + + \code + if (something) { + if (something_else) { + } + } + \endcode + + and + + \code + if (something || something_else) + x; + \endcode + + with + + \code + if (something) + x; + else if (something_else) + x; + \endcode + + \li \c && or \c || + \row + \li Swap Operands + \li Rewrites an expression in the inverse order using the inverse + operator. For example, rewrites: + \code + a op b + \endcode + + as + \code + b flipop a + \endcode + \li \c {<=}, \c {<}, \c {>}, \c {>=}, \c {==}, \c {!=}, \c {&&} + or \c {||} + \row + \li Convert to Decimal + \li Converts an integer literal to decimal representation + \li Numeric literal + \row + \li Convert to Hexadecimal + \li Converts an integer literal to hexadecimal representation + \li Numeric literal + \row + \li Convert to Octal + \li Converts an integer literal to octal representation + \li Numeric literal + \row + \li Convert to Objective-C String Literal + \li Converts a string literal to an Objective-C string literal if + the file type is Objective-C(++). For example, rewrites the + following strings + + \code + "abcd" + QLatin1String("abcd") + QLatin1Literal("abcd") + \endcode + + as + + \code + @"abcd" + \endcode + \li String literal + \row + \li Enclose in QLatin1Char() + \li Sets the encoding for a character to Latin-1, unless the + character is already enclosed in QLatin1Char, QT_TRANSLATE_NOOP, + tr, trUtf8, QLatin1Literal, or QLatin1String. For example, + rewrites + + \code + 'a' + \endcode + + as + + \code + QLatin1Char('a') + \endcode + \li String literal + \row + \li Enclose in QLatin1String() + \li Sets the encoding for a string to Latin-1, unless the string is + already enclosed in QLatin1Char, QT_TRANSLATE_NOOP, tr, trUtf8, + QLatin1Literal, or QLatin1String. For example, rewrites + \code + "abcd" + \endcode + + as + + \code + QLatin1String("abcd") + \endcode + + \li String literal + + \row + \li Mark as Translatable + \li Marks a string translatable. For example, rewrites \c "abcd" + with one of the following options, depending on which of them is + available: + + \code + tr("abcd") + QCoreApplication::translate("CONTEXT", "abcd") + QT_TRANSLATE_NOOP("GLOBAL", "abcd") + \endcode + + \li String literal + + \row + \li Add Definition in ... + \li Inserts a definition stub for a function declaration either in + the header file (inside or outside the class) or in the + implementation file. For free functions, inserts the definition + after the declaration of the function or in the implementation + file. Qualified names are minimized when possible, instead of + always being fully expanded. + + For example, rewrites + + \code + Class Foo { + void bar(); + }; + \endcode + + as (inside class) + + \code + Class Foo { + void bar() { + + } + }; + \endcode + + as (outside class) + + \code + Class Foo { + void bar(); + }; + + void Foo::bar() + { + + } + \endcode + + as (in implementation file) + + \code + // Header file + Class Foo { + void bar(); + }; + + // Implementation file + void Foo::bar() + { + + } + \endcode + + \li Function name + \row + \li Add \c Function Declaration + \li Inserts the member function declaration that matches the member + function definition into the class declaration. The function can + be \c {public}, \c {protected}, \c {private}, \c {public slot}, + \c {protected slot}, or \c {private slot}. + \li Function name + \row + \li Add Class Member + \li Adds a member declaration for the class member being + initialized if it is not yet declared. If \QC cannot + automatically detect the data type of the member, you + must add it. + \li Identifier + \row + \li Create Implementations for Member Functions + \li Creates implementations for all member functions in one go. + In the \uicontrol {Member Function Implementations} dialog, + specify whether the member functions are generated + inline or outside the class. + \li Function name + \row + \li Switch with Next/Previous Parameter + \li Moves a parameter down or up one position in a parameter list. + \li Parameter in the declaration or definition of a function + \row + \li Extract Function + \li Moves the selected code to a new function and replaces the block + of code with a call to the new function. Enter a name for the + function in the \uicontrol {Extract Function Refactoring} + dialog. + \li Block of code selected + \row + \li Extract Constant as Function Parameter + \li Replaces the selected literal and all its occurrences with the + function parameter \c{newParameter}. The parameter + \c{newParameter} will have the original literal as the default + value. + \li Block of code selected + \row + \li Add Local Declaration + \li Adds the type of an assignee, if the type of the right-hand + side of the assignment is known. For example, rewrites + + \code + a = foo(); + \endcode + + as + + \code + Type a = foo(); + \endcode + + where Type is the return type of \c {foo()} + + \li Assignee + + \row + \li Convert to Camel Case + \li Converts a symbol name to camel case, where elements of the name + are joined without delimiter characters and the initial + character of each element is capitalized. For example, rewrites + \c an_example_symbol as \c anExampleSymbol and + \c AN_EXAMPLE_SYMBOL as \c AnExampleSymbol + \li Identifier + \row + \li Complete Switch Statement + \li Adds all possible cases to a switch statement of the type + \c enum + \li \c switch + \row + \li Generate Missing Q_PROPERTY Members + \li Adds missing members to a \c Q_PROPERTY: + \list + \li \c read function + \li \c write function, if there is a WRITE + \li \c {onChanged} signal, if there is a NOTIFY + \li data member with the name \c {m_} + \endlist + \li \c Q_PROPERTY + \row + \li Generate Q_PROPERTY and Missing Members + \li Generates a Q_PROPERTY and adds missing members to it, as + described above. + \li Class member + \row + \li Generate Constant Q_PROPERTY and Missing Members + \li Generates a constant Q_PROPERTY and adds missing members + to it, as described above. + \li Class member + \row + \li Generate Q_PROPERTY and Missing Members with Reset Function + \li Generates a Q_PROPERTY and adds missing members to it, as + described above, but with an additional \c reset function. + \li Class member + \row + \li Apply Changes + \li Keeps function declarations and definitions synchronized by + checking for the matching declaration or definition when you + edit a function signature and by applying the changes to the + matching code. + \li Function signature. When this fix is available, a light bulb + icon appears: \inlineimage icons/refactormarker.png + \row + \li Add #include for undeclared or forward declared identifier + \li Adds an \c {#include} directive to the current file to make the + definition of a symbol available. + \li Undeclared identifier + \row + \li Add Forward Declaration + \li Adds a forward declaration for an undeclared identifier + operation. + \li Undeclared identifier + \row + \li Reformat Pointers or References + \li Reformats declarations with pointers or references according + to the code style settings for the current project. In case no + project is open, the current global code style settings are + used. + + For example, rewrites: + + \code + char*s; + \endcode + + as + + \code + char *s; + \endcode + + When applied to selections, all suitable declarations in the + selection are rewritten. + + \li Declarations with pointers or references and selections + that have such declarations + \row + \li Create Getter and Setter Member Functions + \li Creates either both getter and setter member functions for + member variables or only a getter or setter. + \li Member variable in class definition + \row + \li Generate Getter and Setter + \li Creates getter and setter member functions for a member + variable. + \li Member variable in class definition + \row + \li Generate Getter + \li Creates a getter member function for a member variable. + \li Member variable in class definition + \row + \li Generate Setter + \li Creates a setter member function for a member variable. + \li Member variable in class definition + \row + \li Generate Constructor + \li Creates a constructor for a class. + \li Class definition + \row + \li Move Function Definition + \li Moves a function definition to the implementation file, outside + the class or back to its declaration. For example, rewrites: + \code + class Foo + { + void bar() + { + // do stuff here + } + }; + \endcode + + as + \code + class Foo + { + void bar(); + }; + + void Foo::bar() { + // do stuff here + } + \endcode + + \li Function signature + \row + \li Move All Function Definitions + \li Moves all function definitions to the implementation file or + outside the class. For example, rewrites: + \code + class Foo + { + void bar() + { + // do stuff here + } + void baz() + { + // do stuff here + } + }; + \endcode + + as + + \code + class Foo + { + void bar(); + void baz(); + }; + + void Foo::bar() { + // do stuff here + } + + void Foo::baz() { + // do stuff here + } + \endcode + + \li Class name + \row + \li Move Definition Here + \li Moves an existing function definition to its declaration. + \li Function declaration + \row + \li Assign to Local Variable + \li Adds a local variable which stores the return value of a + function call or a new expression. For example, rewrites: + + \code + QString s; + s.toLatin1(); + \endcode + + as + + \code + QString s; + QByteArray latin1 = s.toLatin1(); + \endcode + + and + + \code + new Foo; + \endcode + + as + + \code + Foo * localFoo = new Foo; + \endcode + + By default, \QC uses the \c auto variable type when creating the + variable. To label the variable with its actual type, select + \preferences > \uicontrol C++ > + \uicontrol {Quick Fixes}, and then deselect the + \uicontrol {Use type "auto" when creating new variables} check + box. + + \li Function call or class name + \row + \li Insert Virtual Functions of Base Classes + \li Inserts declarations and the corresponding definitions inside or + outside the class or in an implementation file (if it exists). + For more information, see \l{Insert virtual functions}. + \li Class or base class name + \row + \li Optimize for-Loop + \li Rewrites post increment operators as pre increment operators and + post decrement operators as pre decrement operators. It also + moves other than string or numeric literals and id expressions + from the condition of a for loop to its initializer. For + example, rewrites: + + \code + for (int i = 0; i < 3 * 2; i++) + \endcode + + as + + \code + for (int i = 0, total = 3 * 2; i < total; ++i) + \endcode + \li \c for + + \row + \li Escape String Literal as UTF-8 + \li Escapes non-ASCII characters in a string literal to hexadecimal + escape sequences. String Literals are handled as UTF-8. + \li String literal + + \row + \li Unescape String Literal as UTF-8 + \li Unescapes octal or hexadecimal escape sequences in a string + literal. String Literals are handled as UTF-8. + \li String literal + + \row + \li Convert to Stack Variable + \li Converts the selected pointer to a stack variable. For example, + rewrites: + + \code + QByteArray *foo = new QByteArray("foo"); + foo->append("bar"); + \endcode + + as + + \code + QByteArray foo("foo"); + foo.append("bar"); + \endcode + + This operation is limited to work only within function scope. + Also, the coding style for pointers and references is not + respected yet. + \li Pointer Variable + + \row + \li Convert to Pointer + \li Converts the selected stack variable to a pointer. For example, + rewrites: + + \code + QByteArray foo = "foo"; + foo.append("bar"); + \endcode + + as + + \code + QByteArray *foo = new QByteArray("foo"); + foo->append("bar"); + \endcode + + This operation is limited to work only within function scope. + Also, the coding style for pointers and references is not + respected yet. + \li Stack Variable + \row + \li Remove \c {using namespace} and Adjust Type Names Accordingly + \li Remove occurrences of \c {using namespace} in the local scope + and adjust type names accordingly. + \li \c using directive + \row + \li Remove All Occurrences of \c {using namespace} in Global Scope + and Adjust Type Names Accordingly + \li Remove all occurrences of \c {using namespace} in the global + scope and adjust type names accordingly. + \li \c using directive + \row + \li Convert connect() to Qt 5 Style + \li Converts a Qt 4 QObject::connect() to Qt 5 style. + \li QObject::connect() (Qt 4 style) + \row + \li Convert Comment to C/C++ Style + \li Converts C-style comments into C++-style comments, and vice + versa. Tries to preserve \e pretty layout and takes Doxygen and + qdoc formatting into consideration, but you might need to clean + up the results. + \li Code comment + \row + \li Move Function Documentation to Declaration/Definition + \li Moves the documentation comment for a function between its + declaration and definition. + \li Documentation comment for a function + \endtable + + \sa {Apply quick fixes}, {Specify settings for quick fixes}, + {QML Quick Fixes}, {Quick Fixes}, {Refactoring} +*/ + +/*! + \page creator-how-to-specify-settings-for-quick-fixes.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-projects-configure + + \title Specify settings for quick fixes + + To refactor your code, select quick fixes in the context menu in the + \uicontrol Edit mode. + + To create custom quick fix settings for a particular project, go to + \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {Quick Fixes} and clear \uicontrol {Use global settings}. + + \image qtcreator-refactoring-options-locations.png {Quick Fixes preferences} + + To revert to global settings, select \uicontrol {Reset to Global}. To + delete the custom settings, select \uicontrol {Use global settings}, and + then select \uicontrol {Delete Custom Settings File}. + + \sa {Apply quick fixes}, {C++ Quick Fixes}, {QML Quick Fixes}, {Quick Fixes}, + {Configuring Projects}, {Refactoring} +*/ diff --git a/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc b/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc index 59c613a8fbe..63295aa1145 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-fakevim.qdoc @@ -1,24 +1,46 @@ -// Copyright (C) 2021 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-editor-options-text.html + \page creator-how-to-edit-vim-style.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-configure-editors + + \title Edit like in Vim + + To run the main editor in a manner similar to the Vim editor, go to + \uicontrol Edit > \uicontrol Advanced and select \uicontrol {Use FakeVim}, + or press \key {Alt+Y,Alt+Y}. + + \section1 Escape FakeVim mode + + To temporarily escape FakeVim mode to access the normal \QC keyboard + shortcuts like \key {Ctrl-R} for \uicontrol Run, press the comma + key (\key {,}) before pressing the shortcut. + + \section1 Quit FakeVim mode + + To quit the FakeVim mode, go to \uicontrol Edit > \uicontrol Advanced and + clear \uicontrol {Use FakeVim}, or press \key {Alt+Y,Alt+Y}. + + \sa {FakeVim Modes and Commands}, {FakeVim}, {Change editor colors} +*/ + +/*! \page creator-editor-fakevim.html - \nextpage creator-markdown-editor.html + \previouspage creator-reference.html - \title Using FakeVim Mode + \ingroup creator-reference - In the \uicontrol FakeVim mode, you can run the main editor in a manner - similar to the Vim editor. To run the editor in the \uicontrol FakeVim - mode, select \uicontrol Edit > \uicontrol Advanced > - \uicontrol {Use Vim-style Editing} or press \key {Alt+V,Alt+V}. + \title FakeVim Modes and Commands - \section1 Supported Modes and Commands + \brief Supported Vim modes and emulated commands. - In the \uicontrol FakeVim mode, most keystrokes in the main editor will be + In the \uicontrol FakeVim mode, most keystrokes in the main editor are intercepted and interpreted in a way that resembles Vim. Most of the supported commands can be followed by a motion command or executed in visual - mode, or they work with registers or can be prefixed with a number of + mode, or they work with registers, or can be prefixed with a number of repetitions. The following sections describe the commands emulated in the supported modes @@ -31,10 +53,10 @@ \li Insert and replace \endlist - For more information on using Vim, see \l{http://www.vim.org/docs.php} + For more information about using Vim, see \l{http://www.vim.org/docs.php} {Documentation} on the Vim web site. - \section2 Normal and Visual Modes + \section1 Normal and Visual Modes \list \li Basic movement, such as \c h/j/k/l, \c , \c , \c , @@ -66,7 +88,7 @@ \li Wrap line movement, such as \c gj, \c gk, \c g0, \c g^, \c g$ \endlist - \section2 Command-Line Mode + \section1 Command-Line Mode \list \li \c :map, \c :unmap, \c :inoremap, and so on @@ -90,34 +112,7 @@ Currently supported letters: \c fo-j \endlist - \section2 Plugin Emulation - - FakeVim also emulates some popular vim plugins. To enable plugin emulation - for particular plugins, select \preferences > - \uicontrol FakeVim > \uicontrol General > \uicontrol {Plugin Emulation}. - - \image qtcreator-fakevim-options-general-plugin-emulation.png "FakeVim Plugin Emulation preferences" - - Currently emulated plugins: - \list - \li \l{https://github.com/tpope/vim-commentary}{vim-commentary}: \c gc - action to comment code regions. For example, \c gcc, \c gc2j, \c gcip - \li - \l{https://github.com/vim-scripts/ReplaceWithRegister}{ReplaceWithRegister}: - \list - \li \c [count]["x]gr{motion} to replace \c {motion} with the contents of - register \c x. - \li ["x]grr to replace the current line. - \endlist - \li \l{https://github.com/vim-scripts/argtextobj.vim}{argtextobj.vim}: - Defines the \c ia and \c aa text objects for function parameters. - \li \l{https://github.com/tommcdo/vim-exchange}{vim-exchange}: - A text exchange operator for vim. - \li \l{https://github.com/tpope/vim-surround}{vim-surround}: - Adds mappings for deleting, adding and changing surroundings. - \endlist - - \section2 Insert Mode + \section1 Insert Mode \list \li \c executes a single command and returns to insert mode @@ -125,7 +120,7 @@ \li \c toggles replace mode \endlist - \section2 Options + \section1 Options Use \c {:set ...} to set the options listed in the following table: @@ -221,7 +216,7 @@ \li \endtable - \section2 Vimrc Example + \section1 Vimrc Example \code " highlight matched @@ -266,54 +261,107 @@ vnoremap :m-2gv=gv \endcode + \sa {Edit like in Vim}, {FakeVim} +*/ + +/*! + \page creator-reference-preferences-fakevim.html + \previouspage creator-reference.html + + \ingroup creator-reference-preferences + + \title FakeVim + + \brief Set indentation for Vim-style editing and map vim commands + to \QC functions. + + To set prerences for Vim-style editing, go to \preferences > + \uicontrol FakeVim. + + \section1 Setting Vim Behavior + + To set Vim behavior, go to \preferences > \uicontrol FakeVim > + \uicontrol General. + + \image qtcreator-preferences-fakevim-general.webp {FakeVim General preferences} + + To use presets: + + \list + \li To preselect the indentation settings specified for the text editor, + select \uicontrol {Copy Text Editor Settings}. + \li To preselect the Qt coding style, select \uicontrol {Set Qt Style}. + \li To preselect a simple indentation style, select + \uicontrol {Set Plain Style}. + \endlist + + Then change the preselected settings. + + \section1 Emulating Plugins + + Select popular vim plugins to emulate in \uicontrol {Plugin Emulation}. + + The following table describes the available plugins with links to them. + + \table + \header + \li Vim Plugin + \li Description + \row + \li \l{https://github.com/tpope/vim-commentary}{vim-commentary} + \li \c gc action to comment code regions. For example, \c gcc, \c gc2j, + \c gcip + \row + \li \l{https://github.com/vim-scripts/ReplaceWithRegister} + {ReplaceWithRegister} + \li + \list + \li \c [count]["x]gr{motion} to replace \c {motion} with the + contents of register \c x. + \li ["x]grr to replace the current line. + \endlist + \row + \li \l{https://github.com/vim-scripts/argtextobj.vim}{argtextobj.vim} + \li Defines the \c ia and \c aa text objects for function parameters. + \row + \li \l{https://github.com/tommcdo/vim-exchange}{vim-exchange} + \li A text exchange operator for vim. + \row + \li \l{https://github.com/tpope/vim-surround}{vim-surround} + \li Adds mappings for deleting, adding, and changing surroundings. + \endtable + \section1 Mapping FakeVim Commands To map commands entered on the \uicontrol FakeVim command line to - \QC functions, select \preferences > \uicontrol FakeVim > - \uicontrol {Ex Command Mapping}. - Enter a string in the \uicontrol Filter field to search for a specific - \QC function. + \QC functions: - \image qtcreator-fakevim-options-ex-command-mapping.png "FakeVim Ex Command Mapping preferences" + \list 1 + \li Go to \preferences > \uicontrol FakeVim > + \uicontrol {Ex Command Mapping}. + \li Enter a string in the \uicontrol Filter field to find a \QC function. + \image qtcreator-fakevim-options-ex-command-mapping.png {FakeVim Ex Command Mapping preferences} + \li Select a function in the list + \li In the \uicontrol {Regular expression} field, nter a string that will + trigger the function. - Select a function in the list, and enter a string that will trigger the - function in the \uicontrol {Regular expression} field. You can view the - trigger expression in the \uicontrol {Ex Trigger Expression} field. To - remove the trigger expression, select \uicontrol Reset. + You can see the trigger expression in the + \uicontrol {Ex Trigger Expression} field. + \endlist + + To remove the selected trigger expression, select \uicontrol Reset. To reset the trigger expressions for all functions, select \uicontrol {Reset All}. - To map \e {user commands} to keyboard shortcuts, select \preferences > + \section1 Mapping User Commands + + To map \e {user commands} to keyboard shortcuts, go to \preferences > \uicontrol FakeVim > \uicontrol {User Command Mapping}. The user command mapped to the shortcut is executed by FakeVim as if you were typing it (as when replaying a macro). - \image qtcreator-fakevim-options-user-command-mapping.png "FakeVim User Command Mapping preferences" + \image qtcreator-fakevim-options-user-command-mapping.png {FakeVim User Command Mapping preferences} - \section1 Setting FakeVim Preferences - - To make changes to the Vim-style settings, select \preferences > - \uicontrol FakeVim > \uicontrol General. - - \image qtcreator-fakevim-options.png "FakeVim preferences" - - To preselect the indentation settings specified for the text editor, select - \uicontrol {Copy Text Editor Settings}. To preselect the Qt coding style, - select \uicontrol {Set Qt Style}. To preselect a simple indentation style, - select \uicontrol {Set Plain Style}. You can then change any of the - preselected settings. - - To use a Vim-style color scheme, select \preferences > - \uicontrol {Text Editor} > \uicontrol {Fonts & Color}. - In the \uicontrol {Color Scheme} list, select \uicontrol {Vim (dark)}. - - \section1 Quitting FakeVim Mode - - To quit the FakeVim mode, deselect \preferences > - \uicontrol FakeVim > \uicontrol {Use FakeVim} or press \key {Alt+V,Alt+V}. - - You can temporarily escape FakeVim mode to access the normal \QC keyboard - shortcuts like \key {Ctrl-R} for \uicontrol Run by first pressing the comma - key (\key {,}). + \sa {Edit like in Vim}, {FakeVim Modes and Commands} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc index 0a89789d4a7..80c50359f69 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-language-server.qdoc @@ -1,35 +1,40 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-markdown-editor.html \page creator-language-servers.html - \nextpage creator-copilot.html + \previouspage creator-reference.html - \title Using Language Servers + \ingroup creator-reference-editors + + \title Language Servers + + \brief Get code completion, highlighting of the symbol under cursor, and + jumping to the symbol definition in the editor for other programming + languages besides C++, as well as diagnostics. For several programming languages, a \e {language server} offers - information about the code to IDEs as long as they support + information about the code to IDEs as long as they support communication via the \l{Language Server Protocol} - {language server protocol (LSP)}. This enables the - IDE to offer the following services: + {language server protocol (LSP)}. The IDE can then offer the + following services: \list - \li \l{Completing Code}{Code completion} + \li \l{Complete code}{Code completion} \li Sending document formatting requests to the language server to automatically format documents using the settings specified in \preferences > \uicontrol {Text Editor} > \uicontrol Behavior \li Highlighting the symbol under cursor - \li \l{View function tooltips} + \li \l{View function tooltips}{Viewing function tooltips} \li \l{Semantic Highlighting}{Semantic highlighting}, as defined in \l{https://github.com/microsoft/vscode-languageserver-node/pull/367} {Proposal of the semantic highlighting protocol extension} \li Navigating in the code by using the \l{Searching with the Locator} - {locator} or \l{Moving to Symbol Definition or Declaration} + {locator} or \l{Move to symbol definition or declaration} {moving to the symbol definition} \li Inspecting code by viewing the document outline in the \l{Outline} view or in the \uicontrol Symbols list on the - \l{Using the Editor Toolbar}{editor toolbar} + \l{Edit Mode}{editor toolbar} \li \l{Call Hierarchy}{Viewing the callers and callees of a function} \li \l{Finding Symbols}{Finding references to symbols} \li \l{Renaming Symbols}{Renaming the symbol under cursor} @@ -52,29 +57,71 @@ type or file pattern, no files will be sent to the language server. This is done to avoid unnecessary traffic and inaccurate information, as files are only sent to the language server if they are known to be handled by it. For - more information about how \QC uses MIME types, see \l {Editing MIME Types}. + more information about how \QC uses MIME types, see + \l {Edit MIME types}. - \section1 Specifying Settings for Language Clients + \section1 Adding Language Servers - \QC supports adding a Java language server for - \l{Connecting Android Devices}{Android development}. A Python language - server is added by default and you can edit its preferences. - For other languages, you can add generic stdIO language servers. + \QC adds a Python language server by default. - To add language servers, select \preferences > - \uicontrol {Language Client} > \uicontrol Add. + Also, it offers to install language servers for JSON and YAML files + when you open them in the editor if it can find the + \l{https://nodejs.org/en/learn/getting-started/an-introduction-to-the-npm-package-manager} + {NPM} package manager on the computer. + + \image qtcreator-language-server-json.webp {Prompt to install JSON language server} + + Add a Java language server for \l{Connecting Android Devices} + {Android development}. For other languages, add generic stdIO language + servers. + + To add language servers, go to \preferences > \uicontrol {Language Client} + and select \uicontrol Add. + + \image qtcreator-language-client-options-java.png {Java language server preferences} To enable a language server, select the check box next to the language server name and set server preferences. To remove language servers from the list, select \uicontrol Delete. - \section2 Generic StdIO Language Server + \section1 Supported Locator Filters - To add a generic language server: + The locator enables you to browse not only files, but any items defined by + \e {locator filters}. The language client plugin supports the following + locator filters: + + \list + \li Locating symbols in the current project (\c {:}) + \li Locating symbols in the current document (\c {.}) + \li Locating class (\c {c}), enum, and function (\c {m}) + definitions in your project + \endlist + + \section1 Reporting Issues + + The language server client has been mostly tested with Python and C++. + If problems arise when you try them or some other language, please select + \uicontrol Help > \uicontrol {Report Bug} to report them in the + \l{https://bugreports.qt.io/}{Qt Project Bug Tracker}. The reports + should include \QC console output with the environment + variable \c {QT_LOGGING_RULES=qtc.languageclient.*=true} set. + + \sa {Manage Language Servers}{How To: Manage Language Servers}, {Behavior} +*/ + +/*! + \page creator-how-to-add-generic-language-servers.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-lsp + + \title Add generic language servers + + To add a generic StdIO language server: \list 1 - \li Select \preferences > \uicontrol {Language Client} > + \li Go to \preferences > \uicontrol {Language Client} > \uicontrol Add > \uicontrol {Generic StdIO Language Server} to add a generic language server. \image qtcreator-language-server-generic-stdio.png @@ -101,19 +148,29 @@ arguments. \endlist - \section2 Java Language Server + \sa {Manage Language Servers}{How To: Manage Language Servers}, + {Language Servers} +*/ - To add a Java language server: +/*! + \page creator-how-to-add-java-language-servers.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-lsp + + \title Add a Java language server + + To add a Java language server for developing Android applications: \list 1 - \li Select \preferences > \uicontrol {Language Client} > + \li Go to \preferences > \uicontrol {Language Client} > \uicontrol Add > \uicontrol {Java Language Server} to add a Java language server. - \image qtcreator-language-client-options-java.png "Java language server preferences" + \image qtcreator-language-client-options-java.png {Java language server preferences} \li In the \uicontrol Name field, enter a name for the language server. Select the \inlineimage icons/replace.png (\uicontrol {Variables}) button to use a variable for the server - name. For more information, see \l{Use Qt Creator variables}. + name. \li In the \uicontrol Java field, enter the path to the Java executable. \li In the \uicontrol {Java Language Server} field, enter the path to the Java language server \c .jar file. You can download the Java @@ -121,75 +178,94 @@ {Eclipse Downloads}. \endlist - \section2 Python Language Server + \sa {Manage Language Servers}{How To: Manage Language Servers}, + {Use Qt Creator variables}, {Language Servers} +*/ + +/*! + \page creator-how-to-configure-python-language-servers.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-lsp + + \title Configure Python language servers To set preferences for Python language servers: \list 1 - \li Select \preferences> \uicontrol Python > + \li Go to \preferences> \uicontrol Python > \uicontrol {Language Server Configuration} to select the Python language server plugins to use. - \image qtcreator-python-plugins.png "Python Language Server Configuration" + \image qtcreator-python-plugins.png {Python Language Server Configuration} \li Select \uicontrol Advanced to configure the plugins. - \image qtcreator-python-advanced.png "Python language server plugin configuration" + \image qtcreator-python-advanced.png {Python language server plugin configuration} \endlist For a complete list of configuration options, see \l{https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md} {Python Language Server Configuration}. - To disable the Python language server, deselect + To disable the Python language server, clear \uicontrol {Use Python Language Server}. - \section2 QML Language Server + \sa {Manage Language Servers}{How To: Manage Language Servers}, + {Develop Qt for Python applications}, {Language Servers} +*/ + +/*! + \page creator-how-to-use-qml-language-server.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-lsp + + \title Turn on QML Language Server Since Qt 6.4, the QML language server offers code completion and - issues warnings for QML. To use it, select \preferences > - \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} > + issues warnings for QML. To use it, go to \preferences > + \uicontrol {Qt Quick} > \uicontrol {QML/JS Editing} and select \uicontrol {Enable QML Language Server}. - To use advanced features, such as renaming and finding usages, select the - \uicontrol {Use QML Language Server advanced features} check box. + By default, enabling the QML language server will only enable warning messages + and code completion, while advanced features such as renaming and finding usages + will be handled by the embedded code model. + To disable the embedded code model and use the QML language server for everything, + select \uicontrol {Use QML Language Server advanced features}. - To use the latest version of the language server installed on your - system, select the - \uicontrol {Use QML Language Server from latest Qt version} check box. + Also,\QC tries to use the QML language server shipped with + the Qt version in your current kit. To override that behavior and always use the + QML language server of the highest registered Qt version, select + \uicontrol {Use QML Language Server from latest Qt version}. \image qtcreator-qml-js-editing.webp {QML/JS Editing preferences} - \sa {Enabling and Disabling Messages} + \sa {Manage Language Servers}{How To: Manage Language Servers}, + {Enabling and Disabling Messages}, {Language Servers} +*/ - \section1 Supported Locator Filters +/*! + \page creator-how-to-inspect-language-clients.html + \previouspage creator-how-tos.html - The locator enables you to browse not only files, but any items defined by - \e {locator filters}. The language client plugin supports the following - locator filters: + \ingroup creator-how-to-lsp - \list - \li Locating symbols in the current project (\c {:}) - \li Locating symbols in the current document (\c {.}) - \li Locating class (\c {c}), enum, and function (\c {m}) - definitions in your project - \endlist + \title Inspect language clients - \section1 Inspecting Language Clients - - \QC sends messages (\e Requests) to the language server and receives - responses that have the requested information if the language server is + \QC sends messages (\e requests) to a \l{Language Servers}{language server} and + receives responses that have the requested information if the language server is capable of handling the requests. To inspect the communication between \QC - and language servers and view server capabilities, select \uicontrol Tools + and language servers and to view server capabilities, select \uicontrol Tools > \uicontrol {Debug \QC} > \uicontrol {Inspect Language Clients}. - \image qtcreator-language-client-inspector-log.png "Language Client Inspector dialog" + \image qtcreator-language-client-inspector-log.webp {Language Client Inspector dialog} - The dialog shows a list of running language servers. The value of the - \uicontrol {Startup behavior} field in the language server preferences - determines when the server is started. The information displayed depends on - the language server. + Select a running language server in \uicontrol {Language Server}. The + information displayed depends on the language server. - Select the \inlineimage icons/languageclient.png - button on the \l{Managing Language Servers}{editor toolbar}, and then select - \uicontrol {Restart} to restart language servers. + For a generic language server, the value of the \uicontrol {Startup behavior} + field in the \l{Add generic language servers}{language server preferences} + determines when the server is started. To restart language servers, select + \inlineimage icons/languageclient.png on the \l{Edit Mode}{editor toolbar}, + and go to \uicontrol {Restart}. \uicontrol Log displays additional information about the selected log entry. You can see the \uicontrol {Content length} and \uicontrol {MIME type} of @@ -198,7 +274,7 @@ To remove old entries, select \uicontrol Clear. - \section2 Capabilities + \section1 Check language server capabilities In \uicontrol Capabilities, you can check whether a language server is capable of a specific task. You cannot modify the server capabilities @@ -207,24 +283,50 @@ You can view the \uicontrol Name, \uicontrol Value, and \uicontrol Type of the capability. - \image qtcreator-language-client-inspector-capabilities.png "Language Client Inspector Capabilities tab" + \image qtcreator-language-client-inspector-capabilities.webp {Language Client Inspector Capabilities tab} For some language servers, \uicontrol {Dynamic Capabilities} lists the \uicontrol Methods and \uicontrol Options available. - \section2 Memory Usage + \section1 Inspect memory usage For a clangd server, you can inspect the total amount of memory used by a particular component in \uicontrol {Memory Usage}. - \image qtcreator-language-client-inspector-memory-usage.png "Language Client Inspector Memory Usage tab" + \image qtcreator-language-client-inspector-memory-usage.webp {Language Client Inspector Memory Usage tab} - \section1 Reporting Issues - - The language server client has been mostly tested with Python and Java. - If problems arise when you try them or some other language, please select - \uicontrol Help > \uicontrol {Report Bug} to report them in the - \l{https://bugreports.qt.io/}{Qt Project Bug Tracker}. The reports - should include \QC console output with the environment - variable \c {QT_LOGGING_RULES=qtc.languageclient.*=true} set. + \sa {Manage Language Servers}{How To: Manage Language Servers}, + {Language Servers} +*/ + +/*! + \page creator-how-to-configure-lsp-workspace.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-lsp + \ingroup creator-how-to-projects-configure + + \title Configure language server workspace + + The language client sends the contents of the + \uicontrol {Workspace Configuration} field as a JSON file to all language + servers that have files open that belong to the project. The contents of the + JSON file must be valid JSON. The available settings depend on the language + server. + + To configure the language server workspace for the current project: + + \list 1 + \li Go to \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {Language Server}. + \image qtcreator-projects-settings-language-server.webp {Language Server settings for a project} + \li In \uicontrol {Workspace Configuration}, specify language server + settings using valid JSON format. + \endlist + + To add language servers and change their preferences, go to + \uicontrol {Global settings}. + + \sa {Manage Language Servers}{How To: Manage Language Servers}, + {Language Servers}, {Configuring Projects} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc b/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc index 95b31c2fd15..1942ec84af7 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-markdown-editor.qdoc @@ -2,13 +2,14 @@ // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \previouspage creator-editor-fakevim.html \page creator-markdown-editor.html - \nextpage creator-language-servers.html + \previouspage creator-how-tos.html - \title Editing Markdown Files + \ingroup creator-how-to-edit - Open \l{https://www.markdownguide.org/basic-syntax/}{markdown} (.md) files + \title Edit Markdown files + + Open \l{https://www.markdownguide.org/basic-syntax/}{Markdown} (.md) files or select \uicontrol File > \uicontrol {New File} > \uicontrol {General} > \uicontrol {Markdown File} to create a new file. @@ -20,7 +21,7 @@ \uicontrol {Show Editor}. To swap the places of the views, select \uicontrol {Swap Views}. - \section1 Formatting Text + \section1 Format text Use the buttons on the editor toolbar to format text as italic (i), bold (b), or inline code (`), and to create links to web sites diff --git a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc index 4e66db714c1..3e349e2a515 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-mime-types.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -10,46 +10,52 @@ /*! \previouspage creator-copilot.html \page creator-mime-types.html - \nextpage creator-modeling.html + \previouspage creator-how-tos.html - \title Editing MIME Types + \ingroup creator-how-to-configure-editors + + \title Edit MIME types \QC uses the \l{https://www.iana.org/assignments/media-types/media-types.xhtml} - {MIME type} of the file to determine which mode and editor to use for - opening the file. For example, \QC opens C++ source and header files in - the C++ editor, and Qt widget based UI files (.ui) in \QD. - For some MIME types, you can change the editor that is used to open the + {MIME type} of a file to determine what type of a file it is, so it can: + + \list + \li Choose a mode and editor to open the file in. + For example, \QC opens C++ source and header files in + the C++ editor, and Qt widget based UI files (.ui) in \QD. + \li Offer code editing services, such as code formatting and + highlighting. + \li Feed files to the correct language server. + \li Sort files into headers and sources in \l Projects. + \endlist + + For some MIME types, you can change the editor that \QC uses to open the files of that type by default. To identify the MIME type of a file, \QC uses matching by pattern and matching by contents. First, \QC looks at the filename to check whether it - matches the patterns specified for any MIME type. If no match is found, it - checks the contents of the file for magic headers specified for the file. + matches the patterns specified for any MIME type. If it does not find a match, + it checks the contents of the file for magic headers specified for the file. - The magic headers can have the following types of values: string, host, - big-endian, little-endian, and byte. \QC interprets the values according to - the - \l{http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html} - {Shared MIME-info Database specification}. \QC searches for the value within a specified range in the files and takes the priority of the magic header into account. If you specify wide search - ranges, opening files in \QC might take a long time. Therefore, you are - advised to use the recommended values for the range and priority of the - magic header. + ranges, opening files in \QC might take a long time. Therefore, you should + use the recommended values for the range and priority of the magic header. If your files do not match the predefined MIME types, you can edit the MIME types to add filename extensions and magic headers. You cannot add new MIME types, however. - To edit MIME types: + \section1 Change predefined MIME types + + To add file name extensions to MIME types: \list 1 - \li Select \preferences > - \uicontrol Environment > \uicontrol {MIME Types}. + \li Go to \preferences > \uicontrol Environment > \uicontrol {MIME Types}. - \image qtcreator-mime-types.png "MIME Types" + \image qtcreator-mime-types.png {MIME Types} \li In \uicontrol {MIME Type}, select a MIME type. @@ -62,44 +68,67 @@ \li In \uicontrol Patterns, add the filename extension for the type of files that you want to identify as having this MIME type. - \li Click \uicontrol Add to add \uicontrol {Magic Headers}. + \endlist - \image qtcreator-mime-types-magic-header.png "Magic Header" + \section1 Change default editor for a file type - \li In the \uicontrol Value field, specify a text string or bytes that + Even if an alternative editor is not listed for a MIME type, you can still + change the editor that is used to open the files of a particular type. + Remove the filename extension from the current MIME type and add it to a + MIME type that is handled by the editor you want to use. + + For example, to edit Linux kernel device tree source (.dts) files with the text + editor, delete the pattern \c {*.dts} from the MIME type \c {audio/vnd.dts} (where + it represents the digital surround audio file format), and add it to the + \c {text/plain} MIME type. + + Use the \uicontrol Filter field to find the MIME type that currently has a + filename extension. + + \section1 Add magic headers + + Magic headers can have the following types of values: string, host, + big-endian, little-endian, and byte. \QC interprets the values according to the + \l{http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html} + {Shared MIME-info Database specification}. + + \list 1 + + \li In \uicontrol {Mime Types}, select \uicontrol Add to add + \uicontrol {Magic Headers}. + + \image qtcreator-mime-types-magic-header.png {Magic Header} + + \li In \uicontrol Value, specify a text string or bytes that appear in the files. - \li In the \uicontrol Type field, select the type of the value. + \li In \uicontrol Type, select the type of the value. - \li In the \uicontrol Mask field, specify the number to combine the + \li In \uicontrol Mask, specify the number to combine the value in the file with using the AND operator before comparing it to the specified value. You can specify any numbers as masks for numerical types, whereas masks for strings must be in base 16, and start with 0x. - \note You are recommended not to change the range and priority - because it might cause problems when opening files in \QC. + \note Changing the range and priority might cause problems when + opening files in \QC. - \li Click \uicontrol OK to return to the \uicontrol {MIME Types} tab. + \li Select \uicontrol OK to return to the \uicontrol {MIME Types} tab. \endlist - Even if an alternative editor is not listed for a MIME type, you can still - change the editor that is used to open the files of a particular type. - Remove the filename extension from the current MIME type and add it to a - MIME type that is handled by the editor you want to use. For example, to - edit Linux kernel device tree source (.dts) files with the text editor, - delete the pattern \c {*.dts} from the MIME type \c {audio/vnd.dts} (where - it represents the digital surround audio file format), and add it to the - \c {text/plain} MIME type. You can use the \uicontrol Filter field to find - the MIME type that currently has a filename extension. + \section1 Reset MIME types - To revert the changes you have made to the MIME type definitions, - select \uicontrol {Reset MIME Types}. To revert the changes you have - made to the default editors, select \uicontrol {Reset Handlers}. + To revert the changes you made to MIME type definitions, select + \uicontrol {Reset MIME Types} in \uicontrol {MIME Types}. + + To revert the changes you made to the default editors, select + \uicontrol {Reset Handlers}. \note If you select \uicontrol OK or \uicontrol Apply after reverting changes, you permanently lose all your own patterns and magic headers. They are removed the next time you start \QC. + \sa {Clang Code Model}, {Language Servers} + */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc b/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc index a5a48c8c7bb..d42cbc4d35b 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-modeling.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2018 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,13 +8,17 @@ // ********************************************************************** /*! - \previouspage creator-mime-types.html \page creator-modeling.html - \nextpage creator-scxml.html + \previouspage creator-reference.html - \title Modeling + \ingroup creator-reference - You can use the model editor to create Universal Modeling Language (UML) + \title Model Editor + + \brief Editor for Universal Modeling Language (UML) style models with + structured and behavioral diagrams. + + Use the model editor to create Universal Modeling Language (UML) style models with structured and behavioral diagrams that offer different views to your system. However, the editor uses a variant of UML and has only a subset of properties for specifying the appearance of model elements. @@ -49,7 +53,7 @@ instances are activated and destroyed and where their lifeline ends. \endlist - \section1 Using the Model Editor + \section1 Editing Models You can create models that have several different structural or behavioral diagrams. @@ -57,21 +61,24 @@ can either use standard model elements or add your own elements with custom icons. - \image qtcreator-modeleditor.png + \image qtcreator-modeleditor.png {Class diagram in the model editor} + \caption A class diagram in the model editor. You can add model elements to diagrams in the following ways: \list - \li Drag and drop model elements from the element tool bar (1) to the + \li Drag model elements from the element tool bar (1) to the editor (2). \li Select tool bar buttons (3) to add elements to the element tree (4). \li Drag elements from the element tree to the editor to add them and all their relations to the diagram. - \li Drag and drop source files from the sidebar views to the editor + \li Drag source files from the sidebar views to the editor to add C++ classes or components to diagrams. \endlist + \section2 Grouping Elements + You can group elements by surrounding them with a boundary. When you move the boundary, all elements within it are moved together. Similarly, drag a swimlane to the diagram. When you move the swimlane, all elements right @@ -84,11 +91,15 @@ You can move individual elements and modify their properties (5) by selecting them. You can also use \e multiselection to group elements temporarily. + \section2 Aligning Elements + To align elements in the editor, select several elements and right-click to open a context menu. Select actions in the \uicontrol {Align Objects} menu to align elements horizontally or vertically or to adjust their width and height. + \section2 Managing Elements + Drag the mouse over elements to select them and apply actions such as changing their \e stereotype or color. A stereotype is a classifier for elements, such as \e entity, \e control, \e interface, or \e boundary. An @@ -107,12 +118,16 @@ To keep the selections in the diagram and the \uicontrol Structure view synchronized, select \uicontrol {Keep Synchronized}. + \section2 Zooming into Diagrams + To zoom into diagrams, select the \uicontrol {Zoom In} toolbar button, press \key Ctrl++, or press \key Ctrl and roll the mouse wheel up. To zoom out of diagrams, select \uicontrol {Zoom Out}, press \key Ctrl+-, or press \key Ctrl and roll the mouse wheel down. To reset the diagram size to 100%, select \uicontrol {Reset Zoom} or press \key Ctrl+0. + \section2 Printing Diagrams + To print diagrams, press \key Ctrl+C when no elements are selected in the editor to copy all elements to the clipboard by using 300 dpi. Then paste the diagram to an application that can print images. @@ -120,30 +135,91 @@ If you copy a selection of elements in the editor, only those elements and their relations will be copied to the clipboard as an image. + \section2 Exporting Diagrams as Images + To save diagrams as images, select \uicontrol File > \uicontrol {Export Diagram}. To save only the selected parts of a diagram, select \uicontrol {Export Selected Elements}. - \section1 Creating Models + \section1 Adding Custom Elements - You can use wizards to create models and \e {scratch models}. A scratch - model can be used to quickly put a temporary diagram together. The wizard - creates the model file in a temporary folder without any input from you. - Therefore, you can assign a \l{Keyboard Shortcuts}{keyboard shortcut} to the - wizard and use it to create and open models with empty diagrams. + The model editor has the following built-in element types: package, + component, class, and item. For package, component, and class elements, you + can specify custom icons. The color, size, and form of the icon are + determined by a stereotype. If you attach the stereotype to an element, the + element icon is replaced by the custom icon. For example, you can attach the + entity and interface stereotypes to classes and the database stereotype to + components. - To create models: + The use case and activity diagrams are examples of using the built-in + \e item element type to add custom elements. The item element has the form + of a simple rectangle. The use case illustrates how to use a custom icon for + an item. The attached stereotype is called \e usecase but it is hidden. + Therefore, if you drag the use case to the diagram, it is shown as a use + case but no stereotype appears to be defined and you can attach an + additional stereotype to the use case. + + Color and icons are attached to elements in use case and activity diagrams + by using a simple definition file format. For example, the following code + adds the \c UseCase custom element: + + \code + Icon { + id: UseCase + title: "Use-Case" + elements: item + stereotype: 'usecase' + display: icon + width: 40 + height: 20 + baseColor: #5fb4f0 + Shape { + Ellipse { x: 20, y: 10, radiusX: 20, radiusY: 10 } + } + } + \endcode + + For more information about the available options, see \e standard.def + in the \e share/qtcreator/modeleditor directory in the \QC installation + directory. It describes also how to define custom relation types + and templates for existing types (such as a composition relation that + can be drawn between classes). + + You can add your own definition file and save it with the file extension + \e .def to add custom colors and icons for stereotypes, elements, or tool + bars. Either store this file in the same directory as the + \e standard.def file or select the root element of a model and apply your + \e .def file to the property \uicontrol {Config path}. + + \sa {Create Models and Diagrams}{How To: Create Models and Diagrams}, + {Create files}, {Sidebar Views} +*/ + +/*! + \page creator-how-to-create-models.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-models + + \title Create UML-style models + + You can use wizards to create UML-style models and \e {scratch models}. + + To create models and edit them in the model editor: \list 1 - \li Select \uicontrol File > \uicontrol {New File} > - \uicontrol Modeling > \uicontrol Model > or - \uicontrol {Scratch Model} > \uicontrol Choose to create a model - or a scratch model. + \li Select \uicontrol File > \uicontrol {New File} > \uicontrol Modeling + > \uicontrol Model > \uicontrol Choose. - \li Drag and drop model elements to the editor and select them to + The model file opens in the model editor. + + \li Drag model elements to the editor and select them to specify properties for them: + \image qtcreator-modeleditor-packages.png {Package diagram in the model editor} + \caption A package diagram in the model editor. + \list 1 \li In the \uicontrol Stereotypes field, enter the stereotype to @@ -217,8 +293,8 @@ \endlist - \li To move the end of a relation to a different element, grab the - end point and drop it over another element that accepts relations + \li To move the end of a relation to a different element, drag the + end point over another element that accepts relations of that type. For example, only classes accept inheritances and associations. @@ -233,36 +309,76 @@ \li To remove a sampling point, press \key Ctrl and click the sampling point. - \li To group elements, drag and drop a \uicontrol Boundary element to + \li To group elements, drag a \uicontrol Boundary element to the editor and resize it to enclose the elements in the group. \endlist - \section1 Creating Package Diagrams + \section1 Create scratch models + + Use a scratch model to quickly put a temporary diagram together. The wizard + creates the model file in a temporary folder without any input from you. + Therefore, you can assign a \l{Keyboard Shortcuts}{keyboard shortcut} to the + wizard and use it to create and open models with empty diagrams. + + To create a scratch model, select \uicontrol File > \uicontrol {New File} > + \uicontrol Modeling > \uicontrol {Scratch Model} > \uicontrol Choose. + + \sa {Create class diagrams}, {Create component diagrams}, + {Create package diagrams}, {Model Editor} +*/ + +/*! + \page creator-how-to-create-package-diagrams.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-models + + \title Create package diagrams + + You can create UML-style models that contain \e {package diagrams}. + They show packages and their relationships to visualize how the + system is packaged. You can add nested package elements to a package diagram. The depth of the elements in the diagram corresponds to the depth of the structured model. Elements stacked on other elements of the same type are automatically drawn in a darker shade of the selected color. - \image qtcreator-modeleditor-packages.png + \image qtcreator-modeleditor-packages.png {Package diagram in the model editor} + \caption A package diagram in the model editor. Right-click a package to open a context menu, where you can select \uicontrol {Create Diagram} to create a new package diagram within the - model. You can drag and drop items from the element tree to the diagram. + model. You can drag items from the element tree to the diagram. To update the include dependencies of the package, select \uicontrol {Update Include Dependencies}. - \section1 Creating Class Diagrams + \sa {Create class diagrams},{Create component diagrams}, + {Create UML-style models}, {Model Editor} +*/ - \image qtcreator-modeleditor-classes.png +/*! + \page creator-how-to-create-class-diagrams.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-models + + \title Create class diagrams + + You can create UML-style models that contain \e {class diagrams}. They show + classes, dependencies, inheritance, associations, aggregation, and + composition to visualize a system in an object-oriented way. + + \image qtcreator-modeleditor-classes.png {Class diagram in the model editor} + \caption A class diagram in the model editor. To create class diagrams: \list 1 - \li To add C++ classes to class diagrams, drag and drop files from + \li To add C++ classes to class diagrams, drag files from \uicontrol Projects to the editor, and select \uicontrol {Add Class}. @@ -294,7 +410,7 @@ \endlist \li In the \uicontrol Members field, specify members for the - class, as described in \l {Specifying Members}. + class, as described in \l {Specify members}. \li Select \uicontrol {Clean Up} to format the contents of the \uicontrol Members field depending on their visibility @@ -312,7 +428,7 @@ class in the editor or select \uicontrol {Show Definition} in the context menu. - \section2 Adding Relations + \section1 Add relations Elements in class diagrams can have the following types of relations: inheritance, association, and dependency. The end points of association @@ -321,13 +437,13 @@ To create self-relations, start creating a new association and press \key Shift to create a new \e {sampling point} while dragging the - association. Create another sampling point and drop the association - at the same class. + association. Create another sampling point and drag the association + to the same class. To add more points, press \key Shift and click a relation. To delete a point, press \key Ctrl and click a point. - \section2 Specifying Members + \section2 Specify members To specify members for the class, enter each member on a separate line using a C++ like syntax. For example, the following lines define the @@ -374,66 +490,34 @@ \endlist - \section1 Creating Component Diagrams + \sa {Create component diagrams}, {Create package diagrams}, + {Create UML-style models}, {Model Editor} +*/ + +/*! + \page creator-how-to-create-component-diagrams.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-models + + \title Create component diagrams + + You can create UML-style models that contain \e {component diagrams}. + They epresent a set of components and their relationships, and show the + implementation of a system. You can add source code components, such as libraries, databases, programs, and architectural layers to a component diagram. To add components to - component diagrams, drag and drop source code from \uicontrol Projects to + component diagrams, drag source code from \uicontrol Projects to the editor, and select \uicontrol {Add Component}. + \image qtcreator-model-editor-component-diagram.webp {Component diagram in the model editor} + \caption A component diagram in the model editor. + To navigate from a component in a diagram to the source code, double-click the component in the editor or select \uicontrol {Show Definition} in the context menu. - \section1 Adding Custom Elements - - The model editor has the following built-in element types: package, - component, class, and item. For package, component, and class elements, you - can specify custom icons. The color, size, and form of the icon are - determined by a stereotype. If you attach the stereotype to an element, the - element icon is replaced by the custom icon. For example, you can attach the - entity and interface stereotypes to classes and the database stereotype to - components. - - The use case and activity diagrams are examples of using the built-in - \e item element type to add custom elements. The item element has the form - of a simple rectangle. The use case illustrates how to use a custom icon for - an item. The attached stereotype is called \e usecase but it is hidden. - Therefore, if you drag the use case to the diagram, it is shown as a use - case but no stereotype appears to be defined and you can attach an - additional stereotype to the use case. - - Color and icons are attached to elements in use case and activity diagrams - by using a simple definition file format. For example, the following code - adds the \c UseCase custom element: - - \code - Icon { - id: UseCase - title: "Use-Case" - elements: item - stereotype: 'usecase' - display: icon - width: 40 - height: 20 - baseColor: #5fb4f0 - Shape { - Ellipse { x: 20, y: 10, radiusX: 20, radiusY: 10 } - } - } - \endcode - - For more information about the available options, see \e standard.def - in the \e share/qtcreator/modeleditor directory in the \QC installation - directory. It describes also how to define custom relation types - and templates for existing types (such as a composition relation that - can be drawn between classes). - - You can add your own definition file and save it with the file extension - \e .def to add custom colors and icons for stereotypes, elements, or tool - bars. Either store this file in the same directory as the - \e standard.def file or select the root element of a model and apply your - \e .def file to the property \uicontrol {Config path}. - - + \sa {Create class diagrams}, {Create package diagrams}, + {Create UML-style models}, {Model Editor} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc b/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc index 44622426af8..56e413b7e93 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-preferences-cpp-code-style.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2023 The Qt Company Ltd. +// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! @@ -18,30 +18,39 @@ To specify global indentation settings for the C++ editor: \list 1 - \li Select \preferences > \uicontrol {C++}. + \li Go to \preferences > \uicontrol {C++}. \image qtcreator-code-style-clang-format-global.webp {Code Style preferences} \li In \uicontrol {Formatting mode}, select: \list \li \uicontrol {Indenting Only} to only indent code. \li \uicontrol {Full Formatting} to use the \key {Ctrl+I} keyboard shortcut to format code instead of indenting. - \li \uicontrol Disable to turn off ClangFormat. + \li \uicontrol {Use Built-In Indenter} to turn off ClangFormat. \endlist + \li Select \uicontrol {Ignore files greater than} to make parsing faster + by ignoring big files. Specify the maximum size of files to parse. \li To apply the formatting while you type, select \uicontrol {Format while typing}. \li To apply the formatting to the edited code when you save the file, select \uicontrol {Format edited code on file save}. \li To change the ClangFormat style globally for all projects, - select \uicontrol {Override ClangFormat configuration file}. - \li In the \uicontrol {Current settings} field, select the settings to - modify and click \uicontrol Copy. - \li Give a name to the settings and click \uicontrol OK. - \li Click \uicontrol Edit to set + select \uicontrol {Use custom settings}. + \li In \uicontrol {Custom settings}, select the settings to change, and + then select \uicontrol Copy. + \li Give a name to the settings, and select \uicontrol OK. + \li In \uicontrol ClangFormat, edit the \l{https://clang.llvm.org/docs/ClangFormatStyleOptions.html} - {ClangFormat Style Options}. + {ClangFormat Style Options}. The live preview shows how the + preferences change the indentation. + If you enter invalid values, you see warning messages. \endlist - In the other tabs, you can specify how to: + \section1 Using Built-In Indenter + + \image qtcreator-code-style-built-in-indenter.webp {Code Style preferences for built-in indenter} + + If you select \uicontrol {Use Built-In Indenter} in + \uicontrol {Formatting mode}, you can specify how to: \list \li Interpret the \key Tab and \key Backspace key presses. @@ -52,12 +61,9 @@ \li Bind pointers (*) and references (&) in types and declarations to identifiers, type names, or left or right \c const or \c volatile keywords. - \li Name getter functions. \endlist - Use the live preview to see how the preferences change the indentation. - - \section1 Specifying Settings for Content + \section2 Specifying Settings for Content You can indent public, protected, and private statements and declarations related to them within classes. @@ -67,24 +73,24 @@ \image qtcreator-code-style-content.png {Content preferences} - \section1 Specifying Settings for Braces + \section2 Specifying Settings for Braces You can indent class, namespace, enum and function declarations and code blocks. \image qtcreator-code-style-braces.png {Braces preferences} - \section1 Specifying Settings for Switch Statements + \section2 Specifying Settings for Switch Statements You can indent case or default statements, or statements or blocks related to them within switch statements. \image qtcreator-code-style-switch.png {Switch preferences} - \section1 Specifying Alignment + \section2 Specifying Alignment To align continuation lines to tokens after assignments, such as \c = or - \c +=, select the \uicontrol {Align after assignments} check box. You can + \c +=, select \uicontrol {Align after assignments}. You can specify additional settings for aligning continuation lines in the \uicontrol General tab. @@ -94,7 +100,7 @@ \image qtcreator-code-style-alignment.png {Alignment preferences} - \section1 Binding Pointers and References + \section2 Binding Pointers and References To bind pointers (\c *) and references (\c &) in types and declarations to identifiers, type names, or left or right \c const or \c volatile keywords, @@ -105,15 +111,6 @@ \image qtcreator-pointers-references.png {Pointers and References preferences} - \section1 Creating Project-Specific ClangFormat Files - - To override the \c {.clang-format} file for a particular project, create a - copy of the built-in style and edit its settings by selecting - \uicontrol Projects > \uicontrol {Project Settings} > - \uicontrol {Code Style} > \uicontrol Copy > \uicontrol Edit > - \uicontrol {ClangFormat} > - \uicontrol {Override ClangFormat configuration file}. - \section1 Creating ClangFormat Files from Command Line You can create \c {.clang-format} files that have the configuration @@ -124,5 +121,6 @@ clang-format -style=llvm -dump-config > .clang-format \endcode - \sa {Indent text or code}, {Behavior}, {Qt Quick Code Style}, {Nim} + \sa {Indent text or code}, {Specify code style}, {Behavior}, + {Qt Quick Code Style}, {Nim} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc index a72320b71fe..b5a62ae20c4 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-preferences-nim.qdoc @@ -9,26 +9,38 @@ \title Nim - \brief Set Nim code style. + \brief Set Nim code style and paths to tools. - To specify settings for the Nim editor (experimental): + \section1 Code Style + + To specify preferences for the Nim editor (experimental): \list 1 - \li Select \preferences > \uicontrol Nim. - \li In the \uicontrol {Current settings} field, select the settings to - modify and click \uicontrol Copy. - \image qtcreator-options-code-style-nim.png {Nim Code Style preferences} - \li Give a name to the settings and click \uicontrol OK. - \li Click \uicontrol Edit to specify code style settings for the project. - \image qtcreator-code-style-settings-edit-nim.png {Edit Code Style dialog} + \li Go to \preferences > \uicontrol Nim. + \li In \uicontrol {Custom settings}, select the settings to + modify, and then select \uicontrol Copy. + \image qtcreator-preferences-nim-code-style.webp {Nim Code Style preferences} + \li Give a name to the settings, and select \uicontrol OK. + \li Specify how to interpret the \key Tab key presses and how to align + continuation lines. + \li Select \uicontrol OK to save the settings. \endlist - You can specify how to interpret the \key Tab key presses and how to align - continuation lines. - To specify different settings for a particular project, select \uicontrol Projects > \uicontrol {Code Style}. - \sa {Find preferences}, {Indent text or code}, - {Specify code style}, {Setting Up Nimble} + \section1 Tools + + You can use the \l{https://nim-lang.org/docs/nimsuggest.html}{Nimsuggest} + tool to query \c {.nim} source files and obtain suggestions for code + completion. + + To use Nimsuggest, you must install it on the development PC and enter the + path to the tool executable in \uicontrol Path. + + \image qtcreator-preferences-nim-tools.webp + + \sa {Add code snippets to the auto-complete menu}, {Complete code}, + {Find preferences}, {Indent text or code}, {Specify code style}, + {Completion}, {Nimble}, {Snippets} */ diff --git a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc index 93ac2b8de6e..5c1c32810e1 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-scxml.qdoc @@ -1,4 +1,4 @@ -// Copyright (C) 2020 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only // ********************************************************************** @@ -8,11 +8,14 @@ // ********************************************************************** /*! - \previouspage creator-modeling.html \page creator-scxml.html - \nextpage creator-building-running.html + \previouspage creator-reference.html - \title Editing State Charts + \ingroup creator-reference + + \title SCXML Editor + + \brief State chart (.scxml) editor. State charts are a graphical way of modeling how a system reacts to stimuli. They define the \e states that the system can @@ -22,121 +25,126 @@ \e event, but also on earlier events. With state charts, you can easily share this information. - With the \QC project wizard you can add \l{https://www.w3.org/TR/scxml/} + With the \QC file wizard, you can add \l{https://www.w3.org/TR/scxml/} {State Chart XML (SCXML)} files with boilerplate code to projects. Edit - the state charts with the SCXML editor to add \e states and \e transitions + the state charts with the SCXML editor to add states and transitions to the files. Then, use the classes in the Qt SCXML module to embed the state machines created from the files in Qt applications. - \image qtcreator-scxml-editor.png SXCML Editor + When you open an .scxml file, it opens in the SCXML editor: - You can drag and drop states from the \uicontrol {Common States} view (1) to + \image qtcreator-scxml-editor.webp {SCXML editor} + + Drag states from the \uicontrol {Common States} view (1) to the state editor (2). Select a state in the state editor and use the tool buttons (3) to create a transition (4) and its \e {target state}. - You can view the state chart structure in the \uicontrol Structure view (5) + View the state chart structure in the \uicontrol Structure view (5) and specify attributes for the selected state or transition in the \uicontrol Attributes view (6). - You can use the toolbar buttons (7) to execute functions such as editing, + \section1 Navigating State Charts + + Use the toolbar buttons to execute functions such as editing, zooming, magnifying, navigating, and panning state charts, as well as taking screenshots and viewing statistics. - To zoom into and out of the whole state chart in the state editor, select - \uicontrol {Zoom In} or \uicontrol {Zoom Out} or press \key Ctrl and use the - mouse wheel. To make - the whole state chart visible in the state editor at a time, select - \inlineimage icons/fittoview.png - (\uicontrol {Fit to View}). + \table + \header + \li Button + \li Name + \li Description + \row + \li \inlineimage icons/snapshot.png + \li \uicontrol {Save Screenshot} + \li Saves the currently visible part of the state chart as an image. + \row + \li \inlineimage icons/icon-export-canvas.png + \li \uicontrol {Export Canvas to Image} + \li Saves the whole state chart as an image. + \row + \li \inlineimage icons/zoom-in.png - To view a particular part of a large state chart in the state editor, select - \inlineimage icons/navigator.png - (\uicontrol {Navigator}) and move the navigator frame on the part you want - to view. + \inlineimage icons/zoom-out.png + \li \uicontrol {Zoom In} - To use the magnifier to zoom into a part of the state chart, select - \inlineimage icons/zoom.png - (\uicontrol {Magnifier Tool}). To move the magnifier tool faster, press down - the \key Alt key. + \uicontrol {Zoom Out} + \li Zooms into or out of the whole state chart in the state editor. - To pan the state chart, select \inlineimage icons/pan.png - (\uicontrol Panning). To increase the pace of panning, press down the - \key Shift key. + You can also press \key Ctrl and use the mouse wheel. + \row + \li \inlineimage icons/pan.png + \li \uicontrol Panning + \li Pans the state chart. To increase the pace of panning, press down the + \key Shift key. + \row + \li \inlineimage icons/fittoview.png + \li \uicontrol {Fit to View} + \li Makes the whole state chart visible in the state editor at a time. + \row + \li \inlineimage icons/zoom.png + \li \uicontrol {Magnifier Tool} + \li Zooms into a part of the state chart. To move the magnifier tool + faster, press down the \key Alt key. + \row + \li \inlineimage icons/navigator.png + \li \uicontrol {Navigator} + \li Shows a particular part of a large state chart in the state editor. + Move the navigator frame on the part you want to view. + \row + \li \inlineimage icons/statistics.png + \li \uicontrol {View Statistics} + \li Shows statistics about the numbers of states and transitions in the + state chart. + \endtable - To view statistics about the numbers of states and transitions in the state - chart, select \inlineimage icons/statistics.png - (\uicontrol {View Statistics}). + To search from the state chart, select \uicontrol {Search} and start typing + in the \uicontrol Filter field. The search checks the whole SCXML tree for + attributes that match the search criteria. - To search from the state chart, use \l {Search Results}. The search - checks the whole SCXML tree for attributes that match the search criteria. - - To save the currently visible part of the state chart as an image, select - \inlineimage icons/snapshot.png - (\uicontrol {Save Screenshot}). To save the whole state chart as an image, - select \inlineimage icons/icon-export-canvas.png - (\uicontrol {Export Canvas to Image}). - - \section1 Creating State Charts - - To create a state chart: - - \list 1 - - \li Select \uicontrol File > \uicontrol {New File} > - \uicontrol {Files and Classes} > \uicontrol Modeling > - \uicontrol {State Chart} > \uicontrol Choose to create an empty - state chart and to open it in the SCXML editor. - - \li Drag and drop a state from the \uicontrol {Common States} view to - the state editor. - - \li Drag and drop child states to the initial state to create a - \e {compound state} or use the tool buttons to create a transition - from the selected state and its target state. - - \li Select a state to edit its attributes in the \uicontrol Attributes - view. - - \li Select the transition line to add edge points to it. - - \li To raise or send events, for example, use the context menu commands - to add executable content to the \c and \c - elements of states or to transitions. - - \endlist - - The following sections describe how to manage states, transitions, and - executable content. - - \section1 Managing States + \section1 States When the state machine enters a state in response to an event, the state that it entered becomes the \e {active state}. - State charts are hierarchical, and therefore states can be nested inside - other states, to create compound states. + State charts are hierarchical, and therefore you can nest states inside + other states to create compound states. - In addition to basic states, you can create the following types of states: + You can create the following types of states: - \list - - \li \e Initial state is the state the state machine enters when it - starts. - - \li \e {Parallel state} has child states that execute in parallel - and are all active simultaneously. Events are processed - independently by each child state and may trigger different - transitions for each child. - - \li \e {Final state} enables a state machine to finish. When the state + \table + \header + \li Button + \li Name + \li Description + \row + \li \inlineimage icons/recordfill.png + \li \uicontrol Initial + \li The state that the state machine enters when it starts. + \row + \li \inlineimage icons/state.png + \li \uicontrol State + \li The basic state. + \row + \li \inlineimage icons/parallel.png + \li \uicontrol Parallel + \li Has child states that execute in parallel and are all active + simultaneously. Each child state processes events independently, + and the events may trigger different transitions for each child. + \row + \li \inlineimage icons/final.png + \li \uicontrol Final + \li Lets a state machine finish. When the state machine enters a top-level final state, it emits the finished signal and halts. You can create final states in compound states to hide the internal details of a compound state. The outside world can only enter the state and get a notification when the state has finished. A parallel state finishes when all its child states reach final states. - - \li \e {History state} is a pseudo-state that represents the child state + \row + \li \inlineimage icons/history.png + \li \uicontrol History + \li A pseudo-state that represents the child state the parent state was in the last time the parent state was exited. Create a history state as a child of the state for which you want to @@ -147,13 +155,18 @@ state that the state machine previously saved. The state machine automatically forwards the transition to the real child state. - \endlist + \endtable + + To create transitions between states, select + \inlineimage icons/transition.png. + + \section1 Adding States You can add new states to the state chart in the following ways: \list - \li Drag and drop states from the \uicontrol {Common States} view to the + \li Drag states from the \uicontrol {Common States} view to the state editor. \li Select a state in the state editor, and then select the @@ -165,13 +178,20 @@ \endlist - You can drag states on top of other states to create compound states, or - you can drag child states out of their parent state. To move child states - within their parent, press down the \key Ctrl key while moving them. + Drag states on top of other states to create compound states. You can also + drag child states out of their parent state. To move child states + within their parent, press down the \key Ctrl key while dragging them. - You can use toolbar buttons to align states in the state editor, to adjust - their size, and to change the default color scheme. Overlapping states are - marked in red color. + \section1 Aligning and Editing States + + Use the toolbar buttons to align states in the state editor, to adjust + their size, color, and fonts, and to change the default color scheme. + + \image qtcreator-scxml-editor-state-toolbar.webp {Buttons for editing states} + + Overlapping states are marked in red color. + + \section1 Viewing State Tree Structure To expand or collapse the state tree structure in the \uicontrol Structure view, double-click a state. @@ -199,9 +219,9 @@ \section1 Managing Transitions - Transitions define how a state reacts to \e events that are generated either - by the state machine or external entities. When events occur, the state - machine checks for a matching transition defined in the active state and + Transitions define how a state reacts to \e events that either the state + machine or external entities generate. When events occur, the state + machine checks for a matching transition in the active state and moves to its target state. To create a transition from the selected state to a new state, drag and @@ -210,24 +230,24 @@ center of the state, but you can also draw a transition to the edge of the state. - To add edge points to transitions, select a transition line. Only two edge - points are permitted for each line, and unnecessary edge points are removed - automatically. To remove the selected edge point, select + The editor center-aligns transition labels, but you can drag them to + other positions. + + To add edge points to transitions, select a transition line. You can add + only two edge points for each line. The editor automatically removes + unnecessary edge points. To remove the selected edge point, select \uicontrol {Remove Point} in the context menu. - To add new edge points with a mouse click, select the \uicontrol Transition - tool button. - - A transition label is automatically center-aligned, but you can drag it to - another position. + To add new edge points with a mouse click, select + \inlineimage icons/transition.png. To remove the selected transition, select \uicontrol Remove in the context menu. \section1 Adding Executable Content - You can add \e {executable content} to a state chart to enable the state - machine to modify its data model and to interact with external entities. + Add \e {executable content} to a state chart to enable the state + machine to change its data model and to interact with external entities. Use the context menu commands to add executable content to the \c and \c elements or to transitions: @@ -236,7 +256,7 @@ \li \c to raise events \li \c to communicate with external entities \li \c