Skip to content
Permalink
Browse files

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 59d1d702d0b9b783493f62fd0dcc2341b5021357
Showing with 13 additions and 1 deletion.
  1. +2 −0 src/core/qgswebpage.h
  2. +11 −1 src/core/qgswebview.h
@@ -183,6 +183,8 @@ class CORE_EXPORT QWebPage : public QObject

signals:

void loadFinished( bool ok );

public slots:

protected:
@@ -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()
@@ -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* )
@@ -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;

0 comments on commit 59d1d70

Please sign in to comment.
You can’t perform that action at this time.