Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix identify tool for WMS if webkit is not available (fixes #15596)
(cherry picked from commit 430694b)
  • Loading branch information
wonder-sk committed Oct 28, 2016
1 parent ea2e68b commit 59d1d70
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/qgswebpage.h
Expand Up @@ -183,6 +183,8 @@ class CORE_EXPORT QWebPage : public QObject

signals:

void loadFinished( bool ok );

public slots:

protected:
Expand Down
12 changes: 11 additions & 1 deletion src/core/qgswebview.h
Expand Up @@ -66,6 +66,7 @@ class CORE_EXPORT QgsWebView : public QTextBrowser
, mPage( new QWebPage( this ) )
{
connect( this, SIGNAL( anchorClicked( const QUrl & ) ), this, SIGNAL( linkClicked( const QUrl & ) ) );
connect( this, SIGNAL( pageLoadFinished( bool ) ), mPage, SIGNAL( loadFinished( bool ) ) );
}

~QgsWebView()
Expand Down Expand Up @@ -99,8 +100,15 @@ class CORE_EXPORT QgsWebView : public QTextBrowser
return new QgsWebView();
}

void setContent( const QByteArray&, const QString&, const QUrl& )
void setContent( const QByteArray& data, const QString& contentType, const QUrl& )
{
QString text = QString::fromUtf8( data );
if ( contentType == "text/html" )
setHtml( text );
else
setPlainText( text );

emit pageLoadFinished( true );
}

void print( QPrinter* )
Expand All @@ -110,6 +118,8 @@ class CORE_EXPORT QgsWebView : public QTextBrowser
signals:
void linkClicked( const QUrl &link );

void pageLoadFinished( bool ok );

private:
QWebSettings *mSettings;
QWebPage *mPage;
Expand Down

0 comments on commit 59d1d70

Please sign in to comment.