#include <mw/QtWebKit/qwebpage.h>
class QWebPage : public QObject, public QObject |
The QWebPage class provides an object to view and edit web documents.
Public Member Enumerations | |
---|---|
enum | ErrorDomain { QtNetwork, Http, WebKit } |
enum | Extension { ChooseMultipleFilesExtension, ErrorPageExtension } |
enum | Feature { Notifications, Geolocation } |
enum | FindFlag { FindBackward, FindCaseSensitively, FindWrapsAroundDocument, HighlightAllOccurrences } |
enum | PermissionPolicy { PermissionUnknown, PermissionGrantedByUser, PermissionDeniedByUser } |
enum | WebAction { NoWebAction, OpenLink, OpenLinkInNewWindow, OpenFrameInNewWindow, ..., WebActionCount } |
enum | WebWindowType { WebBrowserWindow, WebModalDialog } |
Public Properties | |
---|---|
bool | contentEditable |
bool | forwardUnsupportedContent |
LinkDelegationPolicy | linkDelegationPolicy |
bool | modified |
QPalette | palette |
QSize | preferredContentsSize |
QString | selectedText |
QSize | viewportSize |
Protected Member Functions | |
---|---|
virtual bool | acceptNavigationRequest(QWebFrame *, const QNetworkRequest &, NavigationType) |
virtual QString | chooseFile(QWebFrame *, const QString &) |
virtual QObject * | createPlugin(const QString &, const QUrl &, const QStringList &, const QStringList &) |
virtual QWebPage * | createWindow(WebWindowType) |
virtual void | javaScriptAlert(QWebFrame *, const QString &) |
virtual bool | javaScriptConfirm(QWebFrame *, const QString &) |
virtual void | javaScriptConsoleMessage(const QString &, int, const QString &) |
virtual bool | javaScriptPrompt(QWebFrame *, const QString &, const QString &, QString *) |
virtual QString | userAgentForUrl(const QUrl &) |
Public Slots | |
---|---|
bool | shouldInterruptJavaScript() |
Inherited Attributes | |
---|---|
QObject::d_ptr | |
QObject::objectName | |
QObject::staticQtMetaObject |
Inherited Functions | |
---|---|
QObject::QObject(QObjectPrivate &,QObject *) | |
QObject::blockSignals(bool) | |
QObject::childEvent(QChildEvent *) | |
QObject::children()const | |
QObject::connect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &,Qt::ConnectionType) | |
QObject::connect(const QObject *,const char *,const QObject *,const char *,Qt::ConnectionType) | |
QObject::connect(const QObject *,const char *,const char *,Qt::ConnectionType)const | |
QObject::connectNotify(const char *) | |
QObject::customEvent(QEvent *) | |
QObject::deleteLater | |
QObject::destroyed | |
QObject::disconnect(const QObject *,const QMetaMethod &,const QObject *,const QMetaMethod &) | |
QObject::disconnect(const QObject *,const char *) | |
QObject::disconnect(const QObject *,const char *,const QObject *,const char *) | |
QObject::disconnect(const char *,const QObject *,const char *) | |
QObject::disconnectNotify(const char *) | |
QObject::dumpObjectInfo() | |
QObject::dumpObjectTree() | |
QObject::dynamicPropertyNames()const | |
QObject::eventFilter(QObject *,QEvent *) | |
QObject::findChild(const QString &)const | |
QObject::findChildren(const QRegExp &)const | |
QObject::findChildren(const QString &)const | |
QObject::inherits(const char *)const | |
QObject::installEventFilter(QObject *) | |
QObject::isWidgetType()const | |
QObject::killTimer(int) | |
QObject::moveToThread(QThread *) | |
QObject::objectName()const | |
QObject::parent()const | |
QObject::property(const char *)const | |
QObject::receivers(const char *)const | |
QObject::registerUserData() | |
QObject::removeEventFilter(QObject *) | |
QObject::sender()const | |
QObject::senderSignalIndex()const | |
QObject::setObjectName(const QString &) | |
QObject::setParent(QObject *) | |
QObject::setProperty(const char *,const QVariant &) | |
QObject::setUserData(uint,QObjectUserData *) | |
QObject::signalsBlocked()const | |
QObject::startTimer(int) | |
QObject::thread()const | |
QObject::timerEvent(QTimerEvent *) | |
QObject::userData(uint)const | |
QObject::~QObject() |
QWebPage's API is very similar to QWebView, as you are still provided with common functions like action() (known as {QWebView::pageAction()}{pageAction}() in QWebView), triggerAction(), findText() and settings(). More QWebView-like functions can be found in the main frame of QWebPage, obtained via the mainFrame() function. For example, the {QWebFrame::load()}{load}(), {QWebFrame::setUrl()}{setUrl}() and {QWebFrame::setHtml()}{setHtml}() functions for QWebPage can be accessed using QWebFrame.
The loadStarted() signal is emitted when the page begins to load.The loadProgress() signal, on the other hand, is emitted whenever an element of the web page completes loading, such as an embedded image, a script, etc. Finally, the loadFinished() signal is emitted when the page contents are loaded completely, independent of script execution or page rendering. Its argument, either true or false, indicates whether or not the load operation succeeded.
QtNetwork The error occurred in the QtNetwork layer; the error code is of type QNetworkReply::NetworkError. Http The error occurred in the HTTP layer; the error code is a HTTP status code (see QNetworkRequest::HttpStatusCodeAttribute). WebKit The error is an internal WebKit error.
This enum describes the types of extensions that the page can support. Before using these extensions, you should verify that the extension is supported by calling supportsExtension().
ChooseMultipleFilesExtension Whether the web page supports multiple file selection. This extension is invoked when the web content requests one or more file names, for example as a result of the user clicking on a "file upload" button in a HTML form where multiple file selection is allowed.
ErrorPageExtension Whether the web page can provide an error page when loading fails. (introduced in Qt 4.6)
See also: ChooseMultipleFilesExtensionOption, ChooseMultipleFilesExtensionReturn, ErrorPageExtensionOption, ErrorPageExtensionReturn
Enumerator | Value | Description |
---|---|---|
ChooseMultipleFilesExtension | ||
ErrorPageExtension |
Enumerator | Value | Description |
---|---|---|
Notifications | ||
Geolocation |
This enum describes the options available to the findText() function. The options can be OR-ed together from the following list:
FindBackward Searches backwards instead of forwards. FindCaseSensitively By default findText() works case insensitive. Specifying this option changes the behaviour to a case sensitive find operation. FindWrapsAroundDocument Makes findText() restart from the beginning of the document if the end was reached and the text was not found. HighlightAllOccurrences Highlights all existing occurrences of a specific string.
Enumerator | Value | Description |
---|---|---|
FindBackward | 1 | |
FindCaseSensitively | 2 | |
FindWrapsAroundDocument | 4 | |
HighlightAllOccurrences | 8 |
Enumerator | Value | Description |
---|---|---|
PermissionUnknown | ||
PermissionGrantedByUser | ||
PermissionDeniedByUser |
This enum describes the types of action which can be performed on the web page.
Actions only have an effect when they are applicable. The availability of actions can be be determined by checking {QAction::}{isEnabled()} on the action returned by action().
One method of enabling the text editing, cursor movement, and text selection actions is by setting contentEditable to true.
NoWebAction No action is triggered. OpenLink Open the current link. OpenLinkInNewWindow Open the current link in a new window. OpenFrameInNewWindow Replicate the current frame in a new window. DownloadLinkToDisk Download the current link to the disk. CopyLinkToClipboard Copy the current link to the clipboard. OpenImageInNewWindow Open the highlighted image in a new window. DownloadImageToDisk Download the highlighted image to the disk. CopyImageToClipboard Copy the highlighted image to the clipboard. Back Navigate back in the history of navigated links. Forward Navigate forward in the history of navigated links. Stop Stop loading the current page. StopScheduledPageRefresh Stop all pending page refresh/redirect requests. Reload Reload the current page. ReloadAndBypassCache Reload the current page, but do not use any local cache. (Added in Qt 4.6) Cut Cut the content currently selected into the clipboard. Copy Copy the content currently selected into the clipboard. Paste Paste content from the clipboard. Undo Undo the last editing action. Redo Redo the last editing action. MoveToNextChar Move the cursor to the next character. MoveToPreviousChar Move the cursor to the previous character. MoveToNextWord Move the cursor to the next word. MoveToPreviousWord Move the cursor to the previous word. MoveToNextLine Move the cursor to the next line. MoveToPreviousLine Move the cursor to the previous line. MoveToStartOfLine Move the cursor to the start of the line. MoveToEndOfLine Move the cursor to the end of the line. MoveToStartOfBlock Move the cursor to the start of the block. MoveToEndOfBlock Move the cursor to the end of the block. MoveToStartOfDocument Move the cursor to the start of the document. MoveToEndOfDocument Move the cursor to the end of the document. SelectNextChar Select to the next character. SelectPreviousChar Select to the previous character. SelectNextWord Select to the next word. SelectPreviousWord Select to the previous word. SelectNextLine Select to the next line. SelectPreviousLine Select to the previous line. SelectStartOfLine Select to the start of the line. SelectEndOfLine Select to the end of the line. SelectStartOfBlock Select to the start of the block. SelectEndOfBlock Select to the end of the block. SelectStartOfDocument Select to the start of the document. SelectEndOfDocument Select to the end of the document. DeleteStartOfWord Delete to the start of the word. DeleteEndOfWord Delete to the end of the word. SetTextDirectionDefault Set the text direction to the default direction. SetTextDirectionLeftToRight Set the text direction to left-to-right. SetTextDirectionRightToLeft Set the text direction to right-to-left. ToggleBold Toggle the formatting between bold and normal weight. ToggleItalic Toggle the formatting between italic and normal style. ToggleUnderline Toggle underlining. InspectElement Show the Web Inspector with the currently highlighted HTML element. InsertParagraphSeparator Insert a new paragraph. InsertLineSeparator Insert a new line. SelectAll Selects all content. PasteAndMatchStyle Paste content from the clipboard with current style. RemoveFormat Removes formatting and style. ToggleStrikethrough Toggle the formatting between strikethrough and normal style. ToggleSubscript Toggle the formatting between subscript and baseline. ToggleSuperscript Toggle the formatting between supercript and baseline. InsertUnorderedList Toggles the selection between an ordered list and a normal block. InsertOrderedList Toggles the selection between an ordered list and a normal block. Indent Increases the indentation of the currently selected format block by one increment. Outdent Decreases the indentation of the currently selected format block by one increment. AlignCenter Applies center alignment to content. AlignJustified Applies full justification to content. AlignLeft Applies left justification to content. AlignRight Applies right justification to content.
WebActionCount
This enum describes the types of window that can be created by the createWindow() function.
WebBrowserWindow The window is a regular web browser window. WebModalDialog The window acts as modal dialog.
Enumerator | Value | Description |
---|---|---|
WebBrowserWindow | ||
WebModalDialog |
bool | contentEditable |
whether the content in this QWebPage is editable or not
See also: modified, contentsChanged(), WebAction
bool | forwardUnsupportedContent |
whether QWebPage should forward unsupported content
If enabled, the unsupportedContent() signal is emitted with a network reply that can be used to read the content.
If disabled, the download of such content is aborted immediately.
By default unsupported content is not forwarded.
LinkDelegationPolicy | linkDelegationPolicy |
how QWebPage should delegate the handling of links through the linkClicked() signal
The default is to delegate no links.
bool | modified |
whether the page contains unsubmitted form data, or the contents have been changed.
QPalette | palette |
the page's palette
The base brush of the palette is used to draw the background of the main frame.
By default, this property contains the application's default palette.
QSize | preferredContentsSize |
a custom size used for laying out the page contents.
If this property is set to a valid size, this size is used for all layout needs instead of the size of the viewport.
Setting an invalid size, makes the page fall back to using the viewport size for layout.
See also: viewportSize
QSize | viewportSize |
the size of the viewport
The size affects for example the visibility of scrollbars if the document is larger than the viewport.
By default, for a newly-created Web page, this property contains a size with zero width and height.
See also: QWebFrame::render(), preferredContentsSize
Q_DECLARE_FLAGS | ( | FindFlags | , |
FindFlag | |||
) | [inline] |
Q_ENUMS | ( | LinkDelegationPolicy NavigationType | WebAction | ) | [inline] |
bool | acceptNavigationRequest | ( | QWebFrame * | frame, |
const QNetworkRequest & | request, | |||
NavigationType | type | |||
) | [protected, virtual] |
QAction * | action | ( | WebAction | action | ) | const |
Returns a QAction for the specified WebAction action.
The action is owned by the QWebPage but you can customize the look by changing its properties.
QWebPage also takes care of implementing the action, so that upon triggering the corresponding action is performed on the page.
See also: triggerAction()
quint64 | bytesReceived | ( | ) | const |
Returns the number of bytes that were received from the network to render the current page.
See also: totalBytes(), loadProgress()
QString | chooseFile | ( | QWebFrame * | originatingFrame, |
const QString & | oldFile | |||
) | [protected, virtual] |
This function is called when the web content requests a file name, for example as a result of the user clicking on a "file upload" button in a HTML form.
A suggested filename may be provided in suggestedFile. The frame originating the request is provided as parentFrame.
See also: ChooseMultipleFilesExtension
void | contentsChanged | ( | ) | [signal] |
See also: contentEditable, modified, QWebFrame::toHtml(), QWebFrame::toPlainText()
QObject * | createPlugin | ( | const QString & | classid, |
const QUrl & | url, | |||
const QStringList & | paramNames, | |||
const QStringList & | paramValues | |||
) | [protected, virtual] |
This function is called whenever WebKit encounters a HTML object element with type "application/x-qt-plugin". It is called regardless of the value of QWebSettings::PluginsEnabled. The classid, url, paramNames and paramValues correspond to the HTML object element attributes and child elements to configure the embeddable object.
QMenu * | createStandardContextMenu | ( | ) |
QWebPage * | createWindow | ( | WebWindowType | type | ) | [protected, virtual] |
This function is called whenever WebKit wants to create a new window of the given type, for example when a JavaScript program requests to open a document in a new window.
If the new window can be created, the new window's QWebPage is returned; otherwise a null pointer is returned.
If the view associated with the web page is a QWebView object, then the default implementation forwards the request to QWebView's createWindow() function; otherwise it returns a null pointer.
If type is WebModalDialog, the application must call setWindowModality(Qt::ApplicationModal) on the new window.
In the cases when the window creation is being triggered by JavaScript, apart from reimplementing this method application must also set the JavaScriptCanOpenWindows attribute of QWebSettings to true in order for it to get called.
See also: acceptNavigationRequest(), QWebView::createWindow()
void | databaseQuotaExceeded | ( | QWebFrame * | frame, |
QString | databaseName | |||
) | [signal] |
See also: QWebDatabase
void | downloadRequested | ( | const QNetworkRequest & | request | ) | [signal] |
This signal is emitted when the user decides to download a link. The url of the link as well as additional meta-information is contained in request.
See also: unsupportedContent()
bool | event | ( | QEvent * | ) | [virtual] |
Reimplemented from QObject::event(QEvent *)
bool | extension | ( | Extension | extension, |
const ExtensionOption * | option = 0, | |||
ExtensionReturn * | output = 0 | |||
) | [virtual] |
This virtual function can be reimplemented in a QWebPage subclass to provide support for extensions. The option argument is provided as input to the extension; the output results can be stored in output.
The behavior of this function is determined by extension. The option and output values are typically casted to the corresponding types (for example, ChooseMultipleFilesExtensionOption and ChooseMultipleFilesExtensionReturn for ChooseMultipleFilesExtension).
You can call supportsExtension() to check if an extension is supported by the page.
Returns true if the extension was called successfully; otherwise returns false.
See also: supportsExtension(), Extension
void | featurePermissionRequestCanceled | ( | QWebFrame * | frame, |
QWebPage::Feature | feature | |||
) | [signal] |
void | featurePermissionRequested | ( | QWebFrame * | frame, |
QWebPage::Feature | feature | |||
) | [signal] |
bool | findText | ( | const QString & | subString, |
FindFlags | options = 0 | |||
) |
Finds the specified string, subString, in the page, using the given options.
If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences that exist in the page. All subsequent calls will extend the highlight, rather than replace it, with occurrences of the new string.
If the HighlightAllOccurrences flag is not passed, the function will select an occurrence and all subsequent calls will replace the current occurrence with the next one.
To clear the selection, just pass an empty string.
Returns true if subString was found; otherwise returns false.
bool | focusNextPrevChild | ( | bool | next | ) |
Similar to QWidget::focusNextPrevChild() it focuses the next focusable web element if next is true; otherwise the previous element is focused.
Returns true if it can find a new focusable element, or false if it can't.
bool | forwardUnsupportedContent | ( | ) | const |
QWebFrame * | frameAt | ( | const QPoint & | pos | ) | const |
See also: mainFrame(), currentFrame()
void | frameCreated | ( | QWebFrame * | frame | ) | [signal] |
void | geometryChangeRequested | ( | const QRect & | geom | ) | [signal] |
This signal is emitted whenever the document wants to change the position and size of the page to geom. This can happen for example through JavaScript.
QWebPagePrivate * | handle | ( | ) | const [inline] |
QWebHistory * | history | ( | ) | const |
Returns a pointer to the view's history of navigated web pages.
QVariant | inputMethodQuery | ( | Qt::InputMethodQuery | property | ) | const |
This method is used by the input method to query a set of properties of the page to be able to support complex input method operations as support for surrounding text and reconversions.
property specifies which property is queried.
See also: QWidget::inputMethodEvent(), QInputMethodEvent, QInputContext
bool | isContentEditable | ( | ) | const |
bool | isModified | ( | ) | const |
void | javaScriptAlert | ( | QWebFrame * | originatingFrame, |
const QString & | msg | |||
) | [protected, virtual] |
This function is called whenever a JavaScript program running inside frame calls the alert() function with the message msg.
The default implementation shows the message, msg, with QMessageBox::information.
bool | javaScriptConfirm | ( | QWebFrame * | originatingFrame, |
const QString & | msg | |||
) | [protected, virtual] |
This function is called whenever a JavaScript program running inside frame calls the confirm() function with the message, msg. Returns true if the user confirms the message; otherwise returns false.
The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons.
void | javaScriptConsoleMessage | ( | const QString & | message, |
int | lineNumber, | |||
const QString & | sourceID | |||
) | [protected, virtual] |
This function is called whenever a JavaScript program tries to print a message to the web browser's console.
For example in case of evaluation errors the source URL may be provided in sourceID as well as the lineNumber.
The default implementation prints nothing.
bool | javaScriptPrompt | ( | QWebFrame * | originatingFrame, |
const QString & | msg, | |||
const QString & | defaultValue, | |||
QString * | result | |||
) | [protected, virtual] |
This function is called whenever a JavaScript program running inside frame tries to prompt the user for input. The program may provide an optional message, msg, as well as a default value for the input in defaultValue.
If the prompt was cancelled by the user the implementation should return false; otherwise the result should be written to result and true should be returned. If the prompt was not cancelled by the user, the implementation should return true and the result string must not be null.
The default implementation uses QInputDialog::getText().
void | linkClicked | ( | const QUrl & | url | ) | [signal] |
This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy property is set to delegate the link handling for the specified url.
By default no links are delegated and are handled by QWebPage instead.
This signal possibly won't be emitted for clicked links which use JavaScript to trigger navigation.
See also: linkHovered()
LinkDelegationPolicy | linkDelegationPolicy | ( | ) | const |
void | linkHovered | ( | const QString & | link, |
const QString & | title, | |||
const QString & | textContent | |||
) | [signal] |
This signal is emitted when the mouse hovers over a link.
link contains the link url. title is the link element's title, if it is specified in the markup. textContent provides text within the link element, e.g., text inside an HTML anchor tag.
When the mouse leaves the link element the signal is emitted with empty parameters.
See also: linkClicked()
void | loadFinished | ( | bool | ok | ) | [signal] |
This signal is emitted when the page finishes loading content. This signal is independant of script execution or page rendering. ok will indicate whether the load was successful or any error occurred.
See also: loadStarted(), ErrorPageExtension
void | loadProgress | ( | int | progress | ) | [signal] |
This signal is emitted when the global progress status changes. The current value is provided by progress and scales from 0 to 100, which is the default range of QProgressBar. It accumulates changes from all the child frames.
See also: bytesReceived()
QWebFrame * | mainFrame | ( | ) | const |
Returns the main frame of the page.
The main frame provides access to the hierarchy of sub-frames and is also needed if you want to explicitly render a web page into a given painter.
See also: currentFrame()
void | menuBarVisibilityChangeRequested | ( | bool | visible | ) | [signal] |
This signal is emitted whenever the visibility of the menubar in a web browser window that hosts QWebPage should be changed to visible.
void | microFocusChanged | ( | ) | [signal] |
This signal is emitted when for example the position of the cursor in an editable form element changes. It is used to inform input methods about the new on-screen position where the user is able to enter text. This signal is usually connected to the QWidget::updateMicroFocus() slot.
QNetworkAccessManager * | networkAccessManager | ( | ) | const |
Returns the QNetworkAccessManager that is responsible for serving network requests for this QWebPage.
See also: setNetworkAccessManager()
QPalette | palette | ( | ) | const |
QWebPluginFactory * | pluginFactory | ( | ) | const |
Returns the QWebPluginFactory that is responsible for creating plugins embedded into this QWebPage. If no plugin factory is installed a null pointer is returned.
See also: setPluginFactory()
QSize | preferredContentsSize | ( | ) | const |
void | printRequested | ( | QWebFrame * | frame | ) | [signal] |
This signal is emitted whenever the page requests the web browser to print frame, for example through the JavaScript {window.print()} call.
See also: QWebFrame::print(), QPrintPreviewDialog
int | qWebKitMajorVersion | ( | ) |
See also: qWebKitVersion()
int | qWebKitMinorVersion | ( | ) |
See also: qWebKitVersion()
QString | qWebKitVersion | ( | ) |
The evolution of this version is bound to the releases of Apple's Safari browser. For a version specific to the QtWebKit library, see QTWEBKIT_VERSION
See also: QWebPage::userAgentForUrl()
void | repaintRequested | ( | const QRect & | dirtyRect | ) | [signal] |
This signal is emitted whenever this QWebPage should be updated and no view was set. dirtyRect contains the area that needs to be updated. To paint the QWebPage get the mainFrame() and call the render(QPainter*, const QRegion&) method with the dirtyRect as the second parameter.
See also: mainFrame() view()
void | restoreFrameStateRequested | ( | QWebFrame * | frame | ) | [signal] |
void | saveFrameStateRequested | ( | QWebFrame * | frame, |
QWebHistoryItem * | item | |||
) | [signal] |
The provided QWebHistoryItem, item, holds the history entry of the frame before the change.
A potential use-case for this signal is to store custom data in the QWebHistoryItem associated to the frame, using QWebHistoryItem::setUserData().
void | scrollRequested | ( | int | dx, |
int | dy, | |||
const QRect & | scrollViewRect | |||
) | [signal] |
This signal is emitted whenever the content given by rectToScroll needs to be scrolled dx and dy downwards and no view was set.
See also: view()
QString | selectedText | ( | ) | const |
void | selectionChanged | ( | ) | [signal] |
This signal is emitted whenever the selection changes, either interactively or programmatically (e.g. by calling triggerAction() with a selection action).
See also: selectedText()
void | setActualVisibleContentRect | ( | const QRect & | rect | ) | const |
void | setContentEditable | ( | bool | editable | ) |
void | setFeaturePermission | ( | QWebFrame * | frame, |
Feature | feature, | |||
PermissionPolicy | policy | |||
) |
void | setForwardUnsupportedContent | ( | bool | forward | ) |
void | setLinkDelegationPolicy | ( | LinkDelegationPolicy | policy | ) |
void | setNetworkAccessManager | ( | QNetworkAccessManager * | manager | ) |
Sets the QNetworkAccessManager manager responsible for serving network requests for this QWebPage.
It is currently not supported to change the network access manager after the QWebPage has used it. The results of doing this are undefined.
See also: networkAccessManager()
void | setPalette | ( | const QPalette & | palette | ) |
void | setPluginFactory | ( | QWebPluginFactory * | factory | ) |
Sets the QWebPluginFactory factory responsible for creating plugins embedded into this QWebPage.
Note: The plugin factory is only used if the QWebSettings::PluginsEnabled attribute is enabled.
See also: pluginFactory()
void | setPreferredContentsSize | ( | const QSize & | size | ) | const |
void | setViewportSize | ( | const QSize & | size | ) | const |
bool | shouldInterruptJavaScript | ( | ) | [slot] |
The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons.
Because of binary compatibility constraints, this function is not virtual. If you want to provide your own implementation in a QWebPage subclass, reimplement the shouldInterruptJavaScript() slot in your subclass instead. QtWebKit will dynamically detect the slot and call it.
void | statusBarMessage | ( | const QString & | text | ) | [signal] |
This signal is emitted when the statusbar text is changed by the page.
void | statusBarVisibilityChangeRequested | ( | bool | visible | ) | [signal] |
This signal is emitted whenever the visibility of the statusbar in a web browser window that hosts QWebPage should be changed to visible.
bool | supportsExtension | ( | Extension | extension | ) | const [virtual] |
This virtual function returns true if the web page supports extension; otherwise false is returned.
See also: extension()
bool | swallowContextMenuEvent | ( | QContextMenuEvent * | event | ) |
Filters the context menu event, event, through handlers for scrollbars and custom event handlers in the web page. Returns true if the event was handled; otherwise false.
A web page may swallow a context menu event through a custom event handler, allowing for context menus to be implemented in HTML/JavaScript. This is used by {http://maps.google.com/}{Google Maps}, for example.
void | toolBarVisibilityChangeRequested | ( | bool | visible | ) | [signal] |
This signal is emitted whenever the visibility of the toolbar in a web browser window that hosts QWebPage should be changed to visible.
quint64 | totalBytes | ( | ) | const |
Returns the total number of bytes that were received from the network to render the current page, including extra content such as embedded images.
See also: bytesReceived()
void | triggerAction | ( | WebAction | action, |
bool | checked = false | |||
) | [virtual] |
This function can be called to trigger the specified action. It is also called by QtWebKit if the user triggers the action, for example through a context menu item.
If action is a checkable action then checked specified whether the action is toggled or not.
See also: action()
void | unsupportedContent | ( | QNetworkReply * | reply | ) | [signal] |
This signal is emitted when WebKit cannot handle a link the user navigated to or a web server's response includes a "Content-Disposition" header with the 'attachment' directive. If "Content-Disposition" is present in reply, the web server is indicating that the client should prompt the user to save the content regardless of content-type. See RFC 2616 sections 19.5.1 for details about Content-Disposition.
At signal emission time the meta-data of the QNetworkReply reply is available.
This signal is only emitted if the forwardUnsupportedContent property is set to true.
See also: downloadRequested()
void | updatePositionDependentActions | ( | const QPoint & | pos | ) |
Updates the page's actions depending on the position pos. For example if pos is over an image element the CopyImageToClipboard action is enabled.
QString | userAgentForUrl | ( | const QUrl & | url | ) | const [protected, virtual] |
This function is called when a user agent for HTTP requests is needed. You can reimplement this function to dynamically return different user agents for different URLs, based on the url parameter.
The default implementation returns the following value:
"Mozilla/5.0 (%Platform%; %Security%; %Subplatform%; %Locale%) AppleWebKit/%WebKitVersion% (KHTML, like Gecko) %AppVersion Safari/%WebKitVersion%"
On mobile platforms such as Symbian S60 and Maemo, "Mobile Safari" is used instead of "Safari".
In this string the following values are replaced at run-time: Platform% and Subplatform% are expanded to the windowing system and the operation system. Security% expands to U if SSL is enabled, otherwise N. SSL is enabled if QSslSocket::supportsSsl() returns true. Locale% is replaced with QLocale::name(). The locale is determined from the view of the QWebPage. If no view is set on the QWebPage, then a default constructed QLocale is used instead. WebKitVersion% is the version of WebKit the application was compiled against. AppVersion% expands to QCoreApplication::applicationName()/QCoreApplication::applicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version.
ViewportAttributes | viewportAttributesForSize | ( | const QSize & | availableSize | ) | const |
Computes the optimal viewport configuration given the availableSize, when user interface components are disregarded.
The configuration is also dependent on the device screen size which is obtained automatically. For testing purposes the size can be overridden by setting two environment variables QTWEBKIT_DEVICE_WIDTH and QTWEBKIT_DEVICE_HEIGHT, which both needs to be set.
void | viewportChangeRequested | ( | ) | [signal] |
See also: QWebPage::ViewportAttributes, setPreferredContentsSize(), QGraphicsWebView::setScale()