Open Web Page in QWebView

From Qt Wiki
Revision as of 16:14, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

English Български

Open Web Page in QWebView

The following tutorial shows how to load a web page using QUrl [doc.qt.nokia.com] in QWebView [doc.qt.nokia.com] . QWebView is a widget provided by WebKit in Qt [doc.qt.nokia.com] that is used to view and edit web documents.

  • Specify that you want to link against the QtWebkit module by adding this line to your qmake .pro file:
  • Include required headers
  • Create instance of QWebView

Additionally QWebView style can be customized using setStyleSheet().

  • Load a web page

Example

This example has been built with Qt SDK 1.1 and tested on Symbian^3 devices.

mainwindow.h

mainwindow.cpp

main.cpp

Troubleshooting

  • QWebView: No such file or directory

Make sure you have added webkit to the .pro file of the project.

See also

Embed YouTube Video in QWebView [developer.qt.nokia.com]
Extending QtWebKit [developer.qt.nokia.com]

Categories: