Solved QML Style Singleton Import
-
Hi,
I tried to follow http://wiki.qt.io/Qml_Styling for making a singleton to define my style.
It looks like this
pragma Singleton import QtQuick 2.0 QtObject { property color myColor: "#000080" }
If I import it as
import Style 1.0
and use it like this:
Style.myColor
everything is working fine. However, if I do
import Style 1.0 as St
and then try to use it as
St.myColor
is not working.
-
If you import the singleton type into a namespace, the singleton type name is not replaced by the namespace, but available in the namespace:
St.Style.myColor
-
Thank you, thats it