summaryrefslogtreecommitdiff
path: root/doc/snippets/qmlapp/codingconventions
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-07-16 10:56:09 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-07-16 09:33:06 +0000
commitd336ca0186caee4402cb15e5f507ec67987053d3 (patch)
tree548806e5e1bd43ddbbac35953940b436fb36f16f /doc/snippets/qmlapp/codingconventions
parentda265be8babdd78e05d676238b99bbf90e32b9eb (diff)
downloadqtdoc-d336ca0186caee4402cb15e5f507ec67987053d3.tar.gz
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>
Diffstat (limited to 'doc/snippets/qmlapp/codingconventions')
-rw-r--r--doc/snippets/qmlapp/codingconventions/photo.qml12
1 files changed, 9 insertions, 3 deletions
diff --git a/doc/snippets/qmlapp/codingconventions/photo.qml b/doc/snippets/qmlapp/codingconventions/photo.qml
index a944cca0..57bbd709 100644
--- a/doc/snippets/qmlapp/codingconventions/photo.qml
+++ b/doc/snippets/qmlapp/codingconventions/photo.qml
@@ -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 }
}
}