PromptDialog

Search for usage in LXR

PromptDialog Class Reference

Public Types

enum class  DialogType {
  Success , Warning , Error , Information ,
  None
}
 

Properties

real contentBottomPadding
 
real contentLeftPadding
 
real contentPadding
 
real contentRightPadding
 
real contentTopPadding
 
int dialogType
 
string iconName
 
alias mainItem
 
string subtitle
 

Detailed Description

A simple dialog to quickly prompt a user with information, and possibly perform an action.

Provides content padding (instead of padding outside of the scroll area). Also has a default preferredWidth, as well as the subtitle property.

Note: If a mainItem is specified, it will replace the subtitle label, and so the respective property will have no effect.

See also
Dialog
MenuDialog

Example usage:

Kirigami.PromptDialog {
title: "Reset settings?"
subtitle: "The stored settings for the application will be deleted, with the defaults restored."
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
onAccepted: console.log("Accepted")
onRejected: console.log("Rejected")
}
string subtitle
The text to use in the dialog's contents.

Text field prompt dialog:

Kirigami.PromptDialog {
id: textPromptDialog
title: qsTr("New Folder")
standardButtons: Kirigami.Dialog.NoButton
customFooterActions: [
Kirigami.Action {
text: qsTr("Create Folder")
icon.name: "dialog-ok"
onTriggered: {
showPassiveNotification("Created");
textPromptDialog.close();
}
},
Kirigami.Action {
text: qsTr("Cancel")
icon.name: "dialog-cancel"
onTriggered: {
textPromptDialog.close();
}
}
]
QQC2.TextField {
placeholderText: qsTr("Folder nameā€¦")
}
}

Definition at line 69 of file PromptDialog.qml.

Member Enumeration Documentation

◆ DialogType

enum class PromptDialog::DialogType
strong

Definition at line 74 of file PromptDialog.qml.

Property Documentation

◆ contentBottomPadding

real PromptDialog::contentBottomPadding
read

The bottom padding of the content, within the scroll area.

Definition at line 110 of file PromptDialog.qml.

◆ contentLeftPadding

real PromptDialog::contentLeftPadding
read

The left padding of the content, within the scroll area.

Definition at line 115 of file PromptDialog.qml.

◆ contentPadding

real PromptDialog::contentPadding
read

The padding around the content, within the scroll area.

Default is Kirigami.Units.largeSpacing.

Definition at line 102 of file PromptDialog.qml.

◆ contentRightPadding

real PromptDialog::contentRightPadding
read

The right padding of the content, within the scroll area.

Definition at line 119 of file PromptDialog.qml.

◆ contentTopPadding

real PromptDialog::contentTopPadding
read

The top padding of the content, within the scroll area.

Definition at line 106 of file PromptDialog.qml.

◆ dialogType

int PromptDialog::dialogType
read

This property holds the dialogType.

It can be either:

  • PromptDialog.Success: For a sucess message
  • PromptDialog.Warning: For a warning message
  • PromptDialog.Error: For an actual error
  • PromptDialog.Information: For an informational message
  • PromptDialog.None: No specific dialog type.

By default, the dialogType is Kirigami.PromptDialog.None

Definition at line 92 of file PromptDialog.qml.

◆ iconName

string PromptDialog::iconName
read

This property holds the icon name used by the PromptDialog.

Definition at line 123 of file PromptDialog.qml.

◆ mainItem

alias PromptDialog::mainItem
read
Remarks
This is the default property

Definition at line 73 of file PromptDialog.qml.

◆ subtitle

string PromptDialog::subtitle
read

The text to use in the dialog's contents.

Definition at line 96 of file PromptDialog.qml.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:56:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.