×
Namespaces

Variants
Actions
Revision as of 22:09, 12 September 2009 by fasttrack (Talk | contribs)

Archived:How to use QWebView

From Nokia Developer Wiki
Jump to: navigation, search
{{{width}}}


Article Metadata
Tested with
Devices(s): S60 Emulator
Compatibility
Platform(s): S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition
Symbian
Article
Keywords: QWebView
Created: (11 Mar 2009)
Last edited: fasttrack (12 Sep 2009)


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 exmaple makes the use of following classes:

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


Preconditions


Various Function

  • This is used to load the specific url(uniform resource locator)
web->load(QUrl("http://www.google.com"));
  • This property holds the url of the web page currently viewed.
web->setUrl(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:rgb(150,147,88); padding: 7px ; color:rgb(255,255,255)}");
 
return a.exec();
}


Screenshot

Web001.jpg

For more Details in QWebView.

103 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×