QWebEngineNotification 类
QWebEngineNotification 类封装了 HTML5 网页通知的数据。 更多...
| 头文件 | #include <QWebEngineNotification> | 
| CMake | find_package(Qt6 REQUIRED COMPONENTS WebEngineCore) target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore) | 
| qmake | QT += webenginecore | 
| 实例化自 | WebEngineNotification | 
| 继承 | QObject | 
属性
公共函数
| 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 | closed() | 
详细描述
此类包含 HTML5 桌面和推送通知的信息和 API。
通过调用 QWebEngineProfile::setNotificationPresenter() 提供的自定义处理程序将 Web 引擎通知传递给用户。
有关处理网页通知的更多信息,请参阅 通知示例。
属性文档
[只读] direction : const Qt::LayoutDirection
此属性存储通知的标题和主体文本的方向。
访问函数
| Qt::LayoutDirection | direction() const | 
[只读] language : const QString
此属性保存通知标题和内容的默认语言。
其值是一个有效的BCP 47语言标签或空字符串。
访问函数
| QString | language() const | 
[只读] message : const QString
此属性保存通知信息的正文。
访问函数
| QString | message() const | 
参见 title().
[只读] origin : const QUrl
此属性保存发送通知的页面的URL。
访问函数
| QUrl | origin() const | 
[只读] tag : const QString
此属性保存通知信息的标签。
与现有通知具有相同标签和来源URL的新通知应替换或更新具有相同标签的旧通知。
访问函数
| QString | tag() const | 
参见 matches().
[只读] title : const QString
此属性保存通知的标题。
访问函数
| QString | title() const | 
参见 message().
成员函数文档
[槽] void QWebEngineNotification::click() const
在通知上创建和分配一个JavaScript 点击事件。
应由通知平台在用户激活通知时调用。
[槽] void QWebEngineNotification::close() const
在通知上创建和分配一个JavaScript 关闭事件。
应由通知平台在通知被关闭(无论是平台底层还是用户操作)时调用。
[信号] void QWebEngineNotification::closed()
当网页调用关闭步骤时发出此信号,并且通知不再需要显示。
QImage QWebEngineNotification::icon() const
返回与通知一起显示的图标。
如果发送者没有设置图标,则返回一个空的QImage。
bool QWebEngineNotification::matches(const QWebEngineNotification *other) const
如果两个通知属于同一个消息链,则返回 true。也就是说,如果它们的 tag() 和 origin() 相同。这意味着一个是另一个的替代品或更新。
[槽] void QWebEngineNotification::show() const
在通知上创建并发送一个 JavaScript show 事件。
当通知已向用户显示时,应由通知平台调用。
© 2024 Qt公司有限公司。本文档中包含的贡献的文档版权属于各自的版权所有者。本文档按照免费软件基金会发布的 GNU自由文档许可(FDL)版本1.3 的条款提供。Qt以及相应的标志是Qt公司在芬兰和其他国家的商标。所有其他商标均为其各自所有者的财产。