A data model that represents the history of a web engine page. 更多...
头: | #include <QWebEngineHistoryModel> |
CMake: |
find_package(Qt6 COMPONENTS WebEngineCore REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore) |
qmake: | QT += webenginecore |
Since: | Qt 6.2 |
实例化: | WebEngineHistoryModel |
继承: | QAbstractListModel |
enum | Roles { UrlRole, TitleRole, OffsetRole, IconUrlRole } |
The QWebEngineHistoryModel type exposes the title , url , icon ,和 offset roles. The title , url and icon specify the title, URL, and favicon of the visited page. The offset specifies the position of the page in respect to the current page (0). A positive number indicates that the page was visited after the current page, whereas a negative number indicates that the page was visited before the current page.
This type is uncreatable, but it can be accessed by using the QWebEngineHistory::itemsModel , QWebEngineHistory::backItemsModel , QWebEngineHistory::forwardItemsModel 方法。
另请参阅 QWebEngineHistory .
This enum describes specific roles, which history data model supports.
常量 | 值 | 描述 |
---|---|---|
QWebEngineHistoryModel::UrlRole
|
Qt::UserRole
|
URL of the visited page |
QWebEngineHistoryModel::TitleRole
|
257
|
Title of the visited page |
QWebEngineHistoryModel::OffsetRole
|
258
|
The offset of the page in respect to the current page (0) |
QWebEngineHistoryModel::IconUrlRole
|
259
|
Favicon of the visited page |