Doc: give property assignments their own line in coding conventions

The point of the convention was that related properties should be part
of the same "block" or "group" of assignments, which can be achieved by
ensuring that they are directly above/below one another. Bunching up
assignments onto one line for a few properties should not be a
recommended practice.

Change-Id: Ie84163b3261e7138d69678e059a91c2c82b43507
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
Mitch Curtis 2018-07-16 10:56:09 +02:00
parent da265be8ba
commit d336ca0186
1 changed files with 9 additions and 3 deletions

View File

@ -65,7 +65,9 @@ Rectangle {
} }
color: "gray" // object properties color: "gray" // object properties
x: 20; y: 20; height: 150 // try to group related properties together x: 20 // try to group related properties together
y: 20
height: 150
width: { // large bindings width: { // large bindings
if (photoImage.width > 200) { if (photoImage.width > 200) {
photoImage.width; photoImage.width;
@ -78,7 +80,10 @@ Rectangle {
id: border id: border
anchors.centerIn: parent; color: "white" anchors.centerIn: parent; color: "white"
Image { id: photoImage; anchors.centerIn: parent } Image {
id: photoImage
anchors.centerIn: parent
}
} }
states: State { // states states: State { // states
@ -87,7 +92,8 @@ Rectangle {
} }
transitions: Transition { // transitions transitions: Transition { // transitions
from: ""; to: "selected" from: ""
to: "selected"
ColorAnimation { target: border; duration: 200 } ColorAnimation { target: border; duration: 200 }
} }
} }