Nemo QML Plugins Thumbnailer
API DocumentationThumbnail QML Type
Generates and displays a cached thumbnail of the source image or video. More...
Import Statement: | import Nemo.Thumbnailer 1.0 |
Properties
- fillMode : enumeration
- mimeType : string
- priority. : NemoThumbnailItem::Priority
- source : url
- sourceSize : QSize
- status : enumeration
Detailed Description
Thumbnail element can be used instead of Qt Quick Image element for displaying images and video thumbnails. Thumbnailer provides additional API for prioritising requests and quering status of the thumbnail generation. Loaded thumbnails are stored into a local disk cache, which speeds up subsquent loading of the thumbnails, especially if the original source image or video was large.
import QtQuick 2.0 import Nemo.Thumbnailer 1.0 Thumbnail { source: "photo.jpg" width: thumbnailWidth height: thumbnailHeight sourceSize.width: width sourceSize.height: height priority: { if (visibleRangeStart <= index && index < visibleRangeEnd) { return Thumbnail.HighPriority } else { return Thumbnail.LowPriority } } }
Property Documentation
Set this property to define what happens when the source image has a different aspect ratio than the item.
- Thumbnail.PreserveAspectFit - the image is scaled uniformly to fit without cropping
- Thumbnail.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary. This is the default behavior.
Mime type of the thumbnail, which helps the thumbnailer detect the file type correctly.
With priority system you can prioritise images currently visible on the screen higher. For example it is good idea to prioritise currently visible items when user is scrolling quickly through multiple large photos.
The priority parameter may be one of:
- Thumbnail.HighPriority
- Thumbnail.NormalPriority
- Thumbnail.LowPriority
Set the location of the image to source property, either as an absolute or relative url.
This property holds the actual width and height of the cached and displayed thumbnail. The source size should always be defined.
This property holds the status of the thumbnail loading. It can be one of:
- Thumbnail.Null - no image has been set
- Thumbnail.Ready - the thumbnail has been loaded
- Thumbnail.Loading - the thumbnail is currently being loaded
- Thumbnail.Error - an error occurred while generating the thumbnail