[Qbs] Property accessibility from Probe in 1.11

resurrection at centrum.cz resurrection at centrum.cz
Wed Feb 7 18:09:31 CET 2018


Alright I see. Currently I am using it to access "global" functions defined as properties in top-level Project. Would moving them to external Module and importing that work in Probe? Or do I need to specify re-declare those I use in each Probe?
______________________________________________________________
> Od: Christian Kandeler <christian.kandeler at qt.io>
> Komu: qbs at qt-project.org
> Datum: 07.02.2018 17:59
> Předmět: Re: [Qbs] Property accessibility from Probe in 1.11
>
On Wed, 7 Feb 2018 16:58:16 +0100
 <resurrection at centrum.cz> wrote:
 
 > Project {
 >     property var someProperty: "Hello" //explicit property
 >  
 >     Probe {
 >         id: scanner
 >         configure: {
 >             console.info(someProperty)
 >             console.info(sourceDirectory)
 >         }
 >     }
 > }
 >  
 > Now this used to work. But now it does not in 1.11 with Qbs complaining about both properties being unknown. And since there is no "project" property in Probe one has to do:
 >  
 > Project {
 >     property var someProperty: "Hello" //explicit property
 >  
 >     Probe {
 >         id: scanner
 >         property var parent: project
 >         configure:  {
 >             console.info(parent.someProperty)
 >             console.info(parent.sourceDirectory)
 >         }
 >     }
 > }
 >  
 > Was this change intentional?
 
 Yes. By having to explicitly provide all input properties, you are forced declare an interface for your Probe, so that it is immediately obvious both to you and to qbs which properties are relevant (and thus need to be considered when figuring out whether the Probe has to be re-run).
 Note that you have tricked the system by providing an item rather than a property. This defeats the purpose, and we don't guarantee that it will keep working. 
 
 
 Christian
 _______________________________________________
 Qbs mailing list
 Qbs at qt-project.org
 http://lists.qt-project.org/mailman/listinfo/qbs <http://lists.qt-project.org/mailman/listinfo/qbs>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20180207/48cc6a1b/attachment.html>


More information about the Qbs mailing list