WebEngineNotification QML Type

封装 HTML5 网络通知的数据。更多

Import Statement: import QtWebEngine
Since: QtWebEngine 1.9
In C++: QWebEngineNotification

属性

信号

方法

详细说明

该类型包含 HTML5 桌面和推送通知的信息和 API。

网络引擎通知通过WebEngineProfile::presentNotification() 信号传递给用户。

有关如何处理网络通知的更多信息,请参阅通知示例

属性文档

direction : enumeration [read-only]

通知标题和正文的文本方向。

常数说明
Qt.LeftToRight项目从左到右排列。
Qt.RightToLeft项目从右向左排列。
Qt.LayoutDirectionAuto自动确定项目的布局方向。

language : string [read-only]

通知标题和正文的主要语言。

其值为有效的 BCP 47 语言标记或空字符串。


message : string [read-only]

通知信息的正文。


origin : url [read-only]

发送通知页面的 URL。


tag : string [read-only]

通知信息的标记。

如果新通知的标签和原 URL 与现有通知相同,则应使用相同标签替换或更新旧通知。


title : string [read-only]

通知标题。


信号文档

closed()

当网页调用通知的关闭步骤且不再需要显示通知时,将发出该信号。

注: 相应的处理程序是onClosed


方法文档

void click()

创建并调度通知的 JavaScript点击事件

当用户激活通知时,通知平台应调用该处理程序。


void close()

创建并调度通知的 JavaScript关闭事件

当通知被底层平台或用户关闭时,通知平台应调用该事件。


void show()

创建并调度通知的 JavaScript显示事件

当通知已显示给用户时,通知平台应调用该事件。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.