MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9

QML Sheet Element

Dialog type of container More...

Inherits Item

This element was introduced in qt-components 4.7.

Properties

Signals

Detailed Description

The sheet is (in most use-cases) a fullscreen dialog that slides up from the bottom when activated. Buttons are rendered on top of the content field. Sheets are used whenever the amount of information and configure options is too much for standard dialogs. The api is similar to the one used in dialogs.

Example shows how to declare a sheet that has one button. Note that the button is put into Flickable so that the content of the sheet can be panned. Sheet itself is declared outside of the Flickable that contains the another button that launches the Sheet.

 ...

 Flickable {
     ...

     Button {
         id: myButton
         text: "Launch Sheet"
         onClicked: sheet.open()
     }
 }

 Sheet {
     id: sheet

     acceptButtonText: "Save"
     rejectButtonText: "Cancel"

     content: Flickable {
         anchors.fill: parent
         anchors.leftMargin: 10
         anchors.topMargin: 10
         contentWidth: col2.width
         contentHeight: col2.height
         flickableDirection: Flickable.VerticalFlick
         Column {
             id: col2
             anchors.top: parent.top
             spacing: 10
             Button {
                 text: "Click Me!"
             }
         }
     }
     onAccepted: myButton.text = "Accepted!"
     onRejected: myButton.text = "Rejected!"
 }

Property Documentation

acceptButtonText : string

Property default is "".

Text of the accept button. When no text is given, the button is not displayed.


buttons : Item

The item to be placed inside the button area of the sheet. Normally the buttons are defined with the acceptButtonText and rejectButtonText properties. The buttons property can be used whenever a more customized button area is needed. Consider using the SheetButton instead of the simple Button element. This ensures that the buttons are correctly styled.


content : Item

The Item to be placed inside the content area of the sheet.


rejectButtonText : string

Property default is "".

Text of the reject button. When no text is given, the button is not displayed.


status : enum

This property holds the current status.

  • DialogStatus.Opening - The animation for opening the sheet is running.
  • DialogStatus.Opened - The sheet has been opened and is visible.
  • DialogStatus.Closing - The animation for closing the sheet is running.
  • DialogStatus.Closed - The sheet is closed and invisible.

visualParent : Item

The Item in which the sheet is displayed. With the visualParent developers are able to define the part of the screen where the sheet should be anchored.


Signal Documentation

Sheet::accepted ()

This signal is fired when the function accept() is called. Normally this signal is associated with the "Ok" or "Save" button.


Sheet::rejected ()

This signal is fired when the function reject() is called. Normally this signal is associated with the "Cancel" or "Delete" button.