The QWebPage class provides an object to view and edit web documents. More...
#include <qwebpage.h>

The QWebPage class provides an object to view and edit web documents.
QWebPage holds a main frame responsible for web content, settings, the history of navigated links and actions. This class can be used, together with QWebFrame, to provide functionality like QWebView in a widget-less environment.
QWebPage's API is very similar to QWebView, as you are still provided with common functions like action() (known as {QWebView::}{pageAction()} in QWebView), triggerAction(), findText() and settings(). More QWebView-like functions can be found in the main frame of QWebPage, obtained via QWebPage::mainFrame(). For example, the load(), setUrl() and setHtml() unctions 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 has loaded completely. Its argument, either true or false, indicates whether or not the load operation succeeded.
Definition at line 64 of file qwebpage.h.
| enum QWebPage::Extension |
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 (introduced in Qt 4.6)
Definition at line 257 of file qwebpage.h.
| enum QWebPage::FindFlag |
This enum describes the options available to QWebPage's 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.
Definition at line 174 of file qwebpage.h.
This enum defines the delegation policies a webpage can have when activating links and emitting the linkClicked() signal.
DontDelegateLinks No links are delegated. Instead, QWebPage tries to handle them all. DelegateExternalLinks When activating links that point to documents not stored on the local filesystem or an equivalent - such as the Qt resource system - then linkClicked() is emitted. DelegateAllLinks Whenever a link is activated the linkClicked() signal is emitted.
Definition at line 182 of file qwebpage.h.
This enum describes the types of navigation available when browsing through hyperlinked documents.
NavigationTypeLinkClicked The user clicked on a link or pressed return on a focused link. NavigationTypeFormSubmitted The user activated a submit button for an HTML form. NavigationTypeBackOrForward Navigation to a previously shown document in the back or forward history is requested. NavigationTypeReload The user activated the reload action. NavigationTypeFormResubmitted An HTML form was submitted a second time. NavigationTypeOther A navigation to another document using a method not listed above.
| NavigationTypeLinkClicked | |
| NavigationTypeFormSubmitted | |
| NavigationTypeBackOrForward | |
| NavigationTypeReload | |
| NavigationTypeFormResubmitted | |
| NavigationTypeOther |
Definition at line 77 of file qwebpage.h.
| enum QWebPage::WebAction |
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 {QWebPage::}{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. 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
Definition at line 86 of file qwebpage.h.
WebBrowserWindow The window is a regular web browser window. WebModalDialog The window acts as modal dialog.
Definition at line 188 of file qwebpage.h.
| QWebPage::QWebPage | ( | QObject * | parent = 0 |
) | [explicit] |
Constructs an empty QWebPage with parent parent.
Definition at line 1955 of file qwebpage.cpp.
References loadProgress(), and setView().

| QWebPage::~QWebPage | ( | ) |
Destroys the web page.
Definition at line 1970 of file qwebpage.cpp.
References QWebPagePrivate::createMainFrame(), d, QWebPagePrivate::inspector, QWebPagePrivate::inspectorIsInternalOnly, QWebPagePrivate::mainFrame, and QWebPagePrivate::setInspector().

| bool QWebPage::acceptNavigationRequest | ( | QWebFrame * | frame, | |
| const QNetworkRequest & | request, | |||
| QWebPage::NavigationType | type | |||
| ) | [protected, virtual] |
This function is called whenever WebKit requests to navigate frame to the resource specified by request by means of the specified navigation type type.
If frame is a null pointer then navigation to a new window is requested. If the request is accepted createWindow() will be called.
The default implementation interprets the page's linkDelegationPolicy and emits linkClicked accordingly or returns true to let QWebPage handle the navigation itself.
Definition at line 2409 of file qwebpage.cpp.
References d, DelegateAllLinks, DelegateExternalLinks, DontDelegateLinks, linkClicked(), QWebPagePrivate::linkPolicy, and NavigationTypeLinkClicked.

| QAction * QWebPage::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.
Definition at line 2456 of file qwebpage.cpp.
References QWebPagePrivate::actions, AlignCenter, AlignJustified, AlignLeft, AlignRight, Back, Copy, CopyImageToClipboard, CopyLinkToClipboard, Cut, d, DeleteEndOfWord, DeleteStartOfWord, DownloadImageToDisk, DownloadLinkToDisk, Forward, Indent, InsertLineSeparator, InsertOrderedList, InsertParagraphSeparator, InsertUnorderedList, InspectElement, MoveToEndOfBlock, MoveToEndOfDocument, MoveToEndOfLine, MoveToNextChar, MoveToNextLine, MoveToNextWord, MoveToPreviousChar, MoveToPreviousLine, MoveToPreviousWord, MoveToStartOfBlock, MoveToStartOfDocument, MoveToStartOfLine, NoWebAction, OpenFrameInNewWindow, OpenImageInNewWindow, OpenLink, OpenLinkInNewWindow, Outdent, Paste, PasteAndMatchStyle, QWebPagePrivate::q, Redo, Reload, RemoveFormat, SelectAll, SelectEndOfBlock, SelectEndOfDocument, SelectEndOfLine, SelectNextChar, SelectNextLine, SelectNextWord, SelectPreviousChar, SelectPreviousLine, SelectPreviousWord, SelectStartOfBlock, SelectStartOfDocument, SelectStartOfLine, SetTextDirectionDefault, SetTextDirectionLeftToRight, SetTextDirectionRightToLeft, Stop, ToggleBold, ToggleItalic, ToggleStrikethrough, ToggleSubscript, ToggleSuperscript, ToggleUnderline, Undo, undoStack(), QWebPagePrivate::updateAction(), and view().

| quint64 QWebPage::bytesReceived | ( | ) | const |
Returns the number of bytes that were received from the network to render the current page.
Definition at line 3576 of file qwebpage.cpp.
References d, and QWebPagePrivate::m_bytesReceived.
| QString QWebPage::chooseFile | ( | QWebFrame * | parentFrame, | |
| const QString & | suggestedFile | |||
| ) | [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.
Definition at line 3239 of file qwebpage.cpp.
References view().

| void QWebPage::contentsChanged | ( | ) | [signal] |
This signal is emitted whenever the text in form elements changes as well as other editable content.
| QObject * QWebPage::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". The classid, url, paramNames and paramValues correspond to the HTML object element attributes and child elements to configure the embeddable object.
Definition at line 2194 of file qwebpage.cpp.
| QMenu * QWebPage::createStandardContextMenu | ( | ) |
Definition at line 965 of file qwebpage.cpp.
References QWebPagePrivate::currentContextMenu, and d.
| QWebPage * 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.
Definition at line 2178 of file qwebpage.cpp.
References QWebView::createWindow(), QWebView::page(), and view().

| QWebFrame * QWebPage::currentFrame | ( | ) | const |
Returns the frame currently active.
Definition at line 2006 of file qwebpage.cpp.
References QWebPagePrivate::createMainFrame(), d, QWebPagePrivate::page, and WebCore::FrameLoaderClientQt.

| void QWebPage::databaseQuotaExceeded | ( | QWebFrame * | frame, | |
| QString | databaseName | |||
| ) | [signal] |
This signal is emitted whenever the web site shown in frame is asking to store data to the database databaseName and the quota allocated to that web site is exceeded.
| void QWebPage::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.
| bool QWebPage::event | ( | QEvent * | ev | ) | [virtual] |
Definition at line 2750 of file qwebpage.cpp.
References QWebPagePrivate::contextMenuEvent(), d, QWebPagePrivate::dragEnterEvent(), QWebPagePrivate::dragLeaveEvent(), QWebPagePrivate::dragMoveEvent(), QWebPagePrivate::dropEvent(), QWebPagePrivate::focusInEvent(), QWebPagePrivate::focusOutEvent(), QWebPagePrivate::inputMethodEvent(), QWebPagePrivate::keyPressEvent(), QWebPagePrivate::keyReleaseEvent(), QWebPagePrivate::leaveEvent(), QWebPagePrivate::mouseDoubleClickEvent(), QWebPagePrivate::mouseMoveEvent(), QWebPagePrivate::mousePressEvent(), QWebPagePrivate::mouseReleaseEvent(), QWebPagePrivate::shortcutOverrideEvent(), QWebPagePrivate::timerEvent(), QWebPagePrivate::touchEvent(), and QWebPagePrivate::wheelEvent().

| bool QWebPage::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.
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.
Definition at line 3155 of file qwebpage.cpp.
References ChooseMultipleFilesExtension, and view().

| bool QWebPage::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.
Definition at line 3199 of file qwebpage.cpp.
References d, FindBackward, FindCaseSensitively, FindWrapsAroundDocument, HighlightAllOccurrences, and QWebPagePrivate::page.
| bool QWebPage::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.
Definition at line 2862 of file qwebpage.cpp.
References d, QWebPagePrivate::keyPressEvent(), and QWebPagePrivate::page.

| bool QWebPage::forwardUnsupportedContent | ( | ) | const |
| QWebFrame * QWebPage::frameAt | ( | const QPoint & | pos | ) | const |
Returns the frame at the given point pos.
Definition at line 2020 of file qwebpage.cpp.
References QWebHitTestResult::frame(), QWebFrame::geometry(), QWebFrame::hitTestContent(), and mainFrame().

| void QWebPage::frameCreated | ( | QWebFrame * | frame | ) | [signal] |
This signal is emitted whenever the page creates a new frame.
| void QWebPage::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 * QWebPage::handle | ( | ) | const [inline] |
Definition at line 300 of file qwebpage.h.
| QWebHistory * QWebPage::history | ( | ) | const |
Returns a pointer to the view's history of navigated web pages.
Definition at line 2032 of file qwebpage.cpp.
References QWebPagePrivate::createMainFrame(), d, and QWebPagePrivate::history.

| QVariant QWebPage::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.
Definition at line 1618 of file qwebpage.cpp.
References d, QWebPagePrivate::page, and view().

| bool QWebPage::isContentEditable | ( | ) | const |
Definition at line 2904 of file qwebpage.cpp.
References d, and QWebPagePrivate::editable.
| bool QWebPage::isModified | ( | ) | const |
Definition at line 2724 of file qwebpage.cpp.
References d, and QWebPagePrivate::undoStack.
| void QWebPage::javaScriptAlert | ( | QWebFrame * | frame, | |
| 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.
Definition at line 2099 of file qwebpage.cpp.
References mainFrame(), and view().

| bool QWebPage::javaScriptConfirm | ( | QWebFrame * | frame, | |
| 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.
Definition at line 2113 of file qwebpage.cpp.
References mainFrame(), and view().

| void QWebPage::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.
Definition at line 2086 of file qwebpage.cpp.
| bool QWebPage::javaScriptPrompt | ( | QWebFrame * | frame, | |
| 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.
Definition at line 2133 of file qwebpage.cpp.
References mainFrame(), and view().

| void QWebPage::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.
| LinkDelegationPolicy QWebPage::linkDelegationPolicy | ( | ) | const |
| void QWebPage::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.
| void QWebPage::loadFinished | ( | bool | ok | ) | [signal] |
This signal is emitted when a load of the page is finished. ok will indicate whether the load was successful or any error occurred.
| void QWebPage::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.
| void QWebPage::loadStarted | ( | ) | [signal] |
This signal is emitted when a new load of the page is started.
| QWebFrame * QWebPage::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.
Definition at line 1995 of file qwebpage.cpp.
References QWebPagePrivate::createMainFrame(), d, and QWebPagePrivate::mainFrame.

| void QWebPage::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 QWebPage::microFocusChanged | ( | ) | [signal] |
This signal is emitted when for example the position of the cursor in an editable form element changes. It is used inform input methods about the new on-screen position where the user is able to enter text. This signal is usually connected to QWidget's updateMicroFocus() slot.
| QNetworkAccessManager * QWebPage::networkAccessManager | ( | ) | const |
Returns the QNetworkAccessManager that is responsible for serving network requests for this QWebPage.
Definition at line 3273 of file qwebpage.cpp.
References d, and QWebPagePrivate::networkManager.
| QPalette QWebPage::palette | ( | ) | const |
| QWebPluginFactory * QWebPage::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.
Definition at line 3301 of file qwebpage.cpp.
References d, and QWebPagePrivate::pluginFactory.
| QSize QWebPage::preferredContentsSize | ( | ) | const |
| void QWebPage::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.
| void QWebPage::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.
| void QWebPage::restoreFrameStateRequested | ( | QWebFrame * | frame | ) | [signal] |
This signal is emitted when the load of frame is finished and the application may now update its state accordingly.
| void QWebPage::saveFrameStateRequested | ( | QWebFrame * | frame, | |
| QWebHistoryItem * | item | |||
| ) | [signal] |
This signal is emitted shortly before the history of navigated pages in frame is changed, for example when navigating back in the history.
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 QWebPage::scrollRequested | ( | int | dx, | |
| int | dy, | |||
| const QRect & | rectToScroll | |||
| ) | [signal] |
This signal is emitted whenever the content given by rectToScroll needs to be scrolled dx and dy downwards and no view was set.
| QString QWebPage::selectedText | ( | ) | const |
| void QWebPage::selectionChanged | ( | ) | [signal] |
This signal is emitted whenever the selection changes.
| void QWebPage::setContentEditable | ( | bool | editable | ) |
Definition at line 2885 of file qwebpage.cpp.
References d, QWebPagePrivate::editable, QWebPagePrivate::mainFrame, QWebPagePrivate::page, and QWebPagePrivate::updateEditorActions().

| void QWebPage::setForwardUnsupportedContent | ( | bool | forward | ) |
Definition at line 2921 of file qwebpage.cpp.
References d, and QWebPagePrivate::forwardUnsupportedContent.
| void QWebPage::setLinkDelegationPolicy | ( | LinkDelegationPolicy | policy | ) |
Definition at line 2939 of file qwebpage.cpp.
References d, and QWebPagePrivate::linkPolicy.
| void QWebPage::setNetworkAccessManager | ( | QNetworkAccessManager * | manager | ) |
Sets the QNetworkAccessManager manager responsible for serving network requests for this QWebPage.
Definition at line 3258 of file qwebpage.cpp.
References d, and QWebPagePrivate::networkManager.
| void QWebPage::setPalette | ( | const QPalette & | palette | ) |
Definition at line 1276 of file qwebpage.cpp.
References d, QWebPagePrivate::mainFrame, and QWebPagePrivate::palette.
| void QWebPage::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.
Definition at line 3290 of file qwebpage.cpp.
References d, and QWebPagePrivate::pluginFactory.
| void QWebPage::setPreferredContentsSize | ( | const QSize & | size | ) | const |
Definition at line 2376 of file qwebpage.cpp.
References QWebFrame::d, d, QWebPagePrivate::fixedLayoutSize, and mainFrame().

| QWebSettings * QWebPage::settings | ( | ) | const |
Returns a pointer to the page's settings object.
Definition at line 3227 of file qwebpage.cpp.
References d, and QWebPagePrivate::settings.
| void QWebPage::setView | ( | QWidget * | view | ) |
Sets the view that is associated with the web page.
Definition at line 2043 of file qwebpage.cpp.
References QWebPagePrivate::client, d, QWebPagePrivate::PageScrollMoveThreshold, setViewportSize(), QWebPagePrivate::view, and view().

| void QWebPage::setViewportSize | ( | const QSize & | size | ) | const |
Definition at line 2342 of file qwebpage.cpp.
References QWebFrame::d, d, mainFrame(), view(), and QWebPagePrivate::viewportSize.

| bool QWebPage::shouldInterruptJavaScript | ( | ) | [slot] |
If the user wanted to stop the JavaScript the implementation should return true; otherwise false.
The default implementation executes the query using QMessageBox::information with QMessageBox::Yes and QMessageBox::No buttons.
Definition at line 2158 of file qwebpage.cpp.
References mainFrame(), and view().

| void QWebPage::statusBarMessage | ( | const QString & | text | ) | [signal] |
This signal is emitted when the statusbar text is changed by the page.
| void QWebPage::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 QWebPage::supportsExtension | ( | Extension | extension | ) | const [virtual] |
This virtual function returns true if the web page supports extension; otherwise false is returned.
Definition at line 3175 of file qwebpage.cpp.
References ChooseMultipleFilesExtension.
| bool QWebPage::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.
Definition at line 2959 of file qwebpage.cpp.
References d, frameAt(), and QWebPagePrivate::page.

| void QWebPage::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 QWebPage::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.
Definition at line 3565 of file qwebpage.cpp.
References d, and QWebPagePrivate::m_totalBytes.
| void QWebPage::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.
Definition at line 2229 of file qwebpage.cpp.
References Back, CopyImageToClipboard, CopyLinkToClipboard, QWebHitTestResult::d, QWebFrame::d, d, DownloadImageToDisk, DownloadLinkToDisk, QWebPagePrivate::editorCommandForWebActions(), Forward, frameLoadRequest(), QWebPagePrivate::getOrCreateInspector(), QWebPagePrivate::hitTestResult, QWebHitTestResult::imageUrl(), InspectElement, QWebPagePrivate::inspector, QWebHitTestResult::isNull(), QWebHitTestResult::linkTargetFrame(), QWebHitTestResult::linkText(), QWebHitTestResult::linkUrl(), mainFrame(), OpenFrameInNewWindow, OpenImageInNewWindow, OpenLink, OpenLinkInNewWindow, openNewWindow(), QWebPagePrivate::page, QWebHitTestResult::pixmap(), Reload, ReloadAndBypassCache, SetTextDirectionDefault, SetTextDirectionLeftToRight, SetTextDirectionRightToLeft, and Stop.

| QUndoStack * QWebPage::undoStack | ( | ) | const |
Returns a pointer to the undo stack used for editable content.
Definition at line 2739 of file qwebpage.cpp.
References d, and QWebPagePrivate::undoStack.
| void QWebPage::unsupportedContent | ( | QNetworkReply * | reply | ) | [signal] |
This signal is emitted when WebKit cannot handle a link the user navigated to.
At signal emission time the meta-data of the QNetworkReply reply is available.
| void QWebPage::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.
Definition at line 2984 of file qwebpage.cpp.
References action(), QWebPagePrivate::createContextMenu(), QWebPagePrivate::createMainFrame(), QWebPagePrivate::currentContextMenu, d, QWebPagePrivate::hitTestResult, QWebPagePrivate::page, WebCore::HitTestResult::scrollbar(), WebActionCount, and webActionForContextMenuAction().

| QString QWebPage::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%"
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()/QCoreApplicationapplicationVersion() if they're set; otherwise defaulting to Qt and the current Qt version.
Definition at line 3324 of file qwebpage.cpp.
References view().

| QWidget * QWebPage::view | ( | ) | const |
Returns the view widget that is associated with the web page.
Definition at line 2070 of file qwebpage.cpp.
References d, and QWebPagePrivate::view.
| QSize QWebPage::viewportSize | ( | ) | const |
| void QWebPage::windowCloseRequested | ( | ) | [signal] |
This signal is emitted whenever the page requests the web browser window to be closed, for example through the JavaScript {window.close()} call.
friend class QGraphicsWebView [friend] |
Definition at line 361 of file qwebpage.h.
friend class QWebFrame [friend] |
Definition at line 358 of file qwebpage.h.
friend class QWebInspector [friend] |
Definition at line 362 of file qwebpage.h.
friend class QWebPagePrivate [friend] |
Definition at line 359 of file qwebpage.h.
friend class QWebView [friend] |
Definition at line 360 of file qwebpage.h.
friend class WebCore::ChromeClientQt [friend] |
Definition at line 363 of file qwebpage.h.
friend class WebCore::EditorClientQt [friend] |
Definition at line 364 of file qwebpage.h.
friend class WebCore::FrameLoaderClientQt [friend] |
Definition at line 365 of file qwebpage.h.
friend class WebCore::InspectorClientQt [friend] |
Definition at line 366 of file qwebpage.h.
friend class WebCore::QNetworkReplyHandler [friend] |
Definition at line 368 of file qwebpage.h.
friend class WebCore::ResourceHandle [friend] |
Definition at line 367 of file qwebpage.h.
QWebPagePrivate* QWebPage::d [private] |
Definition at line 356 of file qwebpage.h.
QWebPage::contentEditable [read, write] |
whether the content in this QWebPage is editable or not
If this property is enabled the contents of the page can be edited by the user through a visible cursor. If disabled (the default) only HTML elements in the web page with their {contenteditable} attribute set are editable.
Definition at line 74 of file qwebpage.h.
bool QWebPage::forwardUnsupportedContent [read, write] |
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.
Definition at line 71 of file qwebpage.h.
QWebPage::LinkDelegationPolicy QWebPage::linkDelegationPolicy [read, write] |
how QWebPage should delegate the handling of links through the linkClicked() signal
The default is to delegate no links.
Definition at line 72 of file qwebpage.h.
QWebPage::modified [read] |
whether the page contains unsubmitted form data
By default, this property is false.
Definition at line 67 of file qwebpage.h.
QPalette QWebPage::palette [read, write] |
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.
Definition at line 73 of file qwebpage.h.
QWebPage::preferredContentsSize [read, write] |
the size of the fixed layout
Definition at line 70 of file qwebpage.h.
QString QWebPage::selectedText [read] |
the text currently selected
By default, this property contains an empty string.
Definition at line 68 of file qwebpage.h.
QWebPage::viewportSize [read, write] |
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.
Definition at line 69 of file qwebpage.h.
1.6.2-20100208