@@ -38,7 +38,7 @@ QgsTextAnnotationDialog::QgsTextAnnotationDialog( QgsMapCanvasAnnotationItem *it
38
38
mStackedWidget ->addWidget ( mEmbeddedWidget );
39
39
mStackedWidget ->setCurrentWidget ( mEmbeddedWidget );
40
40
connect ( mEmbeddedWidget , &QgsAnnotationWidget::backgroundColorChanged, this , &QgsTextAnnotationDialog::backgroundColorChanged );
41
- mTextEdit -> setAttribute ( Qt::WA_TranslucentBackground );
41
+
42
42
if ( mItem && mItem ->annotation () )
43
43
{
44
44
QgsTextAnnotation *annotation = static_cast < QgsTextAnnotation * >( mItem ->annotation () );
@@ -53,6 +53,7 @@ QgsTextAnnotationDialog::QgsTextAnnotationDialog( QgsMapCanvasAnnotationItem *it
53
53
mFontColorButton ->setContext ( QStringLiteral ( " symbology" ) );
54
54
55
55
setCurrentFontPropertiesToGui ();
56
+ backgroundColorChanged ( mEmbeddedWidget ->backgroundColor () );
56
57
57
58
QObject::connect ( mButtonBox , &QDialogButtonBox::accepted, this , &QgsTextAnnotationDialog::applyTextToItem );
58
59
QObject::connect ( mButtonBox , &QDialogButtonBox::helpRequested, this , &QgsTextAnnotationDialog::showHelp );
@@ -86,6 +87,7 @@ void QgsTextAnnotationDialog::backgroundColorChanged( const QColor &color )
86
87
QPalette p = mTextEdit ->viewport ()->palette ();
87
88
p.setColor ( QPalette::Base, color );
88
89
mTextEdit ->viewport ()->setPalette ( p );
90
+ mTextEdit ->setStyleSheet ( QStringLiteral ( " QTextEdit { background-color: %1; }" ).arg ( color.name () ) );
89
91
}
90
92
91
93
void QgsTextAnnotationDialog::applyTextToItem ()
0 commit comments