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

DialogHeader QML Type

A header for use in a Dialog More...

Import Statement: import Sailfish.Silica 1.0
Inherits:

BackgroundItem

  • List of all members, including inherited members

Properties

  • acceptText : string
  • cancelText : string
  • defaultAcceptText : string
  • defaultCancelText : string
  • dialog : Item
  • extraContent : Item
  • leftMargin : real
  • reserveExtraContent : bool
  • rightMargin : real
  • spacing : real
  • title : string

Detailed Description

The DialogHeader type provides a styled header for a Dialog.

The header shows "Accept" and "Cancel" buttons and accepts or rejects the dialog when these buttons are pressed. A page title can be added below the header area with the title property.

An example:

 import QtQuick 2.2
 import Sailfish.Silica 1.0

 ApplicationWindow {
     initialPage: Component {
         Page {
             Button {
                 text: "Delete file"
                 anchors.centerIn: parent
                 onClicked: pageStack.push(dialog)
             }
         }
     }

     Component {
         id: dialog

         Dialog {
             DialogHeader {
                 id: header
                 title: "Confirm deletion"
             }
             Label {
                 text: "Really delete this file?"
                 anchors.top: header.bottom
                 x: Theme.horizontalPageMargin
                 color: Theme.highlightColor
             }
         }
     }
 }

See also Dialog.

Property Documentation

acceptText : string

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

By default this is bound to the value of defaultAcceptText.

See also defaultAcceptText.


cancelText : string

This property holds the text shown on the left side when the user is cancelling the dialog with a gesture.

See also defaultCancelText.


defaultAcceptText : string

This property holds the default value of the acceptText property, which is a localized translation of "Accept".


defaultCancelText : string

This property holds the default value of the cancelText property, which is a localized translation of "Cancel".


dialog : Item

Specifies the Dialog on which DialogHeader is applied.

If dialog is not supplied then the header will be applied to the closest ancestor Dialog.


extraContent : Item

This property provides the item controlling the interior space of the dialog header. This item can be used to insert extra context into the header.

See also reserveExtraContent.


leftMargin : real

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


reserveExtraContent : bool

If true, attempts to reserve space in the dialog header for the extraContent item. Usually the cancel and accept buttons will attempt to use all available space. If this property is true then the cancel and accept buttons will use no more space than necessary to display their labels. This property defaults to true if extraContent has one or more children; otherwise false.

See also extraContent.


rightMargin : real

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


spacing : real

This property reserves space below the header. This defaults to Theme.paddingLarge, which is the recommended whitespace between the header and dialog content.


title : string

This property holds the title of the dialog.


  • Legal
  • Contact Us
  • Jolla Mobile Ltd © 2025

  • Facebook
  • Twitter
  • Mastodon
  • YouTube
  • LinkedIn