API Documentation

Documentation for developing SailfishOS applications

DialogHeader QML Type

A header for use in a Dialog More...

Import Statement: import Sailfish.Silica 1.0
Inherits:

BackgroundItem

Properties

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.


We use cookies to improve your user experience and to help us to develop our services. By continuing to browse the site, you approve of our use of cookies.