Qt 5.9 | QWebHistoryInterface

Qt 5.9.1 Reference Documentation

# QWebHistoryInterface Class

The QWebHistoryInterface class provides an interface to implement link history. More...

Header: | #include <QWebHistoryInterface>
qmake: | QT += webkitwidgets
Since: | Qt 4.4

- List of all members, including inherited members

## Public Functions

| QWebHistoryInterface(QObject *parent = Q_NULLPTR)
| ~QWebHistoryInterface()
virtual void | addHistoryEntry(const QString &url) = 0
virtual bool | historyContains(const QString &url) const = 0

## Static Public Members

QWebHistoryInterface * | defaultInterface()
void | setDefaultInterface(QWebHistoryInterface *defaultInterface)

## Detailed Description

The QWebHistoryInterface class provides an interface to implement link history.

The QWebHistoryInterface is an interface that can be used to keep track of visited links. It contains two pure virtual methods that are called by the WebKit engine: addHistoryEntry() is used to add urls that have been visited to the interface, while historyContains() is used to query whether the given url has been visited by the user. By default the QWebHistoryInterface is not set, so WebKit does not keep track of visited links.

Note: The history tracked by QWebHistoryInterface is not specific to an instance of QWebPage but applies to all pages.

## Member Function Documentation

### QWebHistoryInterface::QWebHistoryInterface(QObject *parent = Q_NULLPTR)

Constructs a new QWebHistoryInterface with parent parent.

### QWebHistoryInterface::~QWebHistoryInterface()

Destroys the interface. If this is currently the default interface it will be unset.

### `[pure virtual]` void QWebHistoryInterface::addHistoryEntry(const QString &url)

Called by WebKit to add another url to the list of visited pages.

### `[static]` QWebHistoryInterface *QWebHistoryInterface::defaultInterface()

Returns the default interface that will be used by WebKit. If no default interface has been set, WebKit will not keep track of visited links and a null pointer will be returned.

See also setDefaultInterface().

### `[pure virtual]` bool QWebHistoryInterface::historyContains(const QString &url) const

Called by the WebKit engine to query whether a certain url has been visited by the user already. Returns true if the url is part of the history of visited links; otherwise returns false.

### `[static]` void QWebHistoryInterface::setDefaultInterface(QWebHistoryInterface *defaultInterface)

Sets a new default interface, defaultInterface, that will be used by all of WebKit to keep track of visited links.

If an interface without a parent has already been set, the old interface will be deleted. When the application exists QWebHistoryInterface will automatically delete the defaultInterface if it does not have a parent.

See also defaultInterface().