QWebHistory Class Reference

[ QtWebKit module]

The QWebHistory class represents the history of a QWebPage 更多...

方法

Special Methods


详细描述

The QWebHistory class represents the history of a QWebPage

QWebPage instance contains a history of visited pages that can be accessed by QWebPage.history (). QWebHistory represents this history and makes it possible to navigate it.

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

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


方法文档编制

QWebHistory.back ( self )

Set the current item to be the previous item in the history and goes to the corresponding page; i.e., goes back one history 项。

另请参阅 forward () and goToItem ().

QWebHistoryItem QWebHistory.backItem ( self )

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

list-of-QWebHistoryItem QWebHistory.backItems ( self , int  maxItems )

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

另请参阅 forwardItems ().

bool QWebHistory.canGoBack ( self )

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

另请参阅 canGoForward ().

bool QWebHistory.canGoForward ( self )

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

另请参阅 canGoBack ().

QWebHistory.clear ( self )

清零历史。

另请参阅 count () 和 items ().

int QWebHistory.count ( self )

Returns the total number of items in the history.

QWebHistoryItem QWebHistory.currentItem ( self )

Returns the current item in the history.

int QWebHistory.currentItemIndex ( self )

Returns the index of the current item in history.

该函数在 Qt 4.5 引入。

QWebHistory.forward ( self )

Sets the current item to be the next item in the history and goes to the corresponding page; i.e., goes forward one history 项。

另请参阅 back () 和 goToItem ().

QWebHistoryItem QWebHistory.forwardItem ( self )

Returns the item after the current item in the history.

list-of-QWebHistoryItem QWebHistory.forwardItems ( self , int  maxItems )

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

另请参阅 backItems ().

QWebHistory.goToItem ( self , QWebHistoryItem   item )

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

另请参阅 back () 和 forward ().

QWebHistoryItem QWebHistory.itemAt ( self , int  i )

Returns the item at index i in the history.

list-of-QWebHistoryItem QWebHistory.items ( self )

Returns a list of all items currently in the history.

另请参阅 count () 和 clear ().

int QWebHistory.maximumItemCount ( self )

Returns the maximum number of items in the history.

该函数在 Qt 4.5 引入。

另请参阅 setMaximumItemCount ().

QWebHistory.setMaximumItemCount ( self , int  count )

Sets the maximum number of items in the history to count .

该函数在 Qt 4.5 引入。

另请参阅 maximumItemCount ().

QWebHistory.__len__ ( self )