summaryrefslogtreecommitdiffstats
path: root/qmake/doc
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-12 20:38:54 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-05-25 06:18:50 +0000
commit3d21634fb693634b7d41a152287d29afb80ac5e2 (patch)
tree39fcb51366074ead0085e8872e2ebbc8144a64a6 /qmake/doc
parent8bd0c3d4fc335ae39a02821a066a39f0fd6b0311 (diff)
add $$take_first() and $$take_last() functions
while implementing stacks and queues was possible before with the help of $$member(), these functions make it much more straight-forward. [ChangeLog][qmake] Added $$take_first() and $$take_last() functions. Change-Id: I4922a5331780e468a42c663c9ad3c6456a95a6bf Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'qmake/doc')
-rw-r--r--qmake/doc/src/qmake-manual.qdoc26
1 files changed, 24 insertions, 2 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 5c6afcf191..c196cb841a 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -2847,6 +2847,7 @@
MY_VAR2 will contain '-Lone -Ltwo -Lthree -Lfour -Lfive', and MY_VAR3 will
contain 'three two three'.
+ \target fn_first
\section2 first(variablename)
Returns the first value of \c variablename.
@@ -2855,7 +2856,7 @@
\snippet code/doc_src_qmake-manual.pro 161
- See also \l{last(variablename)}{last()}.
+ See also \l{take_first()}, \l{fn_last}{last()}.
\section2 format_number(number[, options...])
@@ -2903,6 +2904,7 @@
to empty strings. If you need to encode spaces in \c glue, \c before, or \c
after, you must quote them.
+ \target fn_last
\section2 last(variablename)
Returns the last value of \c variablename.
@@ -2911,7 +2913,7 @@
\snippet code/doc_src_qmake-manual.pro 162
- See also \l{first(variablename)}{first()}.
+ See also \l{take_last()}, \l{fn_first}{first()}.
\section2 list(arg1 [, arg2 ..., argn])
@@ -3063,6 +3065,26 @@
See also \l{shell_quote(arg)}{shell_quote()}.
+ \target take_first()
+ \section2 take_first(variablename)
+
+ Returns the first value of \c variablename and removes it from the
+ source variable.
+
+ This provides convenience for implementing queues, for example.
+
+ See also \l{take_last()}, \l{fn_first}{first()}.
+
+ \target take_last()
+ \section2 take_last(variablename)
+
+ Returns the last value of \c variablename and removes it from the
+ source variable.
+
+ This provides convenience for implementing stacks, for example.
+
+ See also \l{take_first()}, \l{fn_last}{last()}.
+
\target unique
\section2 unique(variablename)