Qt 6.11 is out! See what's new in the release
blog
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.0and use it like this:
Style.myColoreverything is working fine. However, if I do
import Style 1.0 as Stand then try to use it as
St.myColoris 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