Re: [Interest] Clean way to define and categorize constants in QML

2016-05-11 Thread Viktória Nemkin
Hello! Thank you everyone for replying to this thread, I'm sorry for the late response. I have been fiddling with all of these for a while, and come to this solution: pragma Singleton import QtQuick 2.7 QtObject { property QtObject font : QtObject { readonly property color red:

Re: [Interest] Clean way to define and categorize constants in QML

2016-05-02 Thread Sina Dogru
2016-05-02 17:31 GMT+03:00 Jérôme Godbout : > Hello Sina, this will not work (at least up to 5.5 as far as I know). > Cause QtObject doesn't have a default property to place children like Item > have. You would get the following error while parsing your script: > *Cannot assign to non-existent def

Re: [Interest] Clean way to define and categorize constants in QML

2016-05-02 Thread Jérôme Godbout
Hello Sina, this will not work (at least up to 5.5 as far as I know). Cause QtObject doesn't have a default property to place children like Item have. You would get the following error while parsing your script: *Cannot assign to non-existent default property* You can either make a simple object t

Re: [Interest] Clean way to define and categorize constants in QML

2016-04-30 Thread Sina Dogru
2016-04-29 21:34 GMT+03:00 Jérôme Godbout : > > QmlObject > { > readonly property alias myCategory: myCategory_ > > QmlObject > { > id: myCategory_ > readonly property color red: "#FF0" > } > } > Hello Jérôme, Can you please explain what would be different to use QtObject i

Re: [Interest] Clean way to define and categorize constants in QML

2016-04-29 Thread Jérôme Godbout
rote: >> >>> Those internal elements are not directly accessible. >>> >>> You can try exposing them with the use of *alias* in the root object. >>> >>> >>> >>> >>> >>> -Even >>> >>> >>> >>>

Re: [Interest] Clean way to define and categorize constants in QML

2016-04-29 Thread Jérôme Godbout
sen= >> honeywell@qt-project.org] *On Behalf Of *Viktória Nemkin >> *Sent:* 29. april 2016 13:04 >> *To:* interest@qt-project.org >> *Subject:* [Interest] Clean way to define and categorize constants in QML >> >> >> >> Hello! >> >> >>

Re: [Interest] Clean way to define and categorize constants in QML

2016-04-29 Thread Viktória Nemkin
g them with the use of *alias* in the root object. > > > > > > -Even > > > > *From:* Interest [mailto:interest-bounces+even.kristoffersen= > honeywell@qt-project.org] *On Behalf Of *Viktória Nemkin > *Sent:* 29. april 2016 13:04 > *To:* interest@qt-proje

Re: [Interest] Clean way to define and categorize constants in QML

2016-04-29 Thread Kristoffersen, Even (NO14)
-project.org Subject: [Interest] Clean way to define and categorize constants in QML Hello! What is a clean way to define and categorize constants in QML? I have came up with this so far: I have a QML singleton element, named Theme. There I keep a few constant things, like different background and

Re: [Interest] Clean way to define and categorize constants in QML

2016-04-29 Thread Dmitry Volosnykh
Using such approach you have to write something like readonly property QtObject backgroundColor: QtObject { ... On Fri, Apr 29, 2016 at 2:04 PM Viktória Nemkin wrote: > Hello! > > What is a clean way to define and categorize constants in QML? > > I have came up with this so far: > > I have a QML

[Interest] Clean way to define and categorize constants in QML

2016-04-29 Thread Viktória Nemkin
Hello! What is a clean way to define and categorize constants in QML? I have came up with this so far: I have a QML singleton element, named Theme. There I keep a few constant things, like different background and font colors. Theme.qml: pragma Singleton import QtQuick 2.0 QtObject { re