- Qt 6.7
- Qt WebEngine
- QML Types
- WebEngineNotification
- Qt 6.7.3 Reference Documentation

# WebEngineNotification QML Type

Encapsulates the data of an HTML5 web notification. More...

Import Statement: | import QtWebEngine
Since: | QtWebEngine 1.9
Instantiates: | QWebEngineNotification

- List of all members, including inherited members

## Properties

- direction : enumeration
- language : string
- message : string
- origin : url
- tag : string
- title : string

## Signals

- closed()

## Methods

- void click()
- void close()
- void show()

## Detailed Description

This type contains the information and API for HTML5 desktop and push notifications.

Web engine notifications are passed to the user in the WebEngineProfile::presentNotification() signal.

For more information about how to handle web notification, see the Notification Example.

## Property Documentation

direction : enumeration `[read-only]`

The text direction for the notification's title and body.

Constant | Description
--- | ---
`Qt.LeftToRight` | Items are laid out from left to right.
`Qt.RightToLeft` | Items are laid out from right to left.
`Qt.LayoutDirectionAuto` | The direction to lay out items is determined automatically.

language : string `[read-only]`

The primary language for the notification's title and body.

Its value is a valid BCP 47 language tag, or the empty string.

message : string `[read-only]`

The body of the notification message.

origin : url `[read-only]`

The URL of the page sending the notification.

tag : string `[read-only]`

The tag of the notification message.

New notifications that have the same tag and origin URL as an existing one should replace or update the old notification with the same tag.

title : string `[read-only]`

The title of the notification.

## Signal Documentation

closed()

This signal is emitted when the web page calls close steps for the notification, and it no longer needs to be shown.

Note: The corresponding handler is `onClosed`.

## Method Documentation

void click()

Creates and dispatches a JavaScript click event on notification.

Should be called by the notification platform when the notification is activated by the user.

void close()

Creates and dispatches a JavaScript close event on notification.

Should be called by the notification platform when the notification is closed, either by the underlying platform or by the user.

void show()

Creates and dispatches a JavaScript show event on notification.

Should be called by the notification platform when the notification has been shown to user.