#include <mw/QtWebKit/qwebview.h>
class QWebView : public QWidget, public QWidget |
The QWebView class provides a widget that is used to view and edit web documents.QtWebKit.
Public Properties | |
---|---|
QIcon | icon |
bool | modified |
QPainter::RenderHints | renderHints |
QString | selectedText |
qreal | textSizeMultiplier |
QString | title |
QUrl | url |
qreal | zoomFactor |
Public Member Functions | |
---|---|
virtual | ~QWebView() |
virtual bool | event(QEvent *) |
bool | findText(const QString &, QWebPage::FindFlags) |
QWebHistory * | history() |
QIcon | icon() |
virtual QVariant | inputMethodQuery(Qt::InputMethodQuery) |
bool | isModified() |
void | load(const QUrl &) |
void | load(const QNetworkRequest &, QNetworkAccessManager::Operation, const QByteArray &) |
QWebPage * | page() |
QAction * | pageAction(QWebPage::WebAction) |
QPainter::RenderHints | renderHints() |
QString | selectedText() |
void | setContent(const QByteArray &, const QString &, const QUrl &) |
void | setHtml(const QString &, const QUrl &) |
void | setPage(QWebPage *) |
void | setRenderHint(QPainter::RenderHint, bool) |
void | setRenderHints(QPainter::RenderHints) |
void | setTextSizeMultiplier(qreal) |
void | setUrl(const QUrl &) |
void | setZoomFactor(qreal) |
QWebSettings * | settings() |
virtual QSize | sizeHint() |
qreal | textSizeMultiplier() |
QString | title() |
void | triggerPageAction(QWebPage::WebAction, bool) |
QUrl | url() |
qreal | zoomFactor() |
Protected Member Functions | |
---|---|
virtual void | changeEvent(QEvent *) |
virtual void | contextMenuEvent(QContextMenuEvent *) |
virtual QWebView * | createWindow(QWebPage::WebWindowType) |
virtual void | dragEnterEvent(QDragEnterEvent *) |
virtual void | dragLeaveEvent(QDragLeaveEvent *) |
virtual void | dragMoveEvent(QDragMoveEvent *) |
virtual void | dropEvent(QDropEvent *) |
virtual void | focusInEvent(QFocusEvent *) |
virtual bool | focusNextPrevChild(bool) |
virtual void | focusOutEvent(QFocusEvent *) |
virtual void | inputMethodEvent(QInputMethodEvent *) |
virtual void | keyPressEvent(QKeyEvent *) |
virtual void | keyReleaseEvent(QKeyEvent *) |
virtual void | mouseDoubleClickEvent(QMouseEvent *) |
virtual void | mouseMoveEvent(QMouseEvent *) |
virtual void | mousePressEvent(QMouseEvent *) |
virtual void | mouseReleaseEvent(QMouseEvent *) |
virtual void | paintEvent(QPaintEvent *) |
virtual void | resizeEvent(QResizeEvent *) |
virtual void | wheelEvent(QWheelEvent *) |
Public Slots | |
---|---|
void | back() |
void | forward() |
void | print(QPrinter *) |
void | reload() |
void | stop() |
Public Signals | |
---|---|
void | iconChanged() |
void | linkClicked(const QUrl &) |
void | loadFinished(bool) |
void | loadProgress(int) |
void | loadStarted() |
void | selectionChanged() |
void | statusBarMessage(const QString &) |
void | titleChanged(const QString &) |
void | urlChanged(const QUrl &) |
Inherited Attributes | |
---|---|
QObject::d_ptr | |
QObject::objectName | |
QObject::staticQtMetaObject | |
QPaintDevice::painters |
Inherited Enumerations | |
---|---|
QPaintDevice:PaintDeviceMetric |
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() | |
QPaintDevice::QPaintDevice() | |
QPaintDevice::colorCount()const | |
QPaintDevice::depth()const | |
QPaintDevice::heightMM()const | |
QPaintDevice::logicalDpiX()const | |
QPaintDevice::logicalDpiY()const | |
QPaintDevice::paintingActive()const | |
QPaintDevice::physicalDpiX()const | |
QPaintDevice::physicalDpiY()const | |
QPaintDevice::widthMM()const | |
QPaintDevice::~QPaintDevice() | |
QWidget::QWidget(QWidgetPrivate &,QWidget *,Qt::WindowFlags) | |
QWidget::acceptDrops()const | |
QWidget::accessibleDescription()const | |
QWidget::accessibleName()const | |
QWidget::actionEvent(QActionEvent *) | |
QWidget::actions()const | |
QWidget::activateWindow() | |
QWidget::addAction(QAction *) | |
QWidget::addActions(QList< QAction * >) | |
QWidget::adjustSize() | |
QWidget::autoFillBackground()const | |
QWidget::backgroundRole()const | |
QWidget::baseSize()const | |
QWidget::childAt(const QPoint &)const | |
QWidget::childAt(int,int)const | |
QWidget::childrenRect()const | |
QWidget::childrenRegion()const | |
QWidget::clearFocus() | |
QWidget::clearMask() | |
QWidget::close | |
QWidget::closeEvent(QCloseEvent *) | |
QWidget::contentsMargins()const | |
QWidget::contentsRect()const | |
QWidget::contextMenuPolicy()const | |
QWidget::create(WId,bool,bool) | |
QWidget::cursor()const | |
QWidget::customContextMenuRequested | |
QWidget::destroy(bool,bool) | |
QWidget::enabledChange(bool) | |
QWidget::ensurePolished()const | |
QWidget::enterEvent(QEvent *) | |
QWidget::find(WId) | |
QWidget::focusNextChild() | |
QWidget::focusPolicy()const | |
QWidget::focusPreviousChild() | |
QWidget::focusProxy()const | |
QWidget::focusWidget()const | |
QWidget::font()const | |
QWidget::fontChange(const QFont &) | |
QWidget::fontInfo()const | |
QWidget::fontMetrics()const | |
QWidget::foregroundRole()const | |
QWidget::frameGeometry()const | |
QWidget::frameSize()const | |
QWidget::geometry()const | |
QWidget::getContentsMargins(int *,int *,int *,int *)const | |
QWidget::grabGesture(Qt::GestureType,Qt::GestureFlags) | |
QWidget::grabKeyboard() | |
QWidget::grabMouse() | |
QWidget::grabMouse(const QCursor &) | |
QWidget::grabShortcut(const QKeySequence &,Qt::ShortcutContext) | |
QWidget::graphicsEffect()const | |
QWidget::graphicsProxyWidget()const | |
QWidget::handle()const | |
QWidget::hasEditFocus()const | |
QWidget::hasFocus()const | |
QWidget::hasMouseTracking()const | |
QWidget::height()const | |
QWidget::heightForWidth(int)const | |
QWidget::hide | |
QWidget::hideEvent(QHideEvent *) | |
QWidget::inputContext() | |
QWidget::inputMethodHints()const | |
QWidget::insertAction(QAction *,QAction *) | |
QWidget::insertActions(QAction *,QList< QAction * >) | |
QWidget::isActiveWindow()const | |
QWidget::isAncestorOf(const QWidget *)const | |
QWidget::isFullScreen()const | |
QWidget::isHidden()const | |
QWidget::isLeftToRight()const | |
QWidget::isMaximized()const | |
QWidget::isMinimized()const | |
QWidget::isRightToLeft()const | |
QWidget::isVisible()const | |
QWidget::isVisibleTo(QWidget *)const | |
QWidget::isWindowModified()const | |
QWidget::keyboardGrabber() | |
QWidget::languageChange() | |
QWidget::layout()const | |
QWidget::layoutDirection()const | |
QWidget::leaveEvent(QEvent *) | |
QWidget::locale()const | |
QWidget::lower | |
QWidget::mapFrom(QWidget *,const QPoint &)const | |
QWidget::mapFromGlobal(const QPoint &)const | |
QWidget::mapFromParent(const QPoint &)const | |
QWidget::mapTo(QWidget *,const QPoint &)const | |
QWidget::mapToGlobal(const QPoint &)const | |
QWidget::mapToParent(const QPoint &)const | |
QWidget::mask()const | |
QWidget::maximumHeight()const | |
QWidget::maximumSize()const | |
QWidget::maximumWidth()const | |
QWidget::metric(PaintDeviceMetric)const | |
QWidget::minimumHeight()const | |
QWidget::minimumSize()const | |
QWidget::minimumSizeHint()const | |
QWidget::minimumWidth()const | |
QWidget::mouseGrabber() | |
QWidget::move(const QPoint &) | |
QWidget::move(int,int) | |
QWidget::moveEvent(QMoveEvent *) | |
QWidget::nativeParentWidget()const | |
QWidget::nextInFocusChain()const | |
QWidget::normalGeometry()const | |
QWidget::overrideWindowFlags(Qt::WindowFlags) | |
QWidget::overrideWindowState(Qt::WindowStates) | |
QWidget::paintEngine()const | |
QWidget::palette()const | |
QWidget::paletteChange(const QPalette &) | |
QWidget::parentWidget()const | |
QWidget::pos()const | |
QWidget::previousInFocusChain()const | |
QWidget::raise | |
QWidget::rect()const | |
QWidget::releaseKeyboard() | |
QWidget::releaseMouse() | |
QWidget::releaseShortcut(int) | |
QWidget::removeAction(QAction *) | |
QWidget::render(QPaintDevice *,const QPoint &,const QRegion &,RenderFlags) | |
QWidget::render(QPainter *,const QPoint &,const QRegion &,RenderFlags) | |
QWidget::repaint | |
QWidget::repaint(const QRect &) | |
QWidget::repaint(const QRegion &) | |
QWidget::repaint(int,int,int,int) | |
QWidget::resetInputContext() | |
QWidget::resize(const QSize &) | |
QWidget::resize(int,int) | |
QWidget::restoreGeometry(const QByteArray &) | |
QWidget::saveGeometry()const | |
QWidget::scroll(int,int) | |
QWidget::scroll(int,int,const QRect &) | |
QWidget::setAcceptDrops(bool) | |
QWidget::setAccessibleDescription(const QString &) | |
QWidget::setAccessibleName(const QString &) | |
QWidget::setAttribute(Qt::WidgetAttribute,bool) | |
QWidget::setAutoFillBackground(bool) | |
QWidget::setBackgroundRole(QPalette::ColorRole) | |
QWidget::setBaseSize(const QSize &) | |
QWidget::setBaseSize(int,int) | |
QWidget::setContentsMargins(const QMargins &) | |
QWidget::setContentsMargins(int,int,int,int) | |
QWidget::setContextMenuPolicy(Qt::ContextMenuPolicy) | |
QWidget::setCursor(const QCursor &) | |
QWidget::setDisabled | |
QWidget::setEditFocus(bool) | |
QWidget::setEnabled | |
QWidget::setFixedHeight(int) | |
QWidget::setFixedSize(const QSize &) | |
QWidget::setFixedSize(int,int) | |
QWidget::setFixedWidth(int) | |
QWidget::setFocus | |
QWidget::setFocus(Qt::FocusReason) | |
QWidget::setFocusPolicy(Qt::FocusPolicy) | |
QWidget::setFocusProxy(QWidget *) | |
QWidget::setFont(const QFont &) | |
QWidget::setForegroundRole(QPalette::ColorRole) | |
QWidget::setGeometry(const QRect &) | |
QWidget::setGeometry(int,int,int,int) | |
QWidget::setGraphicsEffect(QGraphicsEffect *) | |
QWidget::setHidden | |
QWidget::setInputContext(QInputContext *) | |
QWidget::setInputMethodHints(Qt::InputMethodHints) | |
QWidget::setLayout(QLayout *) | |
QWidget::setLayoutDirection(Qt::LayoutDirection) | |
QWidget::setLocale(const QLocale &) | |
QWidget::setMask(const QBitmap &) | |
QWidget::setMask(const QRegion &) | |
QWidget::setMaximumHeight(int) | |
QWidget::setMaximumSize(const QSize &) | |
QWidget::setMaximumSize(int,int) | |
QWidget::setMaximumWidth(int) | |
QWidget::setMinimumHeight(int) | |
QWidget::setMinimumSize(const QSize &) | |
QWidget::setMinimumSize(int,int) | |
QWidget::setMinimumWidth(int) | |
QWidget::setMouseTracking(bool) | |
QWidget::setPalette(const QPalette &) | |
QWidget::setParent(QWidget *) | |
QWidget::setParent(QWidget *,Qt::WindowFlags) | |
QWidget::setShortcutAutoRepeat(int,bool) | |
QWidget::setShortcutEnabled(int,bool) | |
QWidget::setShown | |
QWidget::setSizeIncrement(const QSize &) | |
QWidget::setSizeIncrement(int,int) | |
QWidget::setSizePolicy(QSizePolicy) | |
QWidget::setSizePolicy(QSizePolicy::Policy,QSizePolicy::Policy) | |
QWidget::setStatusTip(const QString &) | |
QWidget::setStyleSheet | |
QWidget::setTabOrder(QWidget *,QWidget *) | |
QWidget::setToolTip(const QString &) | |
QWidget::setUpdatesEnabled(bool) | |
QWidget::setVisible | |
QWidget::setWhatsThis(const QString &) | |
QWidget::setWindowFilePath(const QString &) | |
QWidget::setWindowFlags(Qt::WindowFlags) | |
QWidget::setWindowIcon(const QIcon &) | |
QWidget::setWindowIconText(const QString &) | |
QWidget::setWindowModified | |
QWidget::setWindowOpacity(qreal) | |
QWidget::setWindowRole(const QString &) | |
QWidget::setWindowState(Qt::WindowStates) | |
QWidget::setWindowSurface(QWindowSurface *) | |
QWidget::setWindowTitle | |
QWidget::show | |
QWidget::showEvent(QShowEvent *) | |
QWidget::showFullScreen | |
QWidget::showMaximized | |
QWidget::showMinimized | |
QWidget::showNormal | |
QWidget::size()const | |
QWidget::sizeIncrement()const | |
QWidget::sizePolicy()const | |
QWidget::stackUnder(QWidget *) | |
QWidget::statusTip()const | |
QWidget::styleChange(QStyle &) | |
QWidget::styleSheet()const | |
QWidget::tabletEvent(QTabletEvent *) | |
QWidget::testAttribute(Qt::WidgetAttribute)const | |
QWidget::toolTip()const | |
QWidget::topLevelWidget()const | |
QWidget::underMouse()const | |
QWidget::ungrabGesture(Qt::GestureType) | |
QWidget::unsetCursor() | |
QWidget::unsetLayoutDirection() | |
QWidget::unsetLocale() | |
QWidget::update | |
QWidget::update(const QRect &) | |
QWidget::update(const QRegion &) | |
QWidget::update(int,int,int,int) | |
QWidget::updateGeometry() | |
QWidget::updateMicroFocus | |
QWidget::updatesEnabled()const | |
QWidget::visibleRegion()const | |
QWidget::whatsThis()const | |
QWidget::width()const | |
QWidget::window()const | |
QWidget::windowActivationChange(bool) | |
QWidget::windowFilePath()const | |
QWidget::windowFlags()const | |
QWidget::windowIcon()const | |
QWidget::windowIconText()const | |
QWidget::windowOpacity()const | |
QWidget::windowRole()const | |
QWidget::windowState()const | |
QWidget::windowSurface()const | |
QWidget::windowTitle()const | |
QWidget::windowType()const | |
QWidget::x()const | |
QWidget::y()const |
A web site can be loaded onto QWebView with the load() function. Like all Qt widgets, the show() function must be invoked in order to display QWebView. The snippet below illustrates this:
Alternatively, setUrl() can also be used to load a web site. If you have the HTML content readily available, you can use setHtml() instead.
The loadStarted() signal is emitted when the view begins loading. The loadProgress() signal, on the other hand, is emitted whenever an element of the web view completes loading, such as an embedded image, a script, etc. Finally, the loadFinished() signal is emitted when the view has loaded completely. It's argument - either true or false - indicates load success or failure.
The page() function returns a pointer to the web page object. See {Elements of QWebView} for an explanation of how the web page is related to the view. To modify your web view's settings, you can access the QWebSettings object with the settings() function. With QWebSettings, you can change the default fonts, enable or disable features such as JavaScript and plugins.
The title of an HTML document can be accessed with the title() property. Additionally, a web site may also specify an icon, which can be accessed using the icon() property. If the title or the icon changes, the corresponding titleChanged() and iconChanged() signals will be emitted. The textSizeMultiplier() property can be used to change the overall size of the text displayed in the web view.
If you require a custom context menu, you can implement it by reimplementing {QWidget::}{contextMenuEvent()} and populating your QMenu with the actions obtained from pageAction(). More functionality such as reloading the view, copying selected text to the clipboard, or pasting into the view, is also encapsulated within the QAction objects returned by pageAction(). These actions can be programmatically triggered using triggerPageAction(). Alternatively, the actions can be added to a toolbar or a menu directly. QWebView maintains the state of the returned actions but allows modification of action properties such as {QAction::}{text} or {QAction::}{icon}.
A QWebView can be printed onto a QPrinter using the print() function. This function is marked as a slot and can be conveniently connected to {QPrintPreviewDialog}'s {QPrintPreviewDialog::}{paintRequested()} signal.
If you want to provide support for web sites that allow the user to open new windows, such as pop-up windows, you can subclass QWebView and reimplement the createWindow() function.
bool | modified |
whether the document was modified by the user
Parts of HTML documents can be editable for example through the {contenteditable} attribute on HTML elements.
By default, this property is false.
QPainter::RenderHints | renderHints |
the default render hints for the view
This property is not available on Symbian. However, the getter and setter functions can still be used directly.
See also: QPainter::renderHints()
See also: QPainter::renderHints()
qreal | textSizeMultiplier |
the scaling factor for all text in the frame
Use setZoomFactor instead, in combination with the ZoomTextOnly attribute in QWebSettings.
Setting this property also enables the ZoomTextOnly attribute in QWebSettings.
Returns the value of the multiplier used to scale the text in a Web page.
QUrl | url |
the url of the web page currently viewed
Setting this property clears the view and loads the URL.
By default, this property contains an empty, invalid URL.
See also: load(), urlChanged()
void | back | ( | ) | [slot] |
Convenience slot that loads the previous document in the list of documents built by navigating links. Does nothing if there is no previous document.
It is equivalent to
See also: forward(), pageAction()
void | changeEvent | ( | QEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::changeEvent(QEvent *)
void | contextMenuEvent | ( | QContextMenuEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::contextMenuEvent(QContextMenuEvent *)
QWebView * | createWindow | ( | QWebPage::WebWindowType | type | ) | [protected, virtual] |
This function is called from the createWindow() method of the associated QWebPage, each time the page wants to create a new window of the given type. This might be the result, for example, of a JavaScript request to open a document in a new window.
If the createWindow() method of the associated page is reimplemented, this method is not called, unless explicitly done so in the reimplementation.
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: QWebPage::createWindow(), QWebPage::acceptNavigationRequest()
void | dragEnterEvent | ( | QDragEnterEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::dragEnterEvent(QDragEnterEvent *)
void | dragLeaveEvent | ( | QDragLeaveEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::dragLeaveEvent(QDragLeaveEvent *)
void | dragMoveEvent | ( | QDragMoveEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::dragMoveEvent(QDragMoveEvent *)
void | dropEvent | ( | QDropEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::dropEvent(QDropEvent *)
bool | event | ( | QEvent * | ) | [virtual] |
Reimplemented from QWidget::event(QEvent *)
bool | findText | ( | const QString & | subString, |
QWebPage::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.
See also: selectedText(), selectionChanged()
void | focusInEvent | ( | QFocusEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::focusInEvent(QFocusEvent *)
bool | focusNextPrevChild | ( | bool | next | ) | [protected, virtual] |
Reimplemented from QWidget::focusNextPrevChild(bool)
void | focusOutEvent | ( | QFocusEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::focusOutEvent(QFocusEvent *)
void | forward | ( | ) | [slot] |
Convenience slot that loads the next document in the list of documents built by navigating links. Does nothing if there is no next document.
It is equivalent to
See also: back(), pageAction()
QWebHistory * | history | ( | ) | const |
Returns a pointer to the view's history of navigated web pages.
It is equivalent to
QIcon | icon | ( | ) | const |
void | iconChanged | ( | ) | [signal] |
This signal is emitted whenever the icon of the page is loaded or changes.
In order for icons to be loaded, you will need to set an icon database path using QWebSettings::setIconDatabasePath().
See also: icon(), QWebSettings::setIconDatabasePath()
void | inputMethodEvent | ( | QInputMethodEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::inputMethodEvent(QInputMethodEvent *)
QVariant | inputMethodQuery | ( | Qt::InputMethodQuery | property | ) | const [virtual] |
Reimplemented from QWidget::inputMethodQuery(Qt::InputMethodQuery)const
bool | isModified | ( | ) | const |
void | keyPressEvent | ( | QKeyEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::keyPressEvent(QKeyEvent *)
void | keyReleaseEvent | ( | QKeyEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::keyReleaseEvent(QKeyEvent *)
void | linkClicked | ( | const QUrl & | ) | [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.
See also: QWebPage::linkDelegationPolicy()
void | load | ( | const QUrl & | url | ) |
Loads the specified url and displays it.
The view remains the same until enough data has arrived to display the new url.
See also: setUrl(), url(), urlChanged(), QUrl::fromUserInput()
void | load | ( | const QNetworkRequest & | request, |
QNetworkAccessManager::Operation | operation = QNetworkAccessManager::GetOperation, | |||
const QByteArray & | body = QByteArray() | |||
) |
Loads a network request, request, using the method specified in operation.
body is optional and is only used for POST operations.
The view remains the same until enough data has arrived to display the new url.
See also: url(), urlChanged()
void | loadFinished | ( | bool | ) | [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.
See also: loadStarted()
void | loadProgress | ( | int | progress | ) | [signal] |
This signal is emitted every time an element in the web page completes loading and the overall loading progress advances.
This signal tracks the progress of all child frames.
The current value is provided by progress and scales from 0 to 100, which is the default range of QProgressBar.
See also: loadStarted(), loadFinished()
void | loadStarted | ( | ) | [signal] |
This signal is emitted when a new load of the page is started.
See also: loadProgress(), loadFinished()
void | mouseDoubleClickEvent | ( | QMouseEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::mouseDoubleClickEvent(QMouseEvent *)
void | mouseMoveEvent | ( | QMouseEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::mouseMoveEvent(QMouseEvent *)
void | mousePressEvent | ( | QMouseEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::mousePressEvent(QMouseEvent *)
void | mouseReleaseEvent | ( | QMouseEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::mouseReleaseEvent(QMouseEvent *)
QAction * | pageAction | ( | QWebPage::WebAction | action | ) | const |
Returns a pointer to a QAction that encapsulates the specified web action action.
void | paintEvent | ( | QPaintEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::paintEvent(QPaintEvent *)
void | ( | QPrinter * | ) | const [slot] |
QPainter::RenderHints | renderHints | ( | ) | const |
void | resizeEvent | ( | QResizeEvent * | ) | [protected, virtual] |
Reimplemented from QWidget::resizeEvent(QResizeEvent *)
QString | selectedText | ( | ) | const |
void | setContent | ( | const QByteArray & | data, |
const QString & | mimeType = QString(), | |||
const QUrl & | baseUrl = QUrl() | |||
) |
Sets the content of the web view to the specified content data. If the mimeType argument is empty it is currently assumed that the content is HTML but in future versions we may introduce auto-detection.
External objects referenced in the content are located relative to baseUrl.
The data is loaded immediately; external objects are loaded asynchronously.
See also: load(), setHtml(), QWebFrame::toHtml()
void | setHtml | ( | const QString & | html, |
const QUrl & | baseUrl = QUrl() | |||
) |
Sets the content of the web view to the specified html.
External objects such as stylesheets or images referenced in the HTML document are located relative to baseUrl.
The html is loaded immediately; external objects are loaded asynchronously.
When using this method, WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified through the charset attribute of the HTML script tag. Alternatively, the encoding can also be specified by the web server.
This is a convenience function equivalent to setContent(html, "text/html", baseUrl).
This function works only for HTML, for other mime types (i.e. XHTML, SVG) setContent() should be used instead.
See also: load(), setContent(), QWebFrame::toHtml(), QWebFrame::setContent()
void | setPage | ( | QWebPage * | page | ) |
Makes page the new web page of the web view.
The parent QObject of the provided page remains the owner of the object. If the current document is a child of the web view, it will be deleted.
See also: page()
void | setRenderHint | ( | QPainter::RenderHint | hint, |
bool | enabled = true | |||
) |
See also: renderHints, QPainter::renderHints()
void | setRenderHints | ( | QPainter::RenderHints | hints | ) |
See also: QPainter::setRenderHints()
void | setTextSizeMultiplier | ( | qreal | factor | ) |
Sets the value of the multiplier used to scale the text in a Web page to the factor specified.
void | setUrl | ( | const QUrl & | url | ) |
void | setZoomFactor | ( | qreal | factor | ) |
QWebSettings * | settings | ( | ) | const |
Returns a pointer to the view/page specific settings object.
It is equivalent to
See also: QWebSettings::globalSettings()
QSize | sizeHint | ( | ) | const [virtual] |
Reimplemented from QWidget::sizeHint()const
void | statusBarMessage | ( | const QString & | text | ) | [signal] |
This signal is emitted when the status bar text is changed by the page.
void | stop | ( | ) | [slot] |
Convenience slot that stops loading the document.
It is equivalent to
See also: reload(), pageAction(), loadFinished()
qreal | textSizeMultiplier | ( | ) | const |
QString | title | ( | ) | const |
void | titleChanged | ( | const QString & | title | ) | [signal] |
void | triggerPageAction | ( | QWebPage::WebAction | action, |
bool | checked = false | |||
) |
Triggers the specified action. If it is a checkable action the specified checked state is assumed.
The following example triggers the copy action and therefore copies any selected text to the clipboard.
See also: pageAction()