org::kde::kirigami::templates::InlineMessage

Search for usage in LXR

org::kde::kirigami::templates::InlineMessage Class Reference
Inheritance diagram for org::kde::kirigami::templates::InlineMessage:

Public Types

enum class  Position { Inline , Header , Footer }
 

Properties

listTAction actions
 
bool animating
 
alias hoveredLink
 
TPIconPropertiesGroup icon
 
int position
 
bool showCloseButton
 
string text
 
int type
 

Signals

void linkActivated (string link)
 
void linkHovered (string link)
 

Detailed Description

An inline message item with support for informational, positive, warning and error types, and with support for associated actions.

InlineMessage can be used to give information to the user or interact with the user, without requiring the use of a dialog.

The InlineMessage item is hidden by default. It also manages its height (and implicitHeight) during an animated reveal when shown. You should avoid setting height on an InlineMessage unless it is already visible.

Optionally an icon can be set, defaulting to an icon appropriate to the message type otherwise.

Optionally a close button can be shown.

Actions are added from left to right. If more actions are set than can fit, an overflow menu is provided.

Example:

import org.kde.kirigami as Kirigami
Kirigami.InlineMessage {
type: Kirigami.MessageType.Error
text: i18n("My error message")
Kirigami.Action {
icon.name: "list-add"
text: i18n("Add")
onTriggered: source => {
// do stuff
}
},
Kirigami.Action {
icon.name: "edit"
text: i18n("Edit")
onTriggered: source => {
// do stuff
}
}
]
}
listTAction actions
This property holds the list of actions to show.
TPIconPropertiesGroup icon
This grouped property holds the description of an optional icon.
QString i18n(const char *text, const TYPE &arg...)
Since
5.45

Import Statement
import org.kde.kirigami.templates
Version
2.4

Definition at line 66 of file controls/templates/InlineMessage.qml.

Member Enumeration Documentation

◆ Position

Defines a position for the message: whether it's to be used as an inline component inside the page, a page header, or a page footer.

Definition at line 73 of file controls/templates/InlineMessage.qml.

Property Documentation

◆ actions

listTAction org::kde::kirigami::templates::InlineMessage::actions
read

This property holds the list of actions to show.

Actions are added from left to right. If more actions are set than can fit, an overflow menu is provided.

Definition at line 133 of file controls/templates/InlineMessage.qml.

◆ animating

bool org::kde::kirigami::templates::InlineMessage::animating
read

This property holds whether the current message item is animating.

Remarks
This property is read-only

Definition at line 138 of file controls/templates/InlineMessage.qml.

◆ hoveredLink

alias org::kde::kirigami::templates::InlineMessage::hoveredLink
read

This property holds the link embedded in the message text that the user is hovering over.

Remarks
This property is read-only

Definition at line 101 of file controls/templates/InlineMessage.qml.

◆ icon

TPIconPropertiesGroup org::kde::kirigami::templates::InlineMessage::icon
read

This grouped property holds the description of an optional icon.

  • source: The source of the icon, a freedesktop-compatible icon name is recommended.
  • color: An optional tint color for the icon.

If no custom icon is set, an icon appropriate to the message type is shown.

Definition at line 117 of file controls/templates/InlineMessage.qml.

◆ position

int org::kde::kirigami::templates::InlineMessage::position
read

Adjust the look of the message based upon the position.

If a message is positioned in the header area or in the footer area of a page, it might be desirable to not have borders but just a line separating it from the content area. In this case, use the Header or Footer position. Default is InlineMessage.Position.Inline

Definition at line 86 of file controls/templates/InlineMessage.qml.

◆ showCloseButton

bool org::kde::kirigami::templates::InlineMessage::showCloseButton
read

This property holds whether the close button is displayed.

The default is false.

Definition at line 127 of file controls/templates/InlineMessage.qml.

◆ text

string org::kde::kirigami::templates::InlineMessage::text
read

This property holds the message text.

Definition at line 121 of file controls/templates/InlineMessage.qml.

◆ type

int org::kde::kirigami::templates::InlineMessage::type
read

This property holds the message type.

One of Information, Positive, Warning or Error.

The default is Kirigami.MessageType.Information.

Definition at line 107 of file controls/templates/InlineMessage.qml.

Member Function Documentation

◆ linkActivated

void org::kde::kirigami::templates::InlineMessage::linkActivated ( string link)
signal

This signal is emitted when a link is clicked or tapped in the message text.

Parameters
Theclicked or tapped link.

◆ linkHovered

void org::kde::kirigami::templates::InlineMessage::linkHovered ( string link)
signal

This signal is emitted when a link is hovered in the message text.

Parameters
Thehovered link.

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 Mon Nov 18 2024 12:16:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.