[Moved] QML and grouped properties
-
I have next code to imitate grouped properties in Style.qml:
@
QtObject {
property QtObject color: QtObject {
property QtObject background: QtObject {
property string main: "black"
}
}
@
In another qml I have:
@
//...
Style {
id: style
}
//...
@Things like
@
Rectangle { color = style.color.background.main }
@
works ok, but there is no completion for them in QtCreator.
Maybe someone knows another way to imitate grouped property? Or it is the only way and I should move it to Tools forum with question about autocompletion in QtCreator :) -
qtrahul, how your question is related to this topic? And also what do you mean by "run in QtCreator"?
-
I didn't understand how it is related to post.
QML code can be run either in qmlviewer or inside your C++ app (wrapper made by QtCreator is actually generated C++ app). -
[quote author="qtrahul" date="1293212187"]Where do we run(compile) QML code.
qmlviewer or in Qt creator ?[/quote]Just to add that QML code is never compiled.
bq. A QML component is a template that is interpreted by the QML runtime.
-
Christmas holidays are over, so moving this thread up :)
-
[quote author="Denis Kormalev" date="1292937212"]
Maybe someone knows another way to imitate grouped property? Or it is the only way and I should move it to Tools forum with question about autocompletion in QtCreator :)[/quote]Your approach seems fine to me -- I'd suggest asking in the Tools forum (or lodging a suggestion on http://bugreports.qt.nokia.com if there isn't one already).
Michael
-
mbrasser, thanks for answer, topic is moved :)
fcrochik, I'll do it later.