You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.3 KiB
49 lines
1.3 KiB
14 years ago
|
/*! @file
|
||
|
|
||
|
@id $Id$
|
||
|
*/
|
||
|
// 1 2 3 4 5 6 7 8
|
||
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||
|
|
||
|
#ifndef WEBVIEW_HXX
|
||
|
#define WEBVIEW_HXX
|
||
|
|
||
14 years ago
|
#include <qbrowserlib/webpage.hxx>
|
||
|
#include <qbrowserlib/pluginfactory.hxx>
|
||
14 years ago
|
|
||
|
#include <QtWebKit>
|
||
|
|
||
|
#include <memory>
|
||
|
|
||
|
class WebView: public QWebView {
|
||
|
Q_OBJECT;
|
||
|
signals:
|
||
|
void newView(WebView*);
|
||
|
public:
|
||
|
WebView(WebPage* webpage) {
|
||
|
x(webpage); //! @bugfix, gcc does not yet support constructor calling
|
||
|
}
|
||
|
WebView(QWidget *parent=0): QWebView(parent) {
|
||
|
x(new WebPage); //! @bugfix, gcc does not yet support constructor calling
|
||
|
}
|
||
|
private:
|
||
|
//! @bugfix, gcc does not yet support constructor calling
|
||
|
/*! @see http://en.wikipedia.org/wiki/C++11#Object_construction_improvement
|
||
|
*/
|
||
|
void x(WebPage* webpage) {
|
||
|
webpage->setParent(this);
|
||
|
setPage(webpage);
|
||
|
page()->setPluginFactory(new PluginFactory);
|
||
|
page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
|
||
|
page()->setForwardUnsupportedContent(true);
|
||
|
assert(connect(page(), SIGNAL(newPage(WebPage*)),
|
||
|
SLOT(newPage(WebPage*))));
|
||
|
}
|
||
|
private slots:
|
||
|
void newPage(WebPage* p) {
|
||
|
newView(new WebView(p));
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif
|