From 6c98cb780d970c1c80e3264be5f4757f8757d4a9 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 31 May 2024 15:57:51 +0200 Subject: [PATCH] Doc: Describe configuring C++ code model for a project Task-number: QTCREATORBUG-30604 Change-Id: I8f3634fe4282ebe3d364f7762fe651ddb872313f Reviewed-by: Christian Kandeler --- .../qtcreator-projects-cpp-code-model.webp | Bin 0 -> 3290 bytes .../creator-only/creator-clang-codemodel.qdoc | 88 ++++++++++++------ .../creator-projects-settings-overview.qdoc | 1 + 3 files changed, 60 insertions(+), 29 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-projects-cpp-code-model.webp diff --git a/doc/qtcreator/images/qtcreator-projects-cpp-code-model.webp b/doc/qtcreator/images/qtcreator-projects-cpp-code-model.webp new file mode 100644 index 0000000000000000000000000000000000000000..259d8092f30ef55d70b2af7f8e13d01a61ed532a GIT binary patch literal 3290 zcmWIYbaT7J!@v;k>J$(bVBvF&hk-%=>A?_&?N7}nskpA1#mpI>yzRl+s?CzF*KTlh zOiWq5D(#%`ox7?mpVTGxGcw#~?aR5nYSG^J)e|P}wqD}X>S@eT&b!e1*XR4K*Xs+n z$$M-*!=co|z{u4al&IM0v(!jLOR1B?bDB%b2@$nbCq&e^cm)+V39yMeEeTo~!gb-l zqKlGq=EP2s1sn@q{xoZJIA~4fSQwyt;rvWy?;5MrOW0 zjr>Ao46hP$XMfv~%skD!fVE@;i%B7?x&tf!g#d zIpRsg*}}}6BR5(%&M05d9Mbq|MPQ@MB&!YX8;ktJs(H%%(pd8q3h(pFUHUZPV&DPc zi}jHca$9qYuk2FpeKkj1@XfIp=UGAVK<*>$DcHQ>a!_nuP5a9d7`_9v)D;5+i-lr&f zCHl<&>xcicem?fHZu_h^aWA8v82HCr-uW-S_sz5F6BdWr`po=4bX#mc*B$rO=d$qy z;j3GkC){n}FFRIwMl2yzx8MHxVfK%Uy*E_rR<|5i^^m#4^gLAPyMjT9w5v_QwjGht2MQi; zeErDW(dL4=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s$&)mG643ql5|XZJ~{fwQG@Ms zRFTSQJ2(W5u5}ozlg+&(<#E&NR|0Jf%7B*(vkSS31jcS59DJnD9rZ z@`&}Hj;cpo|DNm-TlF(--l<(7SxXcc`0TyAx6IgI70cDA%Gz|%jG4pUo7YG0Y2?B9 zheypni@ecTlEA=af4bO0ltu3uf3sgnSNU<{&sX;U3cmI8l)fv=o9k{lFTTD0tlsJF zskG2wr<)Cb_R;zfx$9~Fe+Ij5yFYzTg`?F(S&agVeX^m?w75>T-2eFYOYh1}M)Td( zYR(z2IwGipSj1xC6&rsRL_}cD=?w+iov?<K{W#{0gXWiTxmnS#`*59kCJ++35NoP-0tXFVrXXmbvUF$CxA5N~Y z@~+#s)MTRs%ijf3AOCl%G7C=s_gF(Abp4}d)(@MCU&VL)XUsQb^*xtFnH{ zW;Sihw?3IJ!T8bTSJ0V1|NV7rY-cX_VqJGr%$EOG)$6_NA^%I+_M-D4VOE(oQ`T$ur^H;+eCjvdsGDhD>+@a3^R#@jG%n>N zDIfW;W!fL1@E(nI&nDQ~R4i&>ZVU^3|M%%x(ZKcIy2tqo4GkY`{}5v(w2W)AzDc)9 zGLnW1zbBW?bgV2ADUi7GZP%U+3(e;qlez2uSTgxpO~-~0|Ky*35(yDL*LaQp;al++ zr=8v1P1?)XRa`vtsC>$jnd|#rm51F9nOKQvWa{26?yhzYwB6O^Z!MlUX=-l2Oe}y}pl2d{wi5x%w=cxn*UF@BR)?lgVaN*JO$tdU|LS zEsi~+vS>a`#ZTqT;FGiJ1ShAwD*k<`UFD;Or;5n3dmYa+Dm}FNvp4_WfCdBPnE^F) BP&WVo literal 0 HcmV?d00001 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 bdf06e24eb4..d8bba6edf62 100644 --- a/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc +++ b/doc/qtcreator/src/editors/creator-only/creator-clang-codemodel.qdoc @@ -124,8 +124,34 @@ 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}, - {Specify Clang tools settings}, {Use compilation databases} + \sa {Configure C++ code model}, {Specify clangd settings}, + {Specify Clang tools settings}, {Use compilation databases}, + {Code Model}, {Clangd} +*/ + +/*! + \page creator-how-to-cpp-code-model.html + \previouspage creator-how-tos.html + + \ingroup creator-how-to-configure-editors + \ingroup creator-how-to-projects-configure + + \title Configure C++ code model + + The code model offers services such as code completion, syntactic and + semantic highlighting, and diagnostics. + + To configure the C++ code model for a project: + + \list 1 + \li Go to \uicontrol Projects > \uicontrol {Project Settings} > + \uicontrol {C++ Code Model}. + \image qtcreator-projects-cpp-code-model.webp {C++ Code Model settings} + \li Clear \uicontrol {Use global settings}. + \li Set \uicontrol {C++ Code Model} settings for the project. + \endlist + + \sa {Code Model} */ /*! @@ -138,40 +164,43 @@ \brief Sets global preferences for the code model. - The Clang code model offers services such as code completion, syntactic and + The code model offers services such as code completion, syntactic and semantic highlighting, and diagnostics. - To configure the Clang code model globally: + To configure the C++ code model globally, go to \preferences > + \uicontrol C++ > \uicontrol {Code Model}. - \list 1 + \image qtcreator-preferences-code-model.webp {C++ Code Model preferences} - \li Select \preferences > \uicontrol C++ > - \uicontrol {Code Model}. - - \image qtcreator-preferences-code-model.webp {C++ Code Model preferences} - - \li To instruct the code model to interpret ambiguous header files as C - language files if you develop mainly using C, select the - \uicontrol {Interpret ambiguous headers as C headers} check box. - - \li To process precompiled headers, deselect the - \uicontrol {Ignore precompiled headers} check box. - - \li To use the built-in preprocessor to show the - pre-processed source file in the editor, select - \uicontrol {Use built-in preprocessor to show pre-processed files}. + The following table summarizes the preferences. + \table + \header + \li Setting + \li Value + \row + \li \uicontrol {Interpret ambiguous headers as C headers} + \li Instructs the code model to interpret ambiguous header files as C + language files. Select this checkbox if you develop mainly using C. + \row + \li \uicontrol {Ignore precompiled headers} + \li Clear this checkbox to process precompiled headers. + \row + \li \uicontrol {Use built-in preprocessor to show pre-processed files} + \li Uses the built-in preprocessor to show the + pre-processed source file in the editor. + \row + \li \uicontrol {Do not index files greater than} \li To avoid out-of-memory crashes caused by indexing huge source files that are typically auto-generated by scripts or code, the size of - files to index is limited to 5MB by default. To adjust the limit, - edit the value for the \uicontrol {Do not index files greater than} - check box. To index all files, deselect the check box. + files to index is limited to 5MB by default. - \li To ignore files that match wildcard patterns, select the - \uicontrol {Ignore files} check box and enter each wildcard pattern - on a separate line in the field. - - \endlist + To index all files, clear the checkbox. + \row + \li \uicontrol {Ignore files} + \li To ignore files that match wildcard patterns, enter each wildcard + pattern on a separate line in the field. + \endtable \section1 Inspect preprocessed C++ code @@ -186,7 +215,8 @@ this action also expands all \c {"#include "} statements to their actual contents. - \sa {Specify clangd settings}, {Clang Code Model}, {Clangd} + \sa {Configure C++ code model}, {Specify clangd settings}, + {Clang Code Model}, {Clangd} */ /*! diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc index df0b2b0f7a7..3f8e93f1421 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-overview.qdoc @@ -85,6 +85,7 @@ \li \l{Specify clangd settings}{Clangd} \li \l{Specify Clang tools settings}{Clang Tools} \li \l{Set Copilot preferences}{Copilot} + \li \l{Configure C++ code model}{C++ Code Model} \li \l{Specify code style}{C++ Code Style} \li \l{Set C++ file naming preferences}{C++ File Naming} \li \l{Specify dependencies}{Dependencies}