From 6553df4a20f9d8e7fccae9caf6591bb954887c10 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 28 Jan 2021 17:17:59 +0100 Subject: [PATCH] Doc: Display info about using Qt Creator variables in QDS Manual They are needed for some more advanced actions. - Move the section to a .qdocinc file that is included as necessary and modify defines where needed. - Describe using tooltips to get more info about variables. - Add a screenshot. Change-Id: Ieb03ccf7de5f0c493c98ae356cdda4b4d3915832 Reviewed-by: Christian Kandeler --- doc/qtcreator/images/qtcreator-variables.png | Bin 0 -> 9575 bytes .../src/editors/creator-code-completion.qdoc | 9 ++- ...creator-projects-settings-environment.qdoc | 46 +---------- .../creator-qtcreator-variables.qdocinc | 74 ++++++++++++++++++ 4 files changed, 84 insertions(+), 45 deletions(-) create mode 100644 doc/qtcreator/images/qtcreator-variables.png create mode 100644 doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc diff --git a/doc/qtcreator/images/qtcreator-variables.png b/doc/qtcreator/images/qtcreator-variables.png new file mode 100644 index 0000000000000000000000000000000000000000..ab306c0bca27f241f99a0165e89418e85b478a09 GIT binary patch literal 9575 zcmeAS@N?(olHy`uVBq!ia0y~yV4T3fz<7*TeGikn!n2MhuEQ8^JSl=ehWRUKQsH%|G8?> zGCpUn-(>swoNxK_Pj8nW-Iw+|Oa1xsr((~4>N2h2e8uf(8@6=L)RkTzuUuZbc2itp zaH6W8=hH_f9a}c^b@86L-uWyjw=?>kyiDrvg{`a`>So0A>4ijyE}SztI%4-D|Nb+R zw(nmRt)$cN)!BDXl;89Mxx`SPmJJLFu4nmrB}?w#udjQjmw55w?NECT4sF?=TJ{nG z)81J!Fl z6B!u}F)_Swi?C^7Vqp6$z{S<-^l)d32v=*<1`QFeLyH15L|R-I254|}J1tx@dqZ61 z)2aCZ8X{ijyMiVw=zL{fwt~^Ye2z`!r_i`{jF zKe5tR@sw(%;cVGu{TZh5vrm4!dGAuc4}Xu`{EO^9Qo&QBZ(V4d8~6U((M#rgug-q= zTz>nc_odS}XWE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O|qVn}2>V8#9VsCfLJzF@uBT`e0J7WC_`>DoMH zZAK!aL;dcSTah!@3Wza$sp5Hkbc;b7D+A9iW>7&1YGr_?V;!^;x5j(_IHkS5rrBv> zKvme3SuBZxphXAVpalt_r3e86Vy#Y&5wLX%tRQLdIt68cX;ossAC_$2zWh15Dr+KFt~{Az_Hz9OvD=4UZCb_A z?G!m@gN*mo+;v~+2jd!8)0&1FH5H+UKQQU6D6OuF6WgEPl`P9OK!t zZebBthd=Fq<2~{1@-@yoT}zK&56JS;Tfb-jwtL3z`dHn|4g^a9VhT+xx|apTA=Ao}a5&zUTMbdGqC_`MVu^%D33GE-hDQYhFw4 zov5E$Z%Ue!+3zmZTe$JMgMO%m7|6~Gs!Na;nJDORA;&Bz!VxP_2ur?P@yEXI&Av(# T-idY$3=9mOu6{1-oD!M \uicontrol Options > \uicontrol Nim > \uicontrol Tools, and enter the path to the tool executable in the \uicontrol Path field. + \else + \include qtcreator-variables.qdocinc qtcreator variables \endif */ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc index 5dbdb44b176..f038e900054 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-environment.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -93,49 +93,11 @@ \section1 Using Environment Variables - You can use any environment variables to in build, deploy, and run + You can use any environment variables in build, deploy, and run configurations. For a list of variable names, select \uicontrol {Build - Settings} > \uicontrol {Build Environment} > \uicontrol Details}. + Settings} > \uicontrol {Build Environment} > \uicontrol Details. Environment variables are referenced using the native syntax: $VARNAME or ${VARNAME} on Unix and %VARNAME% on Windows. - \section1 Using Qt Creator Variables - - You can use \QC variables in arguments, executable paths, and working - directories. The variables take care of quoting their expansions, so you do - not need to put them in quotes. Select the \inlineimage replace.png - (\uicontrol {Variables}) button in a field to select from a list of - variables that are available in a particular context. - - The following syntax enables you to use environment variables as \QC - variables: %{Env:VARNAME}. - - \QC uses pattern substitution when expanding variable names. To replace the - first match of \e pattern within \e variable with \e replacement, use: - - \badcode - %{variable/pattern/replacement} - \endcode - - To replace all matches of \e pattern within \e variable with \e replacement, - use: - - \badcode - %{variable//pattern/replacement} - \endcode - - The pattern can be a regular expression and the replacement can contain - backreferences. For example, if \c %{variable} is \c my123var, then - \c %{variable/(..)(\d+)/\2\1} is expanded to \c {123myvar}. - - Instead of the forward slash, you can also use the pound sign (\c #) as - the substitution character. This can be helpful if the value is supposed - to be a file path, in which case forward slashes might get translated - to backslashes on Windows hosts. - - To use the default value if the variable is not set, use: - - \badcode - %{variable:-default} - \endcode + \include qtcreator-variables.qdocinc qtcreator variables */ diff --git a/doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc b/doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc new file mode 100644 index 00000000000..65c0fe10bfd --- /dev/null +++ b/doc/qtcreator/src/projects/creator-qtcreator-variables.qdocinc @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! +//! [qtcreator variables] + \section1 Using Qt Creator Variables + + You can use \QC variables in arguments, executable paths, and working + directories. The variables take care of quoting their expansions, so you do + not need to put them in quotes. + + Select the \inlineimage replace.png + (\uicontrol {Variables}) button in a field to select from a list of + variables that are available in a particular context. + For more information about each variable, move the cursor over it in the + list. + + \image qtcreator-variables.png "Qt Creator Variables dialog displaying a tooltip" + + The following syntax enables you to use environment variables as \QC + variables: %{Env:VARNAME}. + + \QC uses pattern substitution when expanding variable names. To replace the + first match of \e pattern within \e variable with \e replacement, use: + + \badcode + %{variable/pattern/replacement} + \endcode + + To replace all matches of \e pattern within \e variable with \e replacement, + use: + + \badcode + %{variable//pattern/replacement} + \endcode + + The pattern can be a regular expression and the replacement can contain + backreferences. For example, if \c %{variable} is \c my123var, then + \c %{variable/(..)(\d+)/\2\1} is expanded to \c {123myvar}. + + Instead of the forward slash, you can also use the pound sign (\c #) as + the substitution character. This can be helpful if the value is supposed + to be a file path, in which case forward slashes might get translated + to backslashes on Windows hosts. + + To use the default value if the variable is not set, use: + + \badcode + %{variable:-default} + \endcode +//! [qtcreator variables] +*/