Skip to content

Commit e4e7b2a

Browse files
committedJul 23, 2018
Fix use of custom params when embedding svg for label background
1 parent 2fc366c commit e4e7b2a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed
 

‎src/gui/qgstextformatwidget.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,11 +1256,21 @@ void QgsTextFormatWidget::updateSvgWidgets( const QString &svgPath )
12561256
mShapeSVGPathLineEdit->setText( svgPath );
12571257
}
12581258

1259-
QString resolvedPath = QgsSymbolLayerUtils::svgSymbolNameToPath( svgPath, QgsProject::instance()->pathResolver() );
1260-
bool validSVG = QFileInfo::exists( resolvedPath );
1259+
QString resolvedPath;
1260+
bool validSVG = true;
1261+
if ( ! svgPath.startsWith( QStringLiteral( "base64:" ), Qt::CaseInsensitive ) )
1262+
{
1263+
resolvedPath = QgsSymbolLayerUtils::svgSymbolNameToPath( svgPath, QgsProject::instance()->pathResolver() );
1264+
validSVG = QFileInfo::exists( resolvedPath );
1265+
}
1266+
else
1267+
{
1268+
resolvedPath = svgPath;
1269+
validSVG = true;
1270+
}
12611271

12621272
// draw red text for path field if invalid (path can't be resolved)
1263-
mShapeSVGPathLineEdit->setStyleSheet( QString( !validSVG ? "QLineEdit{ color: rgb(225, 0, 0); }" : "" ) );
1273+
mShapeSVGPathLineEdit->setStyleSheet( !validSVG ? QStringLiteral( "QLineEdit{ color: rgb(225, 0, 0); }" ) : QString() );
12641274
mShapeSVGPathLineEdit->setToolTip( !validSVG ? tr( "File not found" ) : resolvedPath );
12651275

12661276
QColor fill, stroke;

0 commit comments

Comments
 (0)
Please sign in to comment.