source: trunk/doc/src/snippets/qmake/replacefunction.pro@ 568

Last change on this file since 568 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 1.0 KB
Line 
1#! [0]
2defineReplace(headersAndSources) {
3 variable = $$1
4 names = $$eval($$variable)
5 headers =
6 sources =
7
8 for(name, names) {
9 header = $${name}.h
10 exists($$header) {
11 headers += $$header
12 }
13 source = $${name}.cpp
14 exists($$source) {
15 sources += $$source
16 }
17 }
18 return($$headers $$sources)
19}
20#! [0]
21
22defineReplace(matchingFiles) {
23 names = $$ARGS
24 files =
25
26 for(name, names) {
27 header = $${name}.h
28 source = $${name}.cpp
29 exists($$header):exists($$source) {
30 files += $$header
31 files += $$source
32 }
33 }
34 return($$files)
35}
36
37names = delegate model view main
38message(Finding all headers and sources from the following list of names:)
39message($$names)
40allFiles = $$headersAndSources(names)
41message(Found: $$allFiles)
42
43message(Finding only matching headers and sources from the following list of names:)
44message($$names)
45matching = $$matchingFiles($$names)
46message(Found: $$matching)
Note: See TracBrowser for help on using the repository browser.