Setting property not setting the value
-
Hi,
i have something like thisRowLayout { MyButton { id: b1 visible: false } MyButton { id: b2 visible: false } // ... }
then in a javascript function i set the 'visible' property and directly log it out and it is not changed, why?
function test() { let newValue = true console.debug("newValue: ", newValue) // prints true -> correct b1.visible = newValue console.debug("newValue: ", b1.visible) // prints false -> wrong! why? }
It seems when setting the visible property and then getting it is not set?
Maybe somebody can explain me what's going on here, please ?Greetings
Nando -
Why is there a dot behind both of your
debug
calls?Apart from that - it should work, your code seems correct to me.
-
I had a similar issue last week setting
x
andy
on aPopup
. I posted a question in the forum (see here) but no-one answered.If this is known and expected behaviour, it really ought to be documented and explained more prominently somewhere. If it's not expected, what is going on?
-
@sierdzio said in Setting property not setting the value:
Why is there a dot behind both of your
debug
calls?Apart from that - it should work, your code seems correct to me.
That dot is type, sorry....
Hmmm Okay i have MyButton inside a Layout...Maybe
the layout somehow overwrites the visible ? -
This post is deleted!