IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QWebEngineNotification Class

The QWebEngineNotification class encapsulates the data of an HTML5 web notification.

This class was introduced in Qt 5.13.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QWebEngineNotification Class

  • Header: QWebEngineNotification

  • Since: Qt 5.13

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)

    target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)

  • qmake: QT += webenginecore

  • Inherited By:

  • Instantiated By: qml-qtwebengine-webenginenotification.xml

  • Inherits: QObject

Detailed Description

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

Web engine notifications are passed to the user through the custom handler provided with the QWebEngineProfile::setNotificationPresenter() call.

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

Property Documentation

 

[read-only] direction : const Qt::LayoutDirection

This property holds the text direction for the notification's title and body.

Access functions:

  • direction() const

See Also

See also title(), message()

[read-only] language : const QString

This property holds the primary language for the notification's title and body.

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

Access functions:

  • language() const

See Also

See also title(), message()

[read-only] message : const QString

This property holds the body of the notification message.

Access functions:

  • message() const

See Also

See also title()

[read-only] origin : const QUrl

This property holds the URL of the page sending the notification.

Access functions:

  • origin() const

[read-only] tag : const QString

This property holds 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.

Access functions:

  • tag() const

See Also

See also matches()

[read-only] title : const QString

This property holds the title of the notification.

Access functions:

  • title() const

See Also

See also message()

Member Function Documentation

 

void QWebEngineNotification::click() const

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 QWebEngineNotification::close() const

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 QWebEngineNotification::closed()

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

QImage QWebEngineNotification::icon() const

Returns the icon to be shown with the notification.

If no icon is set by the sender, a null QImage is returned.

bool QWebEngineNotification::matches(const QWebEngineNotification *other) const

Returns true if the two notifications belong to the same message chain. That is, if their tag() and origin() are the same. This means one is a replacement or an update of the other.

See Also

See also tag(), origin()

void QWebEngineNotification::show() const

Creates and dispatches a JavaScript show event on notification.

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

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+