QML: Finding object by `objectName` in JavaScript

As you may have seen, i don’t use objectName at all. I had no idea it existed.

Instead i assign the accepted action in the enclosing component.
Or more specifically, connect that signal(?) to a a function defined there, like this:

Though i really have no formal understanding of how scoping is supposed to work - i have been told that similar things shouldn’t actually work.

Sometimes i have resorted to defining a random signal somewhere way up in the ApplicationWindow and triggering (on) that.