InfoBarManager QML Type
Manages a stack of InfoBar notifications. More...
| Import Statement: | import FluentUI.Controls 1.0 |
Properties
- edge : int
- isOverlay : bool
- messageMaximumWidth : int
- offsetX : int
- offsetY : int
- spacing : int
- target : var
Methods
- void create(int severity, string title, int duration, string message, Component action)
- void createCustom(Component component, int duration)
Detailed Description
InfoBarManager is a non-visual component that manages the display and stacking of multiple InfoBar notifications. It handles positioning, spacing, automatic dismissal, and overlay or in-place display modes. Notifications can be created programmatically with customizable severity, title, message, duration, and action content.
Usage Example
import QtQuick
import FluentUI.Controls
InfoBarManager {
id: manager
target: parent
}
Button {
onClicked: manager.create(
InfoBarType.Success,
"Saved",
3000,
"Your changes have been saved."
)
}
Property Documentation
edge : int
The edge of the target area where notifications stack. Defaults to Qt.TopEdge. Other options include Qt.BottomEdge.
isOverlay : bool
Whether notifications are displayed as an overlay above the target content. Defaults to false.
messageMaximumWidth : int
The maximum width of each InfoBar's message area in pixels. Defaults to 520.
offsetX : int
The horizontal offset from the edge in pixels. Defaults to 20.
offsetY : int
The vertical offset from the edge in pixels. Defaults to 50.
spacing : int
The spacing between stacked InfoBar notifications in pixels. Defaults to 20.
target : var
The parent Item within which InfoBar notifications are displayed. Notifications are positioned relative to this target.
Method Documentation
void create(int severity, string title, int duration, string message, Component action)
Creates and displays an InfoBar notification with the given parameters. The duration is in milliseconds; pass 0 for a notification that does not auto-dismiss.
void createCustom(Component component, int duration)
Creates a notification using a custom Component. The duration parameter controls auto-dismiss in milliseconds; pass 0 for no auto-dismiss.