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 <[email protected]>
Komu: [email protected]
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
<[email protected]> 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
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs
<http://lists.qt-project.org/mailman/listinfo/qbs>
_______________________________________________
Qbs mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/qbs