Code review comment for lp://staging/~kalikiana/ubuntu-ui-toolkit/appsettings

Revision history for this message
Cris Dywan (kalikiana) wrote :

> 1. can a Setting element be declared inside other elements? Maybe to
> understand it better, let's take the following example:
>
> Page1.qml
> Page {
> Settings {

Anywhere is fine as these are not visual components.

> 2. Can one declare the same group in two different document? Taken the
> previous example, have the group "page1group" also in main.qml. If yes, do I
> have to have the same amount of Options in both places?
>
> Asking this as in this way it would be easier to use the settings in
> individual documents rather than using the id of the setting from the topmost
> QML document of the app.

You can declare the same group in one place only. Anything else would mean you never know if the group is complete. Having part of a group in a separate file or Loader would lead to undefined behavior and data loss.

It's still very flexible I think. You can declare Settings in a separate file as long as it's imported where it's needed. Separate groups can be used - they can be put in a Loader without any risk. If you bind components to existing options they also don't need to be in the same file.

« Back to merge proposal