Dialog QML Type

A dialog component. More...

Import Statement: import quey.ui 0.1
Inherits:

PopupBase

Inherited By:

MessageBox

Properties

Signals

Detailed Description

Dialog is a feature rich window component for the use as modal dialog. It's both suitable as a simple message box as well as an advanced modal (for example to show settings).

import QtQuick 2.4
import quey.ui 0.1

ApplicationView {
    Button {
        anchors.centerIn: parent
        text: "Open Dialog"
        onClicked: dialog.open()
    }

    Dialog {
        id: dialog
        maximumWidth: Units.dp(640)
        maximumHeight: Units.dp(480)
        title: "My Dialog"
        text: "Hello World"
    }
}

In this example we made use of the title and text properties which make it very easy to create a slick message box without much effort. However, it's also possible to set a custom content item instead:

Dialog {
    id: dialog
    title: "Dialog with custom content"

    content: Column {
        width: childrenRect.width
        height: childrenRect.height

        spacing: Style.spacing

        WrapLabel {
            id: label
            availableWidth: dialog.contentAvailableWidth
            text: "This text will be wrapped based on the dialog's available width."
        }

        ActivityIndicator {
            running: checkbox.checked
        }

        CheckBox {
            id: checkbox
            text: "running"
        }

        Row {
            spacing: Style.spacing
            width: Math.max(childrenRect.width, label.width)
            layoutDirection: Qt.RightToLeft

            Button {
                text: "no"
            }

            Button {
                text: "yes"
            }
        }
    }
}

Property Documentation

[read-only] appliedMaximumHeight : int

This property holds the actual maximum height that can be applied. Used internally.


[read-only] appliedMaximumWidth : int

This property holds the actual maximum width that can be applied. Used internally.


content : Item

Allows assigning custom content to the dialog. To be used instead of text.


[read-only] contentAvailableHeight : int

The height available to the dialog content.


[read-only] contentAvailableWidth : int

The width available to the dialog content based on the margins and maximum width.


[read-only] contentHeight : int

The height of the dialogs content.


contentMargins : int

The margins of the content item. Defaults to 24


dismissOnCloseKey : bool

If set to true the dialog is closed when pressing the close key.


flickable : bool

If set to true, the content is flickable.


maximumHeight : int

This property sets the maximum height of the dialog.


maximumWidth : int

This property sets the maximum width of the dialog.


minimumHeight : int

This property sets the minimum height of the dialog.


minimumWidth : int

This property sets the minimum width of the dialog.


text : string

The dialog's text to be rendered instead of a custom content Item.


title : string

The dialog's title.


Signal Documentation

closeKeyPressed(var event)

Emitted when the close key was pressed.