A Kirigami.Dialog is a simple component that you can use to supplement the content being displayed on an application's page. It can display non-interactive content (only text) and interactive content (forms, listviews and buttons).
They can be dismissed by clicking or tapping outside of their area or by clicking the close button on the header.
Dialog
A standard Kirigami.Dialog is used to create custom dialogs. They are very easy to extend:
As shown in the introduction tutorial about dialogs, it is also possible to capture a standardButton(button) to assign some behavior to it, like a binding to enable it only under certain conditions.
This type of dialog is generic and applies to most use cases, and it works well with complex interactive content (especially views):
A Kirigami.PromptDialog is essentially a dialog with a built-in label and default contentPadding that is used to prompt the user for some information. This type of dialog is supposed to be used only for simple yes/no prompts or brief requests for user input.
Its main property is Kirigami.Dialog.subtitle, to which you would add text. If any QML component is added as a child of the prompt dialog, that component will take the place of the subtitle instead, and this can be explicitly specified with Kirigami.Dialog.mainItem.
import QtQuickimport QtQuick.Controls as Controlsimport org.kde.kirigami as KirigamiKirigami.ApplicationWindow { title: "PromptDialog" width: 400 height: 400 pageStack.initialPage: Kirigami.Page { id: page actions:Kirigami.Action {icon.name: "list-add" text:promptDialog.title onTriggered:promptDialog.open() }Kirigami.PromptDialog { id: promptDialog title:i18n("Delete file") subtitle:i18n("Are you sure you'd like to delete this file?") standardButtons:Kirigami.Dialog.Ok |Kirigami.Dialog.Cancel onAccepted:console.info("File deleted") } }}