Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
Description
A way to reduce the name clashes with multiple imports via a Python-like syntax:
from QtQuick 2.0 import Rectangle, MouseArea Rectangle {} // OK Item {} // NOT FOUND MouseArea {} // OK
from QtQuick 2.0 as QQ2 import Rectangle Rectangle {} // NOT FOUND QQ2.Rectangle {} // OK QQ2.Item {} // NOT FOUND
from QtQuick 2.0 import Rectangle as R, MouseArea as M Rectangle {} // NOT FOUND R {} // OK, alias for Rectangle
And similar variations.
The rationale is minimizing the clashes, just like in other languages.
With the drop of versioned module imports in QML3, either one namespaces everything or we need something like this for long-term big-scale QML projects.