内容表

上一话题

QWebEngineFullScreenRequest

下一话题

QWebEngineHistoryItem

QWebEngineHistory

QWebEngineHistory class represents the history of a web engine page. 更多

Inheritance diagram of PySide2.QtWebEngineWidgets.QWebEngineHistory

概要

函数

详细描述

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 使用 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() 函数。

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() 函数。

QWebEngineHistory ‘s state can be saved to a QDataStream using the >> operator and loaded by using the << operator.

PySide2.QtWebEngineWidgets.QWebEngineHistory. 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.

PySide2.QtWebEngineWidgets.QWebEngineHistory. backItem ( )
返回类型

QWebEngineHistoryItem

返回历史中在当前项之前的项。

PySide2.QtWebEngineWidgets.QWebEngineHistory. backItems ( maxItems )
参数

maxItems int

返回类型

Returns the list of items in the backwards history list. At most maxItems entries are returned.

另请参阅

forwardItems()

PySide2.QtWebEngineWidgets.QWebEngineHistory. canGoBack ( )
返回类型

bool

返回 true if there is an item preceding the current item in the history; otherwise returns false .

另请参阅

canGoForward()

PySide2.QtWebEngineWidgets.QWebEngineHistory. canGoForward ( )
返回类型

bool

返回 true if we have an item to go forward to; otherwise returns false .

另请参阅

canGoBack()

PySide2.QtWebEngineWidgets.QWebEngineHistory. clear ( )

清零历史。

另请参阅

count() items()

PySide2.QtWebEngineWidgets.QWebEngineHistory. count ( )
返回类型

int

Returns the total number of items in the history.

PySide2.QtWebEngineWidgets.QWebEngineHistory. currentItem ( )
返回类型

QWebEngineHistoryItem

Returns the current item in the history.

PySide2.QtWebEngineWidgets.QWebEngineHistory. currentItemIndex ( )
返回类型

int

Returns the index of the current item in history.

PySide2.QtWebEngineWidgets.QWebEngineHistory. 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.

PySide2.QtWebEngineWidgets.QWebEngineHistory. forwardItem ( )
返回类型

QWebEngineHistoryItem

Returns the item after the current item in the history.

PySide2.QtWebEngineWidgets.QWebEngineHistory. forwardItems ( maxItems )
参数

maxItems int

返回类型

Returns the list of items in the forward history list. At most maxItems entries are returned.

另请参阅

backItems()

PySide2.QtWebEngineWidgets.QWebEngineHistory. goToItem ( item )
参数

item QWebEngineHistoryItem

Sets the current item to be the specified item in the history and goes to the page.

PySide2.QtWebEngineWidgets.QWebEngineHistory. itemAt ( i )
参数

i int

返回类型

QWebEngineHistoryItem

Returns the item at index i in the history.

PySide2.QtWebEngineWidgets.QWebEngineHistory. items ( )
返回类型

Returns a list of all items currently in the history.

另请参阅

count() clear()