Skip to content

Commit 430694b

Browse files
committed
Fix identify tool for WMS if webkit is not available (fixes #14658)
1 parent 9ef91ea commit 430694b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/core/qgswebpage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ class CORE_EXPORT QWebPage : public QObject
183183

184184
signals:
185185

186+
void loadFinished( bool ok );
187+
186188
public slots:
187189

188190
protected:

src/core/qgswebview.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class CORE_EXPORT QgsWebView : public QTextBrowser
6666
, mPage( new QWebPage( this ) )
6767
{
6868
connect( this, SIGNAL( anchorClicked( const QUrl & ) ), this, SIGNAL( linkClicked( const QUrl & ) ) );
69+
connect( this, SIGNAL( pageLoadFinished( bool ) ), mPage, SIGNAL( loadFinished( bool ) ) );
6970
}
7071

7172
~QgsWebView()
@@ -99,8 +100,15 @@ class CORE_EXPORT QgsWebView : public QTextBrowser
99100
return new QgsWebView();
100101
}
101102

102-
void setContent( const QByteArray&, const QString&, const QUrl& )
103+
void setContent( const QByteArray& data, const QString& contentType, const QUrl& )
103104
{
105+
QString text = QString::fromUtf8( data );
106+
if ( contentType == "text/html" )
107+
setHtml( text );
108+
else
109+
setPlainText( text );
110+
111+
emit pageLoadFinished( true );
104112
}
105113

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

121+
void pageLoadFinished( bool ok );
122+
113123
private:
114124
QWebSettings *mSettings;
115125
QWebPage *mPage;

0 commit comments

Comments
 (0)