PDA

View Full Version : QWebView problem to display the web page



ansar
14th January 2010, 10:50
Hi,

In the following code I am trying to display the web page using QWebView..but it displays a BLANK page(In windows machine) . As this problem is discussed many times in this forum ,but no one given the solution. I include QT += webkit in .pro file also,
and there is no compile time or run time warnings.

And it displays the intraweb pages but not the other web pages like google, qt.nokia.com etc..
Struggling in this from last two days.... :(


code:
-------


#include <QtGui>
#include <QtWebKit>

#include <QDebug>


int main(int argc, char **argv)
{
QApplication app(argc, argv);

QWebView *wv = new QWebView();
QWebPage *page = wv->page();
QWebSettings *settings = page->settings();

settings->setAttribute(QWebSettings::JavascriptEnabled, true);
settings->setAttribute(QWebSettings::PluginsEnabled, true);
settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);

QUrl url = QUrl("http://qt.nokia.com/"); // http://www.google.co.in/
wv->load(url);
wv->setFocus();
wv->show();

return app.exec();
}



Thanks for Help..

ansar
14th January 2010, 15:03
Ho its solved finally.... !!!!!!!

Need to set the QNetworkProxy with the setType - QNetworkProxy::HttpProxy,proxy hostname,port,user and password.
Then set the setApplicationProxy .


Thanks....

saksua
18th January 2010, 03:40
hi ansar,

I compile Qt source code for Windows Mobile & run some GUI application successfully. But I couldn't find qtwebkit.lib or dll. It seem webkit module isn't included in default build. What should I do?

Thank

lamosca
2nd March 2010, 13:33
Hi,

ansar, you have to configure Qt wtih the option -webkit

ex: configure -release -fast -platform win32-msvc2008 -xplatform wincewm60professional-msvc2008 -webkit

lamosca
2nd March 2010, 13:36
If that works, could you telle me what do you think about the performances of the QWebView?