File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1256,11 +1256,21 @@ void QgsTextFormatWidget::updateSvgWidgets( const QString &svgPath )
1256
1256
mShapeSVGPathLineEdit ->setText ( svgPath );
1257
1257
}
1258
1258
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
+ }
1261
1271
1262
1272
// 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 ( ) );
1264
1274
mShapeSVGPathLineEdit ->setToolTip ( !validSVG ? tr ( " File not found" ) : resolvedPath );
1265
1275
1266
1276
QColor fill, stroke;
You can’t perform that action at this time.
0 commit comments