Qmake: defineReplace / defineTest - How to use more than one argument to custom function?



  • qmake allows custom functions, of either "Replace" type that returns a list of results that can be accessed with the "$$" prefix to the declared name or "Test" type that return a boolean that can be used as the4 test to a "scope". The "documentation":http://qt-project.org/doc/qt-5/qmake-language.html#replace-functions for these is a bit sparse and it seems to be the only reference! It is clear that accessing the first "argument" passed to the custom function is by the use of 1 or $${1} depending on the situation and I think I read somewhere that ARGS or $${ARGS} contains a count of the number of arguments passed. It has only just become clear to me (I had a thought whilst writing this out) that multiple arguments to the function are comma separated, which may not be something that would automatically have been guessed, though clearly subsequent arguments are 2 (or $${2}), 3, ... etc. . Perhaps the documentation could be enlarged a little to give some more examples? I'm posting this also as something others hunting for details might find; as it seems to be something that does not get a lot of use!



  • I have the same question


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.