Search for usage in LXR

GalleryRollItem Class Reference

Inherits org::mauikit::controls::GridBrowserDelegate, and org::mauikit::controls::GridBrowserDelegate.


bool cache
var cb
var images
int orientation

Detailed Description

A custom item to be used as a delegate in the browsing views or as a standalone card. This element presents a group of images in a carousel form.


This control inherits all properties from the MauiKit GridBrowserDelegate control. As such, this can have two labels, for a title and a message.

See also

The header part of this control, the actual carousel of images, is handled by a GalleryRollTemplate.

See also
anchors.fill: parent
model: 30
itemSize: 200
delegate: Item
width: GridView.view.cellWidth
height: GridView.view.cellHeight
anchors.fill: parent
label1.text: "Demo"
label2.text: index
images: index %2 === 0 ? ['/home/camiloh/Downloads/street-1234360.jpg', '/home/camiloh/Downloads/flat-coated-retriever-1339154.jpg', '/home/camiloh/Downloads/5911329.jpeg'] : ['/home/camiloh/Downloads/street-1234360.jpg', '/home/camiloh/Downloads/flat-coated-retriever-1339154.jpg', '/home/camiloh/Downloads/5911329.jpeg', '/home/camiloh/Pictures/LastLights_by_Mushcube/LastLightsScreenPreview.png']
var images
A list of images to be used.
alias view

You can find a more complete example at this link.

Definition at line 49 of file GalleryRollItem.qml.

Property Documentation

◆ cache

bool GalleryRollItem::cache

Whether the images should be saved in the cache, to reduce loading times.

By default this is set to true.

Definition at line 55 of file GalleryRollItem.qml.

◆ cb

var GalleryRollItem::cb

A callback function to manage what image is positioned.

This callback function is called for each image source set in the model images, so the final source can be modified. This function should return a - new or modified - image source URL.

As an example, if the images model looks like: ["page1", "page2", "page3"] - which are not file URLs, this callback function can be use to map each individual source to an actual file URL.

images: ["page1", "page2", "page3"]
cb : (source) =>
return mapSourceToImageFile(source) //here the "page1" could be mapped to "file:///some/path/to/image1.jpg" and return this new source to be use.
var cb
A callback function to manage what image is positioned.

Definition at line 72 of file GalleryRollItem.qml.

◆ images

var GalleryRollItem::images

A list of images to be used.

This will be use as the model.

Definition at line 59 of file GalleryRollItem.qml.

◆ orientation

int GalleryRollItem::orientation

The orientation of the transition of the images.

By default this is set to horizontal using ListView.Horizontal. Possible values are:

  • ListView.Horizontal
  • ListView.Vertical

Definition at line 79 of file GalleryRollItem.qml.

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 12:01:40 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.