Details
-
Suggestion
-
Resolution: Invalid
-
P2: Important
-
None
-
None
Description
Currently, the only way to change the UI declaration, layout and definition based on a precondition like e.g. the screen resolution is to either encode in states;
State {
name: "QVGA"
when: width==320 && height==240
PropertyChanges { ... }
}
or by using an exposed object to compare and declare the right value inline - e.g. for languages;
Image { source: Qt.lang == Qt.it || Qt.RTL ? "foo_it_rtl.png" : "image.png" ... }
One idea would be to provide an annotation mechanism in QML;
Image { source = "image.png" source[lang=it, RTL]: "foo_it_rtl.png" width[default=123]: height+10 }
However, the syntax clutters QML and detracts readability.