Qt 6.11 is out! See what's new in the release
blog
Qml Singleton with AutoComplete(IntelliSense)
-
Hello,
I want to use qml Singleton in my project and I can't get AutoComplete to work.
//Styles.qml pragma Singleton import QtQuick 2.11 QtObject { property QtObject cars: QtObject { property string luxury: "bmw" property string exotic: "ferrari" } }I register singleton:
qmlRegisterSingletonType(QUrl("qrc:///singletons/Styles.qml"), "My.Examples", 1, 0, "Styles");import QtQuick 2.11 import QtQuick.Window 2.11 import My.Examples 1.0 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") Text { text: Styles.cars.exotic } }I get the expected output
"ferrari"but when I typeStyles.I should get a dropdown where I could selectcarsbut it doesn't work. -
It is issue with editor. It may have difficulty in recognising the type. Hence the issue.