Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 19

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qmake-manual.qdoc -->
  <title>Replace Functions | qmake Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qmake-manual.html">qmake Manual</a></td><td >Replace Functions</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qmake-manual.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="qmake-variable-reference.html" />
  <link rel="next" href="qmake-test-function-reference.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="qmake-variable-reference.html">Variables</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="qmake-test-function-reference.html">Test Functions</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#built-in-replace-functions">Built-in Replace Functions</a></li>
<li class="level2"><a href="#absolute-path-path-base">absolute_path(path[, base])</a></li>
<li class="level2"><a href="#basename-variablename">basename(variablename)</a></li>
<li class="level2"><a href="#cat-filename-mode">cat(filename[, mode])</a></li>
<li class="level2"><a href="#clean-path-path">clean_path(path)</a></li>
<li class="level2"><a href="#dirname-file">dirname(file)</a></li>
<li class="level2"><a href="#enumerate-vars">enumerate_vars</a></li>
<li class="level2"><a href="#escape-expand-arg1-arg2-argn">escape_expand(arg1 [, arg2 ..&#x2e;, argn])</a></li>
<li class="level2"><a href="#find-variablename-substr">find(variablename, substr)</a></li>
<li class="level2"><a href="#files-pattern-recursive-false">files(pattern[, recursive=false])</a></li>
<li class="level2"><a href="#first-variablename">first(variablename)</a></li>
<li class="level2"><a href="#format-number-number-options">format_number(number[, options..&#x2e;])</a></li>
<li class="level2"><a href="#fromfile-filename-variablename">fromfile(filename, variablename)</a></li>
<li class="level2"><a href="#getenv-variablename">getenv(variablename)</a></li>
<li class="level2"><a href="#join-variablename-glue-before-after">join(variablename, glue, before, after)</a></li>
<li class="level2"><a href="#last-variablename">last(variablename)</a></li>
<li class="level2"><a href="#list-arg1-arg2-argn">list(arg1 [, arg2 ..&#x2e;, argn])</a></li>
<li class="level2"><a href="#lower-arg1-arg2-argn">lower(arg1 [, arg2 ..&#x2e;, argn])</a></li>
<li class="level2"><a href="#member-variablename-start-end">member(variablename [, start [, end]])</a></li>
<li class="level2"><a href="#num-add-arg1-arg2-argn">num_add(arg1 [, arg2 ..&#x2e;, argn])</a></li>
<li class="level2"><a href="#prompt-question-decorate">prompt(question [, decorate])</a></li>
<li class="level2"><a href="#quote-string">quote(string)</a></li>
<li class="level2"><a href="#re-escape-string">re_escape(string)</a></li>
<li class="level2"><a href="#read-registry-tree-key-flag">read_registry(tree, key[, flag])</a></li>
<li class="level2"><a href="#relative-path-filepath-base">relative_path(filePath[, base])</a></li>
<li class="level2"><a href="#replace-string-old-string-new-string">replace(string, old_string, new_string)</a></li>
<li class="level2"><a href="#resolve-depends-variablename-prefix">resolve_depends(variablename, prefix)</a></li>
<li class="level2"><a href="#reverse-variablename">reverse(variablename)</a></li>
<li class="level2"><a href="#section-variablename-separator-begin-end">section(variablename, separator, begin, end)</a></li>
<li class="level2"><a href="#shadowed-path">shadowed(path)</a></li>
<li class="level2"><a href="#shell-path-path">shell_path(path)</a></li>
<li class="level2"><a href="#shell-quote-arg">shell_quote(arg)</a></li>
<li class="level2"><a href="#size-variablename">size(variablename)</a></li>
<li class="level2"><a href="#sort-depends-variablename-prefix">sort_depends(variablename, prefix)</a></li>
<li class="level2"><a href="#sorted-variablename">sorted(variablename)</a></li>
<li class="level2"><a href="#split-variablename-separator">split(variablename, separator)</a></li>
<li class="level2"><a href="#sprintf-string-arguments">sprintf(string, arguments..&#x2e;)</a></li>
<li class="level2"><a href="#str-member-arg-start-end">str_member(arg [, start [, end]])</a></li>
<li class="level2"><a href="#str-size-arg">str_size(arg)</a></li>
<li class="level2"><a href="#system-command-mode-stsvar">system(command[, mode[, stsvar]])</a></li>
<li class="level2"><a href="#system-path-path">system_path(path)</a></li>
<li class="level2"><a href="#system-quote-arg">system_quote(arg)</a></li>
<li class="level2"><a href="#take-first-variablename">take_first(variablename)</a></li>
<li class="level2"><a href="#take-last-variablename">take_last(variablename)</a></li>
<li class="level2"><a href="#unique-variablename">unique(variablename)</a></li>
<li class="level2"><a href="#upper-arg1-arg2-argn">upper(arg1 [, arg2 ..&#x2e;, argn])</a></li>
<li class="level2"><a href="#val-escape-variablename">val_escape(variablename)</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Replace Functions</h1>
<span class="subtitle"></span>
<!-- $$$qmake-function-reference.html-description -->
<div class="descr"> <a name="details"></a>
<p>qmake provides functions for processing the contents of variables during the configuration process. These functions are called <i>replace functions</i>. Typically, they return values that you can assign to other variables. You can obtain these values by prefixing a function with the <code>$$</code> operator. Replace functions can be divided into built-in functions and function libraries.</p>
<p>See also <a href="qmake-test-function-reference.html">Test Functions</a>.</p>
<a name="built-in-replace-functions"></a>
<h2 id="built-in-replace-functions">Built-in Replace Functions</h2>
<p>Basic replace functions are implemented as built-in functions.</p>
<a name="absolute-path-path-base"></a>
<h3 id="absolute-path-path-base">absolute_path(path[, base])</h3>
<p>Returns the absolute path of <code>path</code>.</p>
<p>If <code>base</code> is not specified, uses the current directory as the base directory. If it is a relative path, it is resolved relative to the current directory before use.</p>
<p>For example, the following call returns the string <code>&quot;/home/johndoe/myproject/readme.txt&quot;</code>:</p>
<pre class="cpp">

  message($$absolute_path(&quot;readme.txt&quot;, &quot;/home/johndoe/myproject&quot;))

</pre>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#clean-path-path">clean_path()</a>, <a href="qmake-function-reference.html#relative-path-filepath-base">relative_path()</a>.</p>
<a name="basename-variablename"></a>
<h3 id="basename-variablename">basename(variablename)</h3>
<p>Returns the basename of the file specified in <code>variablename</code>.</p>
<p>For example:</p>
<pre class="cpp">

  FILE = /etc/passwd
  FILENAME = $$basename(FILE) #passwd

</pre>
<a name="qmake-cat"></a><a name="cat-filename-mode"></a>
<h3 id="cat-filename-mode">cat(filename[, mode])</h3>
<p>Returns the contents of <code>filename</code>. You can specify the following options for <code>mode</code>:</p>
<ul>
<li><code>blob</code> returns the entire contents of the file as one value</li>
<li><code>lines</code> returns each line as a separate value (without line endings)</li>
<li><code>true</code> (default value) and <code>false</code> return file contents as separate values, split according to qmake value list splitting rules (as in variable assignments). If <code>mode</code> is <code>false</code>, values that contain only a newline character are inserted into the list to indicate where line breaks were in the file.</li>
</ul>
<a name="clean-path-path"></a>
<h3 id="clean-path-path">clean_path(path)</h3>
<p>Returns <code>path</code> with directory separators normalized (converted to &quot;/&quot;) and redundant ones removed, and &quot;.&quot;s and &quot;..&quot;s resolved (as far as possible). This function is a wrapper around <a href="../qtcore/qdir.html#cleanPath">QDir::cleanPath</a>.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#absolute-path-path-base">absolute_path()</a>, <a href="qmake-function-reference.html#relative-path-filepath-base">relative_path()</a>, <a href="qmake-function-reference.html#shell-path-path">shell_path()</a>, <a href="qmake-function-reference.html#system-path-path">system_path()</a>.</p>
<a name="dirname-file"></a>
<h3 id="dirname-file">dirname(file)</h3>
<p>Returns the directory name part of the specified file. For example:</p>
<pre class="cpp">

  FILE = /etc/X11R6/XF86Config
  DIRNAME = $$dirname(FILE) #/etc/X11R6

</pre>
<a name="enumerate-vars"></a>
<h3 id="enumerate-vars">enumerate_vars</h3>
<p>Returns a list of all defined variable names.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<a name="escape-expand-arg1-arg2-argn"></a>
<h3 id="escape-expand-arg1-arg2-argn">escape_expand(arg1 [, arg2 ..&#x2e;, argn])</h3>
<p>Accepts an arbitrary number of arguments. It expands the escape sequences <code>\n</code>, <code>\r</code>, <code>\t</code> for each argument and returns the arguments as a list.</p>
<p><b>Note: </b>If you specify the string to expand literally, you need to escape the backslashes, as illustrated by the following code snippet:</p><pre class="cpp">

  message(&quot;First line$$escape_expand(\\n)Second line&quot;)

</pre>
<a name="findfunction"></a><a name="find-variablename-substr"></a>
<h3 id="find-variablename-substr">find(variablename, substr)</h3>
<p>Returns all the values in <code>variablename</code> that match the regular expression <code>substr</code>.</p>
<pre class="cpp">

  MY_VAR = one two three four
  MY_VAR2 = $$join(MY_VAR, &quot; -L&quot;, -L) -Lfive
  MY_VAR3 = $$member(MY_VAR, 2) $$find(MY_VAR, t.*)

</pre>
<p>MY_VAR2 will contain '-Lone -Ltwo -Lthree -Lfour -Lfive', and MY_VAR3 will contain 'three two three'.</p>
<a name="files-pattern-recursive-false"></a>
<h3 id="files-pattern-recursive-false">files(pattern[, recursive=false])</h3>
<p>Expands the specified wildcard pattern and returns a list of filenames. If <code>recursive</code> is true, this function descends into subdirectories.</p>
<a name="fn-first"></a><a name="first-variablename"></a>
<h3 id="first-variablename">first(variablename)</h3>
<p>Returns the first value of <code>variablename</code>.</p>
<p>For example, the following call returns <code>firstname</code>:</p>
<pre class="cpp">

  CONTACT = firstname middlename surname phone
  message($$first(CONTACT))

</pre>
<p>See also <a href="qmake-function-reference.html#take-first">take_first</a>(), <a href="qmake-function-reference.html#fn-last">last()</a>.</p>
<a name="format-number"></a><a name="format-number-number-options"></a>
<h3 id="format-number-number-options">format_number(number[, options..&#x2e;])</h3>
<p>Returns <code>number</code> in the format specified by <code>options</code>. You can specify the following options:</p>
<ul>
<li><code>ibase=n</code> sets the base of the input to <code>n</code></li>
<li><code>obase=n</code> sets the base of the output to <code>n</code></li>
<li><code>width=n</code> sets the minimum width of the output to <code>n</code>. If the output is shorter than <code>width</code>, it is padded with spaces</li>
<li><code>zeropad</code> pads the output with zeroes instead of spaces</li>
<li><code>padsign</code> prepends a space to positive values in the output</li>
<li><code>alwayssign</code> prepends a plus sign to positive values in the output</li>
<li><code>leftalign</code> places the padding to the right of the value in the output</li>
</ul>
<p>Floating-point numbers are currently not supported.</p>
<p>For example, the following call converts the hexadecimal number <code>BAD</code> to <code>002989</code>:</p>
<pre class="cpp">

  message($$format_number(BAD, ibase=16 width=6 zeropad))

</pre>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<a name="fromfile-filename-variablename"></a>
<h3 id="fromfile-filename-variablename">fromfile(filename, variablename)</h3>
<p>Evaluates <code>filename</code> as a qmake project file and returns the value assigned to <code>variablename</code>.</p>
<p>See also <a href="qmake-test-function-reference.html#infile-filename-var-val">infile()</a>.</p>
<a name="getenv-variablename"></a>
<h3 id="getenv-variablename">getenv(variablename)</h3>
<p>Returns the value of the environment variable <code>variablename</code>. This is mostly equivalent to the <code>$$(variablename)</code> syntax. The <code>getenv</code> function, however, supports environment variables with parentheses in their name.</p>
<p>This function was introduced in Qt 5.12.</p>
<a name="join-variablename-glue-before-after"></a>
<h3 id="join-variablename-glue-before-after">join(variablename, glue, before, after)</h3>
<p>Joins the value of <code>variablename</code> with <code>glue</code>. If this value is not empty, this function prefixes the value with <code>before</code> and suffixes it with <code>after</code>. <code>variablename</code> is the only required field, the others default to empty strings. If you need to encode spaces in <code>glue</code>, <code>before</code>, or <code>after</code>, you must quote them.</p>
<a name="fn-last"></a><a name="last-variablename"></a>
<h3 id="last-variablename">last(variablename)</h3>
<p>Returns the last value of <code>variablename</code>.</p>
<p>For example, the following call returns <code>phone</code>:</p>
<pre class="cpp">

  CONTACT = firstname middlename surname phone
  message($$last(CONTACT))

</pre>
<p>See also <a href="qmake-function-reference.html#take-last">take_last</a>(), <a href="qmake-function-reference.html#fn-first">first()</a>.</p>
<a name="list-arg1-arg2-argn"></a>
<h3 id="list-arg1-arg2-argn">list(arg1 [, arg2 ..&#x2e;, argn])</h3>
<p>Takes an arbitrary number of arguments. It creates a uniquely named variable that contains a list of the arguments, and returns the name of that variable. You can use the variable to write a loop as illustrated by the following code snippet</p>
<pre class="cpp">

  for(var, $$list(foo bar baz)) {
      ...
  }

</pre>
<p>instead of:</p>
<pre class="cpp">

  values = foo bar baz
  for(var, values) {
      ...
  }

</pre>
<a name="lower-arg1-arg2-argn"></a>
<h3 id="lower-arg1-arg2-argn">lower(arg1 [, arg2 ..&#x2e;, argn])</h3>
<p>Takes an arbitrary number of arguments and converts them to lower case.</p>
<p>See also <a href="qmake-function-reference.html#upper-arg1-arg2-argn">upper()</a>.</p>
<a name="member"></a><a name="member-variablename-start-end"></a>
<h3 id="member-variablename-start-end">member(variablename [, start [, end]])</h3>
<p>Returns the slice of the list value of <code>variablename</code> with the zero-based element indices between <code>start</code> and <code>end</code> (inclusive).</p>
<p>If <code>start</code> is not given, it defaults to zero. This usage is equivalent to <code>$$first(variablename)</code>.</p>
<p>If <code>end</code> is not given, it defaults to <code>start</code>. This usage represents simple array indexing, as exactly one element will be returned.</p>
<p>It is also possible to specify start and end in a single argument, with the numbers separated by two periods.</p>
<p>Negative numbers represent indices starting from the end of the list, with -1 being the last element.</p>
<p>If either index is out of range, an empty list is returned.</p>
<p>If <code>end</code> is smaller than <code>start</code>, the elements are returned in reverse order.</p>
<p><b>Note: </b>The fact that the end index is inclusive and unordered implies that an empty list will be returned only when an index is invalid (which is implied by the input variable being empty).</p><p>See also <a href="qmake-function-reference.html#str-member">str_member</a>().</p>
<a name="num-add"></a><a name="num-add-arg1-arg2-argn"></a>
<h3 id="num-add-arg1-arg2-argn">num_add(arg1 [, arg2 ..&#x2e;, argn])</h3>
<p>Takes an arbitrary number of numeric arguments and adds them up, returning the sum.</p>
<p>Subtraction is implicitly supported due to the possibility to simply prepend a minus sign to a numeric value to negate it:</p>
<pre class="cpp">

  sum <span class="operator">=</span> $$num_add($$first<span class="operator">,</span> <span class="operator">-</span>$$second)

</pre>
<p>If the operand may be already negative, another step is necessary to normalize the number:</p>
<pre class="cpp">

  second_neg <span class="operator">=</span> <span class="operator">-</span>$$second
  second_neg <span class="operator">~</span><span class="operator">=</span> s<span class="operator">/</span><span class="operator">^</span><span class="operator">-</span><span class="operator">-</span><span class="comment">//</span>
  sum <span class="operator">=</span> $$num_add($$first<span class="operator">,</span> $$second_neg)

</pre>
<p>This function was introduced in Qt 5.8&#x2e;</p>
<a name="prompt-question-decorate"></a>
<h3 id="prompt-question-decorate">prompt(question [, decorate])</h3>
<p>Displays the specified <code>question</code>, and returns a value read from stdin.</p>
<p>If <code>decorate</code> is <i>true</i> (the default), the question gets a generic prefix and suffix identifying it as a prompt.</p>
<a name="quote-string"></a>
<h3 id="quote-string">quote(string)</h3>
<p>Converts a whole <code>string</code> into a single entity and returns the result. This is just a fancy way of enclosing the string into double quotes.</p>
<a name="re-escape-string"></a>
<h3 id="re-escape-string">re_escape(string)</h3>
<p>Returns the <code>string</code> with every special regular expression character escaped with a backslash. This function is a wrapper around <a href="../qtcore/qregexp.html#escape">QRegExp::escape</a>.</p>
<a name="read-registry-tree-key-flag"></a>
<h3 id="read-registry-tree-key-flag">read_registry(tree, key[, flag])</h3>
<p>Returns the value of registry key <code>key</code> inside the tree <code>tree</code>.</p>
<p>Only the trees <code>HKEY_CURRENT_USER</code> (<code>HKCU</code>) and <code>HKEY_LOCAL_MACHINE</code> (<code>HKLM</code>) are supported.</p>
<p>The <code>flag</code> may be <code>WOW64_32KEY</code> (<code>32</code>) or <code>WOW64_64KEY</code> (<code>64</code>).</p>
<p><b>Note: </b>This function is available only on Windows hosts.</p><p>This function was introduced in Qt 5.12.1&#x2e;</p>
<a name="relative-path-filepath-base"></a>
<h3 id="relative-path-filepath-base">relative_path(filePath[, base])</h3>
<p>Returns the path to <code>filePath</code> relative to <code>base</code>.</p>
<p>If <code>base</code> is not specified, it is the current project directory. If it is relative, it is resolved relative to the current project directory before use.</p>
<p>If <code>filePath</code> is relative, it is first resolved against the base directory; in that case, this function effectively acts as $$clean_path().</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#absolute-path-path-base">absolute_path()</a>, <a href="qmake-function-reference.html#clean-path-path">clean_path()</a>.</p>
<a name="replace-string-old-string-new-string"></a>
<h3 id="replace-string-old-string-new-string">replace(string, old_string, new_string)</h3>
<p>Replaces each instance of <code>old_string</code> with <code>new_string</code> in the contents of the variable supplied as <code>string</code>. For example, the code</p>
<pre class="cpp">

  MESSAGE = This is a tent.
  message($$replace(MESSAGE, tent, test))

</pre>
<p>prints the message:</p>
<pre class="cpp">

  This is a test.

</pre>
<a name="resolve-depends-variablename-prefix"></a>
<h3 id="resolve-depends-variablename-prefix">resolve_depends(variablename, prefix)</h3>
<p>This is an internal function that you will typically not need.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<a name="reverse-variablename"></a>
<h3 id="reverse-variablename">reverse(variablename)</h3>
<p>Returns the values of <code>variablename</code> in reverse order.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<a name="section-variablename-separator-begin-end"></a>
<h3 id="section-variablename-separator-begin-end">section(variablename, separator, begin, end)</h3>
<p>Returns a section of the value of <code>variablename</code>. This function is a wrapper around <a href="../qtcore/qstring.html#section">QString::section</a>.</p>
<p>For example, the following call outputs <code>surname</code>:</p>
<pre class="cpp">

  CONTACT = firstname:middlename:surname:phone
  message($$section(CONTACT, :, 2, 2))

</pre>
<a name="shadowed-path"></a>
<h3 id="shadowed-path">shadowed(path)</h3>
<p>Maps the path from the project source directory to the build directory. This function returns <code>path</code> for in-source builds. It returns an empty string if <code>path</code> points outside of the source tree.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<a name="shell-path-path"></a>
<h3 id="shell-path-path">shell_path(path)</h3>
<p>Converts all directory separators within <code>path</code> to separators that are compatible with the shell that is used while building the project (that is, the shell that is invoked by the make tool). For example, slashes are converted to backslashes when the Windows shell is used.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#system-path-path">system_path()</a>.</p>
<a name="shell-quote-arg"></a>
<h3 id="shell-quote-arg">shell_quote(arg)</h3>
<p>Quotes <code>arg</code> for the shell that is used while building the project.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#system-quote-arg">system_quote()</a>.</p>
<a name="fn-size"></a><a name="size-variablename"></a>
<h3 id="size-variablename">size(variablename)</h3>
<p>Returns the number of values of <code>variablename</code>.</p>
<p>See also <a href="qmake-function-reference.html#str-size">str_size</a>().</p>
<a name="sort-depends-variablename-prefix"></a>
<h3 id="sort-depends-variablename-prefix">sort_depends(variablename, prefix)</h3>
<p>This is an internal function that you will typically not need.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<a name="sorted-variablename"></a>
<h3 id="sorted-variablename">sorted(variablename)</h3>
<p>Returns the list of values in <code>variablename</code> with entries sorted in ascending ASCII order.</p>
<p>Numerical sorting can be accomplished by zero-padding the values to a fixed length with the help of the <a href="qmake-function-reference.html#format-number">format_number</a>() function.</p>
<p>This function was introduced in Qt 5.8&#x2e;</p>
<a name="split-variablename-separator"></a>
<h3 id="split-variablename-separator">split(variablename, separator)</h3>
<p>Splits the value of <code>variablename</code> into separate values, and returns them as a list. This function is a wrapper around <a href="../qtcore/qstring.html#split-1">QString::split</a>.</p>
<p>For example:</p>
<pre class="cpp">

  CONTACT = firstname:middlename:surname:phone
  message($$split(CONTACT, :))

</pre>
<a name="sprintf-string-arguments"></a>
<h3 id="sprintf-string-arguments">sprintf(string, arguments..&#x2e;)</h3>
<p>Replaces %1-%9 in <code>string</code> with the arguments passed in the comma-separated list of function <code>arguments</code> and returns the processed string.</p>
<a name="str-member"></a><a name="str-member-arg-start-end"></a>
<h3 id="str-member-arg-start-end">str_member(arg [, start [, end]])</h3>
<p>This function is identical to <a href="qmake-function-reference.html#member">member</a>(), except that it operates on a string value instead of a list variable, and consequently the indices refer to character positions.</p>
<p>This function can be used to implement many common string slicing operations:</p>
<pre class="cpp">

  <span class="preprocessor"># $$left(VAR, len)</span>
  left <span class="operator">=</span> $$str_member(VAR<span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> $$num_add($$len<span class="operator">,</span> <span class="operator">-</span><span class="number">1</span>))

  <span class="preprocessor"># $$right(VAR, len)</span>
  right <span class="operator">=</span> $$str_member(VAR<span class="operator">,</span> <span class="operator">-</span>$$num<span class="operator">,</span> <span class="operator">-</span><span class="number">1</span>)

  <span class="preprocessor"># $$mid(VAR, off, len)</span>
  mid <span class="operator">=</span> $$str_member(VAR<span class="operator">,</span> $$off<span class="operator">,</span> $$num_add($$off<span class="operator">,</span> $$len<span class="operator">,</span> <span class="operator">-</span><span class="number">1</span>))

  <span class="preprocessor"># $$mid(VAR, off)</span>
  mid <span class="operator">=</span> $$str_member(VAR<span class="operator">,</span> $$off<span class="operator">,</span> <span class="operator">-</span><span class="number">1</span>)

  <span class="preprocessor"># $$reverse(VAR)</span>
  reverse <span class="operator">=</span> $$str_member(VAR<span class="operator">,</span> <span class="operator">-</span><span class="number">1</span><span class="operator">,</span> <span class="number">0</span>)

</pre>
<p><b>Note: </b>In these implementations, a zero <code>len</code> argument needs to be handled separately.</p><p>See also <a href="qmake-function-reference.html#member">member</a>(), <a href="qmake-function-reference.html#num-add">num_add</a>().</p>
<p>This function was introduced in Qt 5.8&#x2e;</p>
<a name="str-size"></a><a name="str-size-arg"></a>
<h3 id="str-size-arg">str_size(arg)</h3>
<p>Returns the number of characters in the argument.</p>
<p>See also <a href="qmake-function-reference.html#fn-size">size()</a>.</p>
<p>This function was introduced in Qt 5.8&#x2e;</p>
<a name="system-replace"></a><a name="system-command-mode-stsvar"></a>
<h3 id="system-command-mode-stsvar">system(command[, mode[, stsvar]])</h3>
<p>You can use this variant of the <code>system</code> function to obtain stdout from the command and assign it to a variable.</p>
<p>For example:</p>
<pre class="cpp">

  UNAME = $$system(uname -s)
  contains( UNAME, [lL]inux ):message( This looks like Linux ($$UNAME) to me )

</pre>
<p>Like <a href="qmake-function-reference.html#qmake-cat">$$cat()</a>, the <i>mode</i> argument takes <code>blob</code>, <code>lines</code>, <code>true</code>, and <code>false</code> as value. However, the legacy word splitting rules (i.e&#x2e; empty or <code>true</code>, and <code>false</code>) differ subtly.</p>
<p>If you pass <code>stsvar</code>, the command's exit status will be stored in that variable. If the command crashes, the status will be -1, otherwise a non-negative exit code of the command's choosing. Usually, comparing the status with zero (success) is sufficient.</p>
<p>See also the test variant of <a href="qmake-test-function-reference.html#system-command">system()</a>.</p>
<a name="system-path-path"></a>
<h3 id="system-path-path">system_path(path)</h3>
<p>Converts all directory separators within <code>path</code> to separators that are compatible with the shell that is used by the <code>system()</code> functions to invoke commands. For example, slashes are converted to backslashes for the Windows shell.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#shell-path-path">shell_path()</a>.</p>
<a name="system-quote-arg"></a>
<h3 id="system-quote-arg">system_quote(arg)</h3>
<p>Quotes <code>arg</code> for the shell that is used by the <code>system()</code> functions.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#shell-quote-arg">shell_quote()</a>.</p>
<a name="take-first"></a><a name="take-first-variablename"></a>
<h3 id="take-first-variablename">take_first(variablename)</h3>
<p>Returns the first value of <code>variablename</code> and removes it from the source variable.</p>
<p>This provides convenience for implementing queues, for example.</p>
<p>This function was introduced in Qt 5.8&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#take-last">take_last</a>(), <a href="qmake-function-reference.html#fn-first">first()</a>.</p>
<a name="take-last"></a><a name="take-last-variablename"></a>
<h3 id="take-last-variablename">take_last(variablename)</h3>
<p>Returns the last value of <code>variablename</code> and removes it from the source variable.</p>
<p>This provides convenience for implementing stacks, for example.</p>
<p>This function was introduced in Qt 5.8&#x2e;</p>
<p>See also <a href="qmake-function-reference.html#take-first">take_first</a>(), <a href="qmake-function-reference.html#fn-last">last()</a>.</p>
<a name="unique"></a><a name="unique-variablename"></a>
<h3 id="unique-variablename">unique(variablename)</h3>
<p>Returns the list of values in <code>variablename</code> with duplicate entries removed. For example:</p>
<pre class="cpp">

  ARGS = 1 2 3 2 5 1
  ARGS = $$unique(ARGS) #1 2 3 5

</pre>
<a name="upper-arg1-arg2-argn"></a>
<h3 id="upper-arg1-arg2-argn">upper(arg1 [, arg2 ..&#x2e;, argn])</h3>
<p>Takes an arbitrary number of arguments and converts them to upper case.</p>
<p>See also <a href="qmake-function-reference.html#lower-arg1-arg2-argn">lower()</a>.</p>
<a name="val-escape-variablename"></a>
<h3 id="val-escape-variablename">val_escape(variablename)</h3>
<p>Escapes the values of <code>variablename</code> in a way that enables parsing them as qmake code.</p>
<p>This function was introduced in Qt 5.0&#x2e;</p>
</div>
<!-- @@@qmake-function-reference.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="qmake-variable-reference.html">Variables</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="qmake-test-function-reference.html">Test Functions</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>