Sailfish Pickers
API DocumentationContentPickerPage QML Type
A content picker that groups pickers under one picker page More...
Import Statement: | import Sailfish.Pickers 1.0 |
Properties
- selectedContent : url
- selectedContentProperties : var
- title : string
Detailed Description
The ContentPickerPage type is a picker page that can be used to a select single file from the content types listed below:
- Documents - document files in /home/<user>/
- Images - image files in /home/<user>/ excluding standard music directory (/home/<user>/Music)
- Videos - video files in /home/<user>/
- Music - music files in /home/<user>/
Here is an example usage:
import QtQuick 2.2 import Sailfish.Silica 1.0 import Sailfish.Pickers 1.0 ApplicationWindow { initialPage: Component { Page { id: page property string selectedFile ValueButton { anchors.centerIn: parent label: "File" value: selectedFile ? selectedFile : "None" onClicked: pageStack.push(contentPickerPage) } Component { id: contentPickerPage ContentPickerPage { title: "Select file" onSelectedContentPropertiesChanged: { page.selectedFile = selectedContentProperties.filePath } } } } } }
Use MultiContentPickerDialog for picking multiple files.
See also DocumentPickerPage, FilePickerPage, ImagePickerPage, MusicPickerPage, and VideoPickerPage.
Property Documentation
This property holds url of the selected content.
See also selectedContentProperties.
This property holds the selected content item.
The selectedContentProperties value contains following members.
- fileName - file name without path
- filePath - full file path including file name
- url - filePath formatted as url
- title - name of the file, this can be fetched from metadata of the file
- mimeType - mime type of the file for example "image/jpeg", "image/png", "application/pdf", "video/mp4", "audio/mpeg"