Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix Html annotation background (#50638)
  • Loading branch information
YoannQDQ authored and nyalldawson committed May 12, 2023
1 parent edf47ef commit 322fee9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/annotations/qgshtmlannotation.cpp
Expand Up @@ -46,6 +46,11 @@ QgsHtmlAnnotation::QgsHtmlAnnotation( QObject *parent )
mWebPage->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
mWebPage->setNetworkAccessManager( QgsNetworkAccessManager::instance() );

// Make QWebPage transparent so that the background color of the annotation frame is used
QPalette palette = mWebPage->palette();
palette.setBrush( QPalette::Base, Qt::transparent );
mWebPage->setPalette( palette );

connect( mWebPage->mainFrame(), &QWebFrame::javaScriptWindowObjectCleared, this, &QgsHtmlAnnotation::javascript );
}

Expand Down Expand Up @@ -186,6 +191,3 @@ void QgsHtmlAnnotation::javascript()
QWebFrame *frame = mWebPage->mainFrame();
frame->addToJavaScriptWindowObject( QStringLiteral( "layer" ), mapLayer() );
}



0 comments on commit 322fee9

Please sign in to comment.