Unsolved import QtQuick.Controls 2.0 as QQC2
-
good morning,what does that " as QQC2"
-
@Nio74 It's just a short name for "QtQuick.Controls 2.0". You can put what ever you want after "as".
You should read http://doc.qt.io/qt-5/qtqml-syntax-imports.html -
@Nio74
it's called "import namespace" and in most cases not needed.
It comes in handy when two imports provide an element with the same type name.To make them distinguishable (the later import overrides the element types with same names from the previous one) you then can access them via the namespace prefix.
import QtQuick.Controls 2.0 as QQC2 import QtQuick.Controls 1.0 as QQC1 // would override Button (and some others from Controls 2) without using namespace Item { QQC2.Button { } QQC1.Button { } }
-
thank you very clear answer, thank you all