They are several errors in the procedure above,
You create two webviews... First in a widget and second by calling parent createWindow(). Use only one of this constructor and "return" the pointer ...
QWebView * WebView::createWindow ( QWebPage::WebWindowType type ) {
QWebView *appletview = new QWebView(NULL);
// ...
return appletView;
}
QWebView * WebView::createWindow ( QWebPage::WebWindowType type ) {
QWebView *appletview = new QWebView(NULL);
// ...
return appletView;
}
To copy to clipboard, switch view to plain text mode
Instead of made a show() call in the createWindow function, try to do it on the loadFinished() signal. This reduce flickering of your page when the window open and draw the content of the page...
:QWebView(parent)
{
hide();
...
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(onPageLoadFinished(bool)));
}
void WebView::onPageLoadFinished(bool value)
{
show();
}
WebView::WebView(QWidget * parent)
:QWebView(parent)
{
hide();
...
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(onPageLoadFinished(bool)));
}
void WebView::onPageLoadFinished(bool value)
{
show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks