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

API Documentation

Documentation for developing SailfishOS applications
  • 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

ViewPlaceholder QML Type

Shows a Sailfish-style fullscreen placeholder for an empty view More...

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

Properties

  • enabled : bool
  • hintText : string
  • leftMargin : real
  • rightMargin : real
  • text : string
  • textFormat : real
  • verticalOffset : real

Detailed Description

A ViewPlaceholder is a fullscreen display that is shown to avoid displaying a blank page when the page content is unavailable.

It displays the specified text and hintText in the centre of the page to provide more information about the empty content state. If the view has an associated PullDownMenu, tapping on the ViewPlaceholder text will peek at the menu to indicate to the user that options may be available in the menu.

An example:

 import QtQuick 2.2
 import Sailfish.Silica 1.0

 ApplicationWindow {
     initialPage: Component {
         Page {
             SilicaListView {
                 id: view
                 anchors.fill: parent
                 header: PageHeader { title: "Example" }
                 model: ListModel { id: listModel }

                 delegate: BackgroundItem {
                     width: ListView.view.width
                     Label {
                         text: model.date
                         x: Theme.horizontalPageMargin
                         anchors.verticalCenter: parent.verticalCenter
                     }
                 }

                 ViewPlaceholder {
                     enabled: view.count == 0
                     text: "No items yet"
                     hintText: "Pull down to add items"
                 }

                 PullDownMenu {
                     MenuItem {
                         text: "Add item"
                         onClicked: {
                             listModel.append({"date": new Date().toLocaleTimeString()})
                         }
                     }
                 }
             }
         }
     }
 }

Note: A ViewPlaceholder must have a flickable Silica type in its parent hierarchy, such as a SilicaFlickable, SilicaListView, or SilicaGridView.

Property Documentation

enabled : bool

Setting enabled to true displays the placeholder text.


hintText : string

Additional text placed below the main text to hint to the user as to how the empty state can be resolved.


leftMargin : real

The margins between the left and right edges of the placeholder and its contents. The default value is Theme.horizontalPageMargin.


rightMargin : real

The margins between the left and right edges of the placeholder and its contents. The default value is Theme.horizontalPageMargin.


text : string

The placeholder text to display.


textFormat : real

The format of the displayed text and hintText. The default value is Text.PlainText.


verticalOffset : real

Offset from the center of the screen to display the text.


  • Legal
  • Contact Us
  • Jollyboys Ltd © 2024

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn