QWebEngineNotification 類

QWebEngineNotification 類封裝 HTML5 Web 通知的數據。 更多...

頭: #include <QWebEngineNotification>
Since: Qt 5.13
實例化: WebEngineNotification
繼承: QObject

該類在 Qt 5.13 引入。

特性

公共函數

Qt::LayoutDirection direction () const
QImage icon () const
QString language () const
bool matches (const QWebEngineNotification * other ) const
QString message () const
QUrl origin () const
QString tag () const
QString title () const

公共槽

void click () const
void close () const
void show () const

信號

void closed ()

詳細描述

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 () 調用。

For more information about how to handle web notification, see the 通知範例 .

特性文檔編製

direction : const Qt::LayoutDirection

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

訪問函數:

Qt::LayoutDirection direction () const

另請參閱 title () 和 message ().

語言 : 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.

訪問函數:

QString 語言 () const

另請參閱 title () 和 message ().

message : const QString

This property holds the body of the notification message.

訪問函數:

QString message () const

另請參閱 title ().

origin : const QUrl

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

訪問函數:

QUrl origin () const

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.

訪問函數:

QString tag () const

另請參閱 matches ().

title : const QString

This property holds the title of the notification.

訪問函數:

QString title () const

另請參閱 message ().

成員函數文檔編製

[slot] void QWebEngineNotification:: click () const

創建並分派 JavaScript click event on notification.

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

[slot] void QWebEngineNotification:: close () const

創建並分派 JavaScript 關閉事件 on notification.

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

[signal] 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.

[slot] void QWebEngineNotification:: show () const

創建並分派 JavaScript show event on notification.

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

QImage QWebEngineNotification:: icon () const

Returns the icon to be shown with the notification.

If no icon is set by the sender, a null QImage 被返迴。

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

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

另請參閱 tag () 和 origin ().