43 explicit QgsWebView( QWidget *parent =
nullptr )
44 : QTextBrowser( parent )
48 connect(
this, &QTextBrowser::anchorClicked,
this, &QgsWebView::linkClicked );
49 connect(
this, &QgsWebView::pageLoadFinished, mPage, &QWebPage::loadFinished );
58 void setUrl(
const QUrl &url ) { setSource( url ); }
60 void load(
const QUrl &url ) { setSource( url ); }
62 QUrl url()
const {
return source(); }
64 QWebPage *page()
const {
return mPage; }
70 void setContent(
const QByteArray &data,
const QString &contentType,
const QUrl & )
72 QString text = QString::fromUtf8( data );
73 if ( contentType ==
"text/html" )
78 emit pageLoadFinished(
true );
81 void print( QPrinter * ) {}
84 void linkClicked(
const QUrl &link );
86 void pageLoadFinished(
bool ok );
90 void setHtml(
const QString &text )
92 QTextBrowser::setHtml( text );
93 emit pageLoadFinished(
true );
96 void setText(
const QString &text )
98 QTextBrowser::setText( text );
99 emit pageLoadFinished(
true );
A collection of stubs to mimic the API of a QWebPage on systems where QtWebkit is not available.