Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0
-
None
-
6ebf215fdaf2d757ab90ae4d46c4b938e978e2dc
Description
There is no way to register global objects when importing a QML module.
In Qt components I'd like to have a global Screen object that respects the 'import ... as Foo' prefix. The global object also needs to export types as well as methods.
So this should work (Screen is a QObject with a Orientation enum and orientation property):
import Qt.components
Item
Item
{ orientation: Screen.Portrait }import Qt.components as Components
Item
Item
{ orientation: Components.Screen.Portrait }