InlineMessage QML Type
Import Statement: | import org.kde.kirigami |
Since: | 5.45 |
Properties
- actions : T.Action
- animating : bool
- hoveredLink : string
- icon : IconPropertiesGroup
- icon.color : color
- icon.fromControlsIcon : function
- icon.height : real
- icon.name : string
- icon.source : var
- icon.width : real
- position : int
- showCloseButton : bool
- text : string
- type : int
Signals
- linkActivated(string link)
- 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") actions: [ 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 } } ] }
Property Documentation
actions : T.Action |
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.
animating : bool |
This property holds whether the current message item is animating.
hoveredLink : string |
This property holds the link embedded in the message text that the user is hovering over.
icon : IconPropertiesGroup |
This grouped property holds the description of an optional icon.
Name | Description |
---|---|
name | This property holds icon name. The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead. |
source | This property holds the icon source. The icon will be loaded as a regular image. |
width | This property holds the width of the icon. |
height | This property holds the height of the icon. |
color | This property holds the icon tint color. The icon is tinted with the specified color, unless the color is set to "transparent". |
fromControlsIcon | Bind this icon to all matching properties of a Controls icon group. This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group. To use it, you can assign the result to an IconPropertiesGroup, like so: icon: icon.fromControlsIcon(control.icon). |
icon.color : color |
This grouped property holds the description of an optional icon.
Name | Description |
---|---|
name | This property holds icon name. The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead. |
source | This property holds the icon source. The icon will be loaded as a regular image. |
width | This property holds the width of the icon. |
height | This property holds the height of the icon. |
color | This property holds the icon tint color. The icon is tinted with the specified color, unless the color is set to "transparent". |
fromControlsIcon | Bind this icon to all matching properties of a Controls icon group. This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group. To use it, you can assign the result to an IconPropertiesGroup, like so: icon: icon.fromControlsIcon(control.icon). |
icon.fromControlsIcon : function |
This grouped property holds the description of an optional icon.
Name | Description |
---|---|
name | This property holds icon name. The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead. |
source | This property holds the icon source. The icon will be loaded as a regular image. |
width | This property holds the width of the icon. |
height | This property holds the height of the icon. |
color | This property holds the icon tint color. The icon is tinted with the specified color, unless the color is set to "transparent". |
fromControlsIcon | Bind this icon to all matching properties of a Controls icon group. This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group. To use it, you can assign the result to an IconPropertiesGroup, like so: icon: icon.fromControlsIcon(control.icon). |
icon.height : real |
This grouped property holds the description of an optional icon.
Name | Description |
---|---|
name | This property holds icon name. The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead. |
source | This property holds the icon source. The icon will be loaded as a regular image. |
width | This property holds the width of the icon. |
height | This property holds the height of the icon. |
color | This property holds the icon tint color. The icon is tinted with the specified color, unless the color is set to "transparent". |
fromControlsIcon | Bind this icon to all matching properties of a Controls icon group. This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group. To use it, you can assign the result to an IconPropertiesGroup, like so: icon: icon.fromControlsIcon(control.icon). |
icon.name : string |
This grouped property holds the description of an optional icon.
Name | Description |
---|---|
name | This property holds icon name. The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead. |
source | This property holds the icon source. The icon will be loaded as a regular image. |
width | This property holds the width of the icon. |
height | This property holds the height of the icon. |
color | This property holds the icon tint color. The icon is tinted with the specified color, unless the color is set to "transparent". |
fromControlsIcon | Bind this icon to all matching properties of a Controls icon group. This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group. To use it, you can assign the result to an IconPropertiesGroup, like so: icon: icon.fromControlsIcon(control.icon). |
icon.source : var |
This grouped property holds the description of an optional icon.
Name | Description |
---|---|
name | This property holds icon name. The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead. |
source | This property holds the icon source. The icon will be loaded as a regular image. |
width | This property holds the width of the icon. |
height | This property holds the height of the icon. |
color | This property holds the icon tint color. The icon is tinted with the specified color, unless the color is set to "transparent". |
fromControlsIcon | Bind this icon to all matching properties of a Controls icon group. This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group. To use it, you can assign the result to an IconPropertiesGroup, like so: icon: icon.fromControlsIcon(control.icon). |
icon.width : real |
This grouped property holds the description of an optional icon.
Name | Description |
---|---|
name | This property holds icon name. The icon will be loaded from the platform theme. If the icon is found in the theme, it will always be used; even if icon.source is also set. If the icon is not found, icon.source will be used instead. |
source | This property holds the icon source. The icon will be loaded as a regular image. |
width | This property holds the width of the icon. |
height | This property holds the height of the icon. |
color | This property holds the icon tint color. The icon is tinted with the specified color, unless the color is set to "transparent". |
fromControlsIcon | Bind this icon to all matching properties of a Controls icon group. This function automatically binds all properties to matching properties of a controls icon group, since we cannot just reuse the Controls icon group. To use it, you can assign the result to an IconPropertiesGroup, like so: icon: icon.fromControlsIcon(control.icon). |
position : int |
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.
Possible values are:
- InlineMessage.Position.Inline
- InlineMessage.Position.Header
- InlineMessage.Position.Footer
Default is InlineMessage.Position.Inline
showCloseButton : bool |
This property holds whether the close button is displayed.
The default is false
.
text : string |
This property holds the message text.
type : int |
This property holds the message type. One of
- Information
- Positive
- Warning
- Error
The default is Kirigami.MessageType.Information.
Signal Documentation
linkActivated(string link) |
This signal is emitted when a link is clicked or tapped in the message text. link The clicked or tapped link.
Note: The corresponding handler is onLinkActivated
.
linkHovered(string link) |
This signal is emitted when a link is hovered in the message text. link The hovered link.
Note: The corresponding handler is onLinkHovered
.