Properties binding doesn't work
When we use
pluginType: "dialog"
we can use different elements inside dialog window such as Text or Rectangle or others.
According to Qt documentation properties declaration such as
Rectangle { height: parent.height
or
anchors.fill: parent
binds element property to the property of the parent, but it doesn't work in plugin examples "scorelist", "helloqml" and some test examples I have written.
Why so and how can we bind in "dialog" plugins properties of dialog elements to the parent?
Comments
I should correct the question!
I've found that binding doesn't work in PluginCreator but works when we call plugin from Plugins menu.
So actual question is - why binding doesn't work in PluginCreator?
In reply to I should correct the by straannick
I can't give you a real answer (yet). But I do know that running your plugin from the Plugin Creator means that internally it creates a new Component/QQuickView on the spot. When ran from the menu, your plugin likely has already been constructed internally (but I haven't looked up yet how).
I strongly suspect that either not the same logic is used to create the plugin instance, or that the time of doing so generates different results (possibly inherent to Qt).
In reply to I can't give you a real by jeetee
Thank you, I suppose same thing.
I think it should be noted in new version of the Handbook to help people not spend time for such problems :-)
In reply to Thank you, I suppose same by straannick
Well, it's a bug... if we have to document every single bug in the handbook, it will become a 10000 pages handbook and nobody would read it... Can you submit an issue in the issue tracker instead?
If anyone wants to take a look:
Plugins triggered from the menu are constructed here https://github.com/musescore/MuseScore/blob/522e84dfb196ac7a61830c4666f…
Plugins triggered from the plugin creator are created here https://github.com/musescore/MuseScore/blob/522e84dfb196ac7a61830c4666f…
In reply to Well, it's a bug... if we by [DELETED] 5
Taking a look in #97316: Investigate differences between plugins ran from the Creator and the Menu