prajith
4th May 2014, 11:36
I am developing an application that uses the ‘QWebview’ to display the websites on the internet.
My problem is, the website which I am trying to load has a authentication popup window (HTTP BASIC AUTH) so you can enter a username and password, after the authorization, when I try to open a link in new window or tab it is keep asking me the same popup instad of loading the page directly. Here is my Webview subclass.
WebView::WebView(QWidget *parent) : QWebView(parent) {
page()->deleteLater();
QWebPage *newWeb = new QWebPage();
NetworkAccessManager *network = new NetworkAccessManager();
setPage(newWeb);
setRenderHints(QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing | QPainter::Antialiasing);
page()->setForwardUnsupportedContent(true);
page()->setNetworkAccessManager(network);
this->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
this->settings()->setAttribute(QWebSettings::JavaEnabled, true);
this->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
this->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
this->settings()->setAttribute(QWebSettings::LocalStorageDatabaseEna bled, true);
this->settings()->setAttribute(QWebSettings::OfflineWebApplicationCa cheEnabled, true);
this->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseE nabled, true);
}
WebView *WebView::createWindow(QWebPage::WebWindowType type)
{
WebView *view = new WebView;
return view;
}
If anyone can help me on this, that would be great.
Thanks.
My problem is, the website which I am trying to load has a authentication popup window (HTTP BASIC AUTH) so you can enter a username and password, after the authorization, when I try to open a link in new window or tab it is keep asking me the same popup instad of loading the page directly. Here is my Webview subclass.
WebView::WebView(QWidget *parent) : QWebView(parent) {
page()->deleteLater();
QWebPage *newWeb = new QWebPage();
NetworkAccessManager *network = new NetworkAccessManager();
setPage(newWeb);
setRenderHints(QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing | QPainter::Antialiasing);
page()->setForwardUnsupportedContent(true);
page()->setNetworkAccessManager(network);
this->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
this->settings()->setAttribute(QWebSettings::JavaEnabled, true);
this->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
this->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
this->settings()->setAttribute(QWebSettings::LocalStorageDatabaseEna bled, true);
this->settings()->setAttribute(QWebSettings::OfflineWebApplicationCa cheEnabled, true);
this->settings()->setAttribute(QWebSettings::OfflineStorageDatabaseE nabled, true);
}
WebView *WebView::createWindow(QWebPage::WebWindowType type)
{
WebView *view = new WebView;
return view;
}
If anyone can help me on this, that would be great.
Thanks.