Hi! You must set the property of cmd object in prepare script.
cmd.serverPort = serverPort; See an example here: http://doc.qt.io/qbs/commands.html#javascriptcommand 2015-08-13 12:59 GMT+03:00 Stephan Gatzka <[email protected]>: > Hi! > > I'd like to access a property defined in a Module with in a > JavaScriptCommand return by prepare in a Rule: > > Module { > property string serverPort: "12345" > Rule { > > ... > > prepare: { > var cmd = new JavaScriptCommand(); > cmd.sourceCode = function() { > ... > print("serverport: " + serverPort) > } > return cmd; > } > } > } > > This module is references in a CppApplication via Depends {} > > qbs complains that the variable can't be found. I think I've just no clue > about the namespaces in qbs. > > Maybe someone can help me out here? > > Thanks, > > Stephan > _______________________________________________ > QBS mailing list > [email protected] > http://lists.qt-project.org/mailman/listinfo/qbs > -- С уважением, / Best regards Любимов Илья / Ilya Lyubimov
_______________________________________________ QBS mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qbs
