Meego Wiki
Views

PhotoPicker API Snapshot

From MeeGo wiki
Jump to: navigation, search

Contents

Description

The PhotoPicker provides a modal dialog in which the user can choose an album or photo. The 'OK' button is disabled until a selection was made. On 'Ok'-clicked, depending on the selection mode, the fitting signal is emitted which provides the selected item's data. Multiselection of items is possible by setting multiSelection to true.

API Properties

bool albumSelectionMode
Selects albums instead of photos if true.

Signals

photoSelected
Propagates data for the selected photo. Triggered if multiSelection is false.
Parameters:
  • variant photoid, ID of the selected photo.
  • string title, title of the selected photo.
  • string uri, path to the photo.
  • string thumbUri, path to the photo thumbnail.
multiplePhotosSelected
Propagates data for the selected photos. Triggered if multiSelection is true.
Parameter:
  • variant photoids, ID of the selected photos.
  • string titles, title of the selected photos.
  • string uris, path to the photos.
  • string thumbUris, path to the photo thumbnails.
albumSelected
Propagates data of the selected album. Triggered if albumSelectionMode is true and multiSelection is false.
Parameter:
  • variant albumid, ID of the selected photo album.
  • string title, title of the selected photo album.
multipleAlbumsSelected
Propagates data of the selected albums. Triggered if albumSelectionMode and multiSelection is true.
Parameter:
  • variant albumids, ID of the selected photo albums.
  • string titles, title of the selected photo albums.
accepted
Emitted on 'OK' clicked.
rejected
Emitted on 'Cancel' clicked.

Functions

show
Fades the picker in, inherited from ModalFog.
hide
Fades the picker out, inherited from ModalFog.

Example

AppPage{
    PhotoPicker {
        id: pickerExample

        onPhotoSelected: {
            // photoid, title and uri are available, picker dialog hidden
        }
        onRejected: {
            // cancel was clicked, picker dialog hidden and no photo selected
        }
    }

    Component.onCompleted: {
        pickerExample.show();
    }
}
Personal tools