A dialog component. More...
Import Statement: | import quey.ui 0.1 |
Inherits: | |
Inherited By: |
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" } } } }
This property holds the actual maximum height that can be applied. Used internally.
This property holds the actual maximum width that can be applied. Used internally.
The width available to the dialog content based on the margins and maximum width.
The margins of the content item. Defaults to 24
The dialog's text to be rendered instead of a custom content Item.