This question might have gone to the "Qt beginners" section, but I hope to get an answer here even faster.
I am confused about the semantics of QML's id references. Documentation says "id values are resolved according to the document scope" but it is not clear for me what this scope exactly is (is it "static" according to first initialization or "dynamic" according to particular instantiation).
For example,
* Suppose I have a QML file MyButton which refers to some id "component" inside.
* I use MyButton in two different nested contexts. Once as follows:
MyRootPage -> MyButtonContainer -> MyButton
and once as follows:
MyRootPage -> MyButton.
(that is, I have a MyRootPage QML which instantiates a MyButtonContainer which instantiates a couple of MyButton's, but MyRootPage also instantiates a couple of "bare" MyButton's too).
* Given that both MyRootPage and MyButtonContainer have the line "id: component" in them, how would the id reference "component" be interpreted inside each MyButton instance?
Does "document scoping" mean now, that in the first case it will refer to a MyButtonContainer instance, and in the second case, to a MyRootPage instance?
Thank you. An short authoritative answer like "yes, you understood things correctly" would suffice. A pointer to a written doc that explains that would be especially awesome.



