| 1 |
/*! |
| 2 |
\qmltype CrossFadeImage |
| 3 |
\ingroup lomiri |
| 4 |
\brief An Image like component which smoothly fades when its source is updated. |
| 5 |
|
| 6 |
\qml |
| 7 |
import QtQuick 2.4 |
| 8 |
import Lomiri.Components 1.2 |
| 9 |
|
| 10 |
CrossFadeImage { |
| 11 |
width: units.gu(100) |
| 12 |
height: units.gu(75) |
| 13 |
source: "http://design.lomiri.com/wp-content/uploads/lomiri-logo14.png" |
| 14 |
fadeDuration: 1000 |
| 15 |
MouseArea { |
| 16 |
anchors.fill: parent |
| 17 |
onClicked: parent.source = "http://design.lomiri.com/wp-content/uploads/canonical-logo1.png" |
| 18 |
} |
| 19 |
} |
| 20 |
\endqml |
| 21 |
*/ |
| 22 |
|
| 23 |
/*! |
| 24 |
\qmlproperty url CrossFadeImage::source |
| 25 |
|
| 26 |
The image being displayed. Can be a URL to any image format supported by Qt. |
| 27 |
*/ |
| 28 |
|
| 29 |
/*! |
| 30 |
\qmlproperty enumeration CrossFadeImage::fillMode |
| 31 |
|
| 32 |
Defaults to \c Image.PreserveAspectFit |
| 33 |
|
| 34 |
\list |
| 35 |
\li Image.Stretch - the image is scaled to fit |
| 36 |
\li Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping |
| 37 |
\li Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary |
| 38 |
\li Image.Tile - the image is duplicated horizontally and vertically |
| 39 |
\li Image.TileVertically - the image is stretched horizontally and tiled vertically |
| 40 |
\li Image.TileHorizontally - the image is stretched vertically and tiled horizontally |
| 41 |
\li Image.Pad - the image is not transformed |
| 42 |
\endlist |
| 43 |
*/ |
| 44 |
|
| 45 |
/*! |
| 46 |
\qmlproperty int CrossFadeImage::fadeDuration |
| 47 |
|
| 48 |
The time over which to fade between images. Defaults to \c LomiriAnimation.FastDuration. |
| 49 |
\sa LomiriAnimation |
| 50 |
*/ |
| 51 |
|
| 52 |
/*! |
| 53 |
\since Lomiri.Components 1.1 |
| 54 |
\qmlproperty string CrossFadeImage::fadeStyle |
| 55 |
|
| 56 |
Style of the fade effect |
| 57 |
|
| 58 |
Defaults to \c overlay |
| 59 |
|
| 60 |
\list |
| 61 |
\li overlay - the new fading image overlays the current one |
| 62 |
\li cross - the current one fades out while the new image fades in |
| 63 |
\endlist |
| 64 |
*/ |
| 65 |
|
| 66 |
/*! |
| 67 |
\qmlproperty bool CrossFadeImage::running |
| 68 |
|
| 69 |
Whether the animation is running |
| 70 |
*/ |
| 71 |
|
| 72 |
/*! |
| 73 |
\qmlproperty size CrossFadeImage::sourceSize |
| 74 |
|
| 75 |
The actual width and height of the loaded image |
| 76 |
This property holds the actual width and height of the loaded image. |
| 77 |
|
| 78 |
Unlike the width and height properties, which scale the painting of the image, |
| 79 |
this property sets the actual number of pixels stored for the loaded image so that large |
| 80 |
images do not use more memory than necessary. |
| 81 |
|
| 82 |
Note: Changing this property dynamically causes the image source to be reloaded, potentially |
| 83 |
even from the network, if it is not in the disk cache. |
| 84 |
*/ |
| 85 |
|
| 86 |
/*! |
| 87 |
\qmlproperty enumeration CrossFadeImage::status |
| 88 |
|
| 89 |
This property holds the status of image loading. It can be one of: |
| 90 |
|
| 91 |
\list |
| 92 |
\li Image.Null - no image has been set |
| 93 |
\li Image.Ready - the image has been loaded |
| 94 |
\li Image.Loading - the image is currently being loaded |
| 95 |
\li Image.Error - an error occurred while loading the image |
| 96 |
\endlist |
| 97 |
*/ |