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 #14658)
  • Loading branch information
wonder-sk committed Oct 3, 2016
1 parent 9ef91ea commit 430694b
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

1 comment on commit 430694b

@wonder-sk
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it fixes #15596 and not #14658 ...

Please sign in to comment.