In Qt Quick, global stuff (for QML and JS) is added to the rootContext of the QML engine. You access it directly, without specifying any parent object.
As for pure JavaScript, AFAIK, all contexts are separate, so you can’t specify anything truly global. But my knowledge of JS is too limited to say for sure.
↧