Sailfish OS
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS
Select Page
  • Info
  • User Experience
  • Cases
  • Community
  • Developers
  • Contact
  • Get Sailfish OS

Sailfish Pickers

API Documentation
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon
  • API Documentation
  • Libsailfishapp
  • Sailfish Silica
    • Documentation
    • Icon Reference
  • Sailfish Components
    • Sailfish Accounts
    • Sailfish Bluetooth
    • Sailfish Contacts
    • Sailfish Crypto
    • Sailfish Gallery
    • Sailfish Media
    • Sailfish Pickers
    • Sailfish Secrets
    • Sailfish Share
    • Sailfish Telephony
    • Sailfish Webview
    • Amber Web Authorization
    • Amber MPRIS
  • Nemo QML Plugins
    • Configuration
    • Contacts
    • D-Bus
    • Keepalive
    • Notifications
    • Thumbnailer
  • Sailfish Middleware
    • MDM Framework
    • MDM Policy Framework
    • User Manager Daemon

Contents

  • Properties
  • Detailed Description

MultiMusicPickerDialog QML Type

A music picker for selecting multiple music files. More...

Import Statement: import Sailfish.Pickers 1.0
  • List of all members, including inherited members

Properties

  • acceptText : string
  • selectedContent : ListModel

Detailed Description

Here is an example usage:

 import QtQuick 2.2
 import Sailfish.Silica 1.0
 import Sailfish.Pickers 1.0

 ApplicationWindow {
     initialPage: Component {
         Page {
             property string selectedFiles

             SilicaFlickable {
                 contentHeight: column.height + Theme.paddingLarge*2
                 anchors.fill: parent
                 VerticalScrollDecorator {}

                 Column {
                     id: column
                     width: parent.width
                     PageHeader {
                         title: "Multi music picker example"
                     }

                     ValueButton {
                         anchors.horizontalCenter: parent.horizontalCenter
                         label: "Select songs"
                         value: selectedFiles ? selectedFiles : "None"
                         onClicked: pageStack.push(multiMusicPickerDialog)
                     }
                 }
             }

             Component {
                 id: multiMusicPickerDialog
                 MultiMusicPickerDialog {
                     onAccepted: {
                         selectedFiles = ""
                         var urls = []
                         for (var i = 0; i < selectedContent.count; ++i) {
                             var url = selectedContent.get(i).url
                             // Handle selection
                             urls.push(selectedContent.get(i).url)
                         }
                         selectedFiles = urls.join(", ")
                     }

                     onRejected: selectedFiles = ""
                 }
             }
         }
     }
 }

Use MusicPickerPage to select a single music file.

See also MultiContentPickerDialog, MultiDocumentPickerDialog, MultiDownloadPickerDialog, MultiFilePickerDialog, MultiImagePickerDialog, and MultiVideoPickerDialog.

Property Documentation

acceptText : string

This property holds the text shown on the right side of the header.


[read-only] selectedContent : ListModel

This property holds the selected content items.

ListModel contains following roles:

  • 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", "application/pdf", "video/mp4", "audio/mpeg"

  • Legal
  • Contact Us
  • Jollyboys Ltd © 2024

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn