QWebEngineHistoryModel Class

表示网络引擎页面历史的数据模型。更多

Header: #include <QWebEngineHistoryModel>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
qmake: QT += webenginecore
Qt 6.2
在 QML 中: WebEngineHistoryModel
继承: QAbstractListModel

公共类型

enum Roles { UrlRole, TitleRole, OffsetRole, IconUrlRole }

详细描述

QWebEngineHistoryModel 类型公开了titleurliconoffset角色。titleurl图标指定访问页面的标题、URL 和 favicon。偏移量指定页面相对于当前页面(0)的位置。正数表示该页面在当前页面之后被访问,而负数表示该页面在当前页面之前被访问。

该类型不可创建,但可通过QWebEngineHistory::itemsModel,QWebEngineHistory::backItemsModel,QWebEngineHistory::forwardItemsModel 方法访问。

另请参阅 QWebEngineHistory

成员类型文档

enum QWebEngineHistoryModel::Roles

该枚举描述了历史数据模型支持的特定角色。

常量描述
QWebEngineHistoryModel::UrlRoleQt::UserRole访问页面的 URL
QWebEngineHistoryModel::TitleRole257访问页面的标题
QWebEngineHistoryModel::OffsetRole258页面相对于当前页面的偏移量(0)
QWebEngineHistoryModel::IconUrlRole259访问页面的图标

© 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.