aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2012-05-03 14:02:14 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-09 05:38:22 +0200
commit0102413396c91e97ed856235cd1a52f7185c4862 (patch)
tree0ee130b7aa621cdaa564cbeea3da8d4a97ede510 /doc
parent54679f48eff344d2dde8d6d4d748b2db497fb29e (diff)
Augment performance docs
Change-Id: I5721b5b567712818462b51a85c7710bc6a08746b Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/src/qml/performance.qdoc24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/src/qml/performance.qdoc b/doc/src/qml/performance.qdoc
index 91c9bbbbd7..da9a66cbec 100644
--- a/doc/src/qml/performance.qdoc
+++ b/doc/src/qml/performance.qdoc
@@ -599,6 +599,30 @@ Rectangle {
}
\endcode
+Note that this is still not as efficient as specifying a static size, so you should still specify static sizes via
+the x, y, width and height properties.
+
+Item coordinates are always relative to their parent, so if you wanted to be a fixed offset from your parent's
+0,0 coordinate you should not use anchors. For example the following items are in the same place, but the anchors
+code is not as resource efficient as fixed positioning.
+
+\code
+Rectangle {
+ width: 60
+ height: 60
+ Rectangle {
+ x: 20
+ y: 20
+ width: 20
+ height: 20
+ }
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: 20
+ }
+}
+\endcode
+
\section1 Models and Views
Most applications will have at least one model feeding data to a view. There are