Answer the question
In order to leave comments, you need to log in
How to autocomplete in QML for objects of type QtObject?
1) For example, there is a file with an application design system from UI to qml:
file Design.qml
QtObject {
id: designSystem
property QtObject colors: QtObject {
property color buttonColor: "#FF4F12"
property color backgroundColor: "#00AAE7"
property color tileColor: "#5DC600"
...
}
property QtObject size: QtObject {
....
}
}
qmlRegisterSingletonType(QUrl("qrc:/DesignSystem.qml"), "app.design", 1, 0, "Design");
import app.design 1.0
Rectangle {
id: button
color: Design.color.buttonColor // Вопрос к данной строчке
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question