QWebEngineNotification 类封装 HTML5 Web 通知的数据。 更多...
头: | #include <QWebEngineNotification> |
Since: | Qt 5.13 |
实例化: | WebEngineNotification |
继承: | QObject |
该类在 Qt 5.13 引入。
Qt::LayoutDirection | direction () const |
QImage | icon () const |
QString | 语言 () const |
bool | 匹配 (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 通知范例 .
This property holds the text direction for the notification's title and body.
访问函数:
Qt::LayoutDirection | direction () const |
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 |
This property holds the body of the notification message.
访问函数:
QString | message () const |
另请参阅 title ().
This property holds the URL of the page sending the notification.
访问函数:
QUrl | origin () const |
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 |
另请参阅 匹配 ().
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.
Returns the icon to be shown with the notification.
If no icon is set by the sender, a null QImage 被返回。
返回
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
.