summaryrefslogtreecommitdiffstats
path: root/qmake/doc/src/snippets/qmake/replacefunction.pro
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-06-13 20:42:07 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-17 15:41:55 +0200
commit1c05791bd1e89bd7551d77e80db7fa4750f2631f (patch)
tree676b5a72d3313e45ff1e3104c6395b3c8b7498cb /qmake/doc/src/snippets/qmake/replacefunction.pro
parentd9fb6e6dbb2b322556d581265da2442e3b91a6a3 (diff)
move qmake docs into qtbase
as of qttools/18a5e89623815f5355b4173a2e93609eb10289d1 Change-Id: I75cb55e0c404449a4e0d963e09185287a3f6343e Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Diffstat (limited to 'qmake/doc/src/snippets/qmake/replacefunction.pro')
-rw-r--r--qmake/doc/src/snippets/qmake/replacefunction.pro46
1 files changed, 46 insertions, 0 deletions
diff --git a/qmake/doc/src/snippets/qmake/replacefunction.pro b/qmake/doc/src/snippets/qmake/replacefunction.pro
new file mode 100644
index 0000000000..98013ba42d
--- /dev/null
+++ b/qmake/doc/src/snippets/qmake/replacefunction.pro
@@ -0,0 +1,46 @@
+#! [0]
+defineReplace(headersAndSources) {
+ variable = $$1
+ names = $$eval($$variable)
+ headers =
+ sources =
+
+ for(name, names) {
+ header = $${name}.h
+ exists($$header) {
+ headers += $$header
+ }
+ source = $${name}.cpp
+ exists($$source) {
+ sources += $$source
+ }
+ }
+ return($$headers $$sources)
+}
+#! [0]
+
+defineReplace(matchingFiles) {
+ names = $$ARGS
+ files =
+
+ for(name, names) {
+ header = $${name}.h
+ source = $${name}.cpp
+ exists($$header):exists($$source) {
+ files += $$header
+ files += $$source
+ }
+ }
+ return($$files)
+}
+
+names = delegate model view main
+message(Finding all headers and sources from the following list of names:)
+message($$names)
+allFiles = $$headersAndSources(names)
+message(Found: $$allFiles)
+
+message(Finding only matching headers and sources from the following list of names:)
+message($$names)
+matching = $$matchingFiles($$names)
+message(Found: $$matching)