diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-20 02:08:39 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-20 02:08:39 (GMT) |
commit | 341f47a31d6d98e402547c77ccbe358465f8b1a9 (patch) | |
tree | f17c2e0bb6b8f0bd10a355ae5b868f17b4782c8c /examples/declarative/aspectratio | |
parent | b6f85c59d1cd45a4df57440b9d39659d2646223e (diff) | |
download | Qt-341f47a31d6d98e402547c77ccbe358465f8b1a9.zip Qt-341f47a31d6d98e402547c77ccbe358465f8b1a9.tar.gz Qt-341f47a31d6d98e402547c77ccbe358465f8b1a9.tar.bz2 |
Update in light of new Image.preserveAspect property
Diffstat (limited to 'examples/declarative/aspectratio')
6 files changed, 10 insertions, 21 deletions
diff --git a/examples/declarative/aspectratio/face_fit.qml b/examples/declarative/aspectratio/face_fit.qml index 35c63ce..3005d1b 100644 --- a/examples/declarative/aspectratio/face_fit.qml +++ b/examples/declarative/aspectratio/face_fit.qml @@ -1,7 +1,3 @@ -// The Image primitive does not have any special handling for maintaining -// aspect ratio. This example shows that you can provide whatever specific -// behaviour you like. -// // Here, we implement a hybrid of the "scale to fit" and "scale and crop" // behaviours which will crop up to 25% from *one* dimension if necessary // to fully scale the other. This is a realistic algorithm, for example diff --git a/examples/declarative/aspectratio/face_fit_animated.qml b/examples/declarative/aspectratio/face_fit_animated.qml index 366d27b..9036eeb 100644 --- a/examples/declarative/aspectratio/face_fit_animated.qml +++ b/examples/declarative/aspectratio/face_fit_animated.qml @@ -1,7 +1,3 @@ -// The Image primitive does not have any special handling for maintaining -// aspect ratio. This example shows that you can provide whatever specific -// behaviour you like. -// // Here, we extend the "face_fit" example with animation to show how truly // diverse and usage-specific behaviours are made possible by NOT putting a // hard-coded aspect ratio feature into the Image primitive. diff --git a/examples/declarative/aspectratio/scale_and_crop.qml b/examples/declarative/aspectratio/scale_and_crop.qml index a5409f9..2f35fb5 100644 --- a/examples/declarative/aspectratio/scale_and_crop.qml +++ b/examples/declarative/aspectratio/scale_and_crop.qml @@ -1,7 +1,3 @@ -// The Image primitive does not have any special handling for maintaining -// aspect ratio. This example shows that you can provide whatever specific -// behaviour you like. -// // Here, we implement "Scale and Crop" behaviour. // Rect { diff --git a/examples/declarative/aspectratio/scale_and_sidecrop.qml b/examples/declarative/aspectratio/scale_and_sidecrop.qml index e076735..4b1eb63 100644 --- a/examples/declarative/aspectratio/scale_and_sidecrop.qml +++ b/examples/declarative/aspectratio/scale_and_sidecrop.qml @@ -1,7 +1,3 @@ -// The Image primitive does not have any special handling for maintaining -// aspect ratio. This example shows that you can provide whatever specific -// behaviour you like. -// // Here, we implement a variant of "Scale and Crop" behaviour, where we // crop the sides if necessary to fully fit vertically, but not the reverse. // diff --git a/examples/declarative/aspectratio/scale_to_fit.qml b/examples/declarative/aspectratio/scale_to_fit.qml index 61a4082..867eb37 100644 --- a/examples/declarative/aspectratio/scale_to_fit.qml +++ b/examples/declarative/aspectratio/scale_to_fit.qml @@ -1,8 +1,5 @@ -// The Image primitive does not have any special handling for maintaining -// aspect ratio. This example shows that you can provide whatever specific -// behaviour you like. -// -// Here, we implement "Scale to Fit" behaviour. +// Here, we implement "Scale to Fit" behaviour "manually", rather +// than using the preserveAspect property. // Rect { // default size: whole image, unscaled diff --git a/examples/declarative/aspectratio/scale_to_fit_simple.qml b/examples/declarative/aspectratio/scale_to_fit_simple.qml new file mode 100644 index 0000000..ae2be83 --- /dev/null +++ b/examples/declarative/aspectratio/scale_to_fit_simple.qml @@ -0,0 +1,8 @@ +// Here, we implement "Scale to Fit" behaviour, using the +// preserveAspect property. +// +Image { + id: Image + source: "pics/face.png" + preserveAspect: true +} |