PySide6.QtWebEngineCore.QWebEngineHistory¶
- class QWebEngineHistory¶
- The - QWebEngineHistoryclass represents the history of a web engine page. More…- Synopsis¶- Properties¶- Methods¶- def - back()
- def - backItem()
- def - backItems()
- def - backItemsModel()
- def - canGoBack()
- def - canGoForward()
- def - clear()
- def - count()
- def - currentItem()
- def - forward()
- def - forwardItem()
- def - forwardItems()
- def - goToItem()
- def - itemAt()
- def - items()
- def - itemsModel()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- Each web engine page contains a history of visited pages that can be accessed by - 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.- Also, the following - QWebEngineHistoryModeldata model objects are provided:- backItemsModel(), which contains the URLs of visited pages.
- forwardItemsModel(), which contains the URLs of the pages that were visited after visiting the current page.
- itemsModel(), which contains the URLs of the back and forward items, as well as the URL of the current page.
 - 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 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property backItemsᅟ: QWebEngineHistoryModel¶
 - Access functions:
 - property forwardItemsᅟ: QWebEngineHistoryModel¶
 - Access functions:
 - property itemsᅟ: QWebEngineHistoryModel¶
 - Access functions:
 - back()¶
 - Sets the current item to be the previous item in the history and goes to the corresponding page; that is, goes back one history item. - See also - backItem()¶
- Return type:
 
 - Returns the item before the current item in the history. - backItems(maxItems)¶
- Parameters:
- maxItems – int 
- Return type:
- .list of QWebEngineHistoryItem 
 
 - Returns the list of items in the backwards history list. At most - maxItemsentries are returned.- See also - backItemsModel()¶
- Return type:
 
 - Return the data model, which represents URLs of visited pages. - Getter of property - backItemsᅟ.- canGoBack()¶
- Return type:
- bool 
 
 - Returns - trueif there is an item preceding the current item in the history; otherwise returns- false.- See also - canGoForward()¶
- Return type:
- bool 
 
 - Returns - trueif we have an item to go forward to; otherwise returns- false.- See also - clear()¶
 - Clears the history. - count()¶
- Return type:
- int 
 
 - Returns the total number of items in the history. - currentItem()¶
- Return type:
 
 - Returns the current item in the history. - currentItemIndex()¶
- Return type:
- int 
 
 - Returns the index of the current item in history. - forward()¶
 - Sets the current item to be the next item in the history and goes to the corresponding page; that is, goes forward one history item. - See also - forwardItem()¶
- Return type:
 
 - Returns the item after the current item in the history. - forwardItems(maxItems)¶
- Parameters:
- maxItems – int 
- Return type:
- .list of QWebEngineHistoryItem 
 
 - Returns the list of items in the forward history list. At most - maxItemsentries are returned.- See also - forwardItemsModel()¶
- Return type:
 
 - Return the data model, which represents URLs of the pages that were visited after visiting the current page. - Getter of property - forwardItemsᅟ.- goToItem(item)¶
- Parameters:
- item – - QWebEngineHistoryItem
 
 - Sets the current item to be the specified - itemin the history and goes to the page.- itemAt(i)¶
- Parameters:
- i – int 
- Return type:
 
 - Returns the item at index - iin the history.- items()¶
- Return type:
- .list of QWebEngineHistoryItem 
 
 - Returns a list of all items currently in the history. - itemsModel()¶
- Return type:
 
 - Returns the data model, which represents URLs of back items, forward items, and the current item in the history. - Getter of property - itemsᅟ.