mirror of https://github.com/qt/qtdoc.git
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:
parent
da265be8ba
commit
d336ca0186
|
@ -65,7 +65,9 @@ Rectangle {
|
|||
}
|
||||
|
||||
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
|
||||
if (photoImage.width > 200) {
|
||||
photoImage.width;
|
||||
|
@ -78,7 +80,10 @@ Rectangle {
|
|||
id: border
|
||||
anchors.centerIn: parent; color: "white"
|
||||
|
||||
Image { id: photoImage; anchors.centerIn: parent }
|
||||
Image {
|
||||
id: photoImage
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
||||
states: State { // states
|
||||
|
@ -87,7 +92,8 @@ Rectangle {
|
|||
}
|
||||
|
||||
transitions: Transition { // transitions
|
||||
from: ""; to: "selected"
|
||||
from: ""
|
||||
to: "selected"
|
||||
ColorAnimation { target: border; duration: 200 }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue