How to use QWebView in Qt for Symbian

How to use QWebView in Qt for Symbian


How to use QWebView in Qt for Symbian

From Forum Nokia Wiki

Reviewer Approved   



ID ... Creation date 11 March 2009
Platform S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition Tested on devices S60 Emulator
Category Qt Subcategory Application


Keywords (APIs, classes, methods, functions): QWebView


Overview

The QWebView class provides a widget that is used to view and edit web documents.

QWebView is the main widget component of the QtWebKit web browsing module. It can be used in various applications to display web content live from the Internet.

This example makes the use of following classes:

QWebView-Provides a widget that is used to view and edit web documents


Preconditions

  • Download and Install latest version Qt for Symbian - Installation packages which has links on how to install the latest version

Various Function

  • This is used to load the specific URL(uniform resource locator)
web->load(QUrl("http://www.google.com"));

Source Code

#include <QtGui/QApplication>
#include "webdialog.h"
#include<QWidget>
#include<QWebView>
#include<QVBoxLayout>
#include<QUrl>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *win=new QWidget();
QVBoxLayout *lay=new QVBoxLayout();
QWebView *web=new QWebView();
web->load(QUrl("http://www.google.com"));
web->show();
lay->addWidget(web);
win->setLayout(lay);
win->showMaximized();
win->setStyleSheet("* { background-color:#969358; padding: 7px ; color:#ffffff}");
 
return a.exec();
}


Screenshot

For more Details in QWebView.

Retrieved from " http://wiki.forum.nokia.com/index.php/How_to_use_QWebView_in_Qt_for_Symbian"

你可能感兴趣的:(How to use QWebView in Qt for Symbian)