QWebEngineHistory Class
The QWebEngineHistory class represents the history of a web engine page. More...
Header: | #include <QWebEngineHistory> |
qmake: | QT += webenginewidgets |
Since: | Qt 5.4 |
Public Functions
void | back() |
QWebEngineHistoryItem | backItem() const |
QList<QWebEngineHistoryItem> | backItems(int maxItems) const |
bool | canGoBack() const |
bool | canGoForward() const |
void | clear() |
int | count() const |
QWebEngineHistoryItem | currentItem() const |
int | currentItemIndex() const |
void | forward() |
QWebEngineHistoryItem | forwardItem() const |
QList<QWebEngineHistoryItem> | forwardItems(int maxItems) const |
void | goToItem(const QWebEngineHistoryItem &item) |
QWebEngineHistoryItem | itemAt(int i) const |
QList<QWebEngineHistoryItem> | items() const |
Detailed Description
The QWebEngineHistory class represents the history of a web engine page.
Each web engine page contains a history of visited pages that can be accessed by QWebEnginePage::history().
The history uses the concept of a current item, dividing the pages visited into those that can be visited by navigating back and forward using the back() and forward() functions. The current item can be obtained by calling currentItem(), and an arbitrary item in the history can be made the current item by passing it to goToItem().
A list of items describing the pages that can be visited by going back can be obtained by calling the backItems() function; similarly, items describing the pages ahead of the current page can be obtained with the forwardItems() function. The total list of items is obtained with the items() function.
Just as with containers, functions are available to examine the history in terms of a list. Arbitrary items in the history can be obtained with itemAt(), the total number of items is given by count(), and the history can be cleared with the clear() function.
QWebEngineHistory's state can be saved to a QDataStream using the >> operator and loaded by using the << operator.
See also QWebEngineHistoryItem and QWebEnginePage.