[QBS] Module property in a rule

Christian Kandeler christian.kandeler at digia.com
Fri May 23 14:00:11 CEST 2014


On 05/23/2014 01:53 PM, olivier musse wrote:
> Once again an issue while trying to get properties in a Rule, I found
> the following is not working and ask myself if it is a bug or not.
> This should really nice if it works then enabling to add to any product
> a set of properties and use them in associated rules.
> See my example below
>
>
> Module{
>       property string ModuleProp:"defaultValue"
>       Rule{
>           prepare:
>               {
>                   var a=product.ProductProp;   //WORKING : can access
> product.ProductProp
>                   var b=product.ModuleProp;    // NOT WORKING :

Of course not. There is no property "ModuleProp" in the product. What 
you probably want it "product.moduleProperty(<module name>, "ModuleProp")".

>               }
>       }
> }
>
> Product{
>       property string Product Prop
> Depend{name:"MyModule"}

Each of these two lines contains a syntax error. Please make sure to 
copy-paste things from an actual file that you tested, otherwise it gets 
unnecessarily hard for us to tell where the real problem is.


Christian



More information about the Qbs mailing list