-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG paths #75
Comments
On MacOS not reproduced. >>> from qgis.core import QgsApplication
>>> qgis = QgsApplication([], False)
>>> qgis.svgPaths()
[u'/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Applications/qgis-ng.app/Contents/Resources/svg/', u'/Users/Bishop/.qgis2//svg/']
>>> qgis.setDefaultSvgPaths(qgis.svgPaths() + ['/svgpaths'])
>>> qgis.svgPaths()
[u'/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Applications/qgis-ng.app/Contents/Resources/svg/', u'/Users/Bishop/.qgis2//svg/', u'/svgpaths']
>>> from qgis.PyQt.QtCore import QSettings
>>> QSettings().value( 'svg/searchPathsForSVG' )
>>> QSettings().setValue( 'svg/searchPathsForSVG', '/svgpaths2' )
>>> qgis.svgPaths()
[u'/svgpaths2', u'/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Applications/qgis-ng.app/Contents/Resources/svg/', u'/Users/Bishop/.qgis2//svg/', u'/svgpaths']
>>> Let me test on ubuntu. |
On ubuntu: >>> from qgis.core import QgsApplication
>>> qgis = QgsApplication([], False)
>>> qgis.svgPaths()
[u'/usr/share/ngqgis/svg/', u'/opt/ngw/.qgis2//svg/']
>>> qgis.setDefaultSvgPaths(qgis.svgPaths() + ['/svgpaths'])
>>> qgis.svgPaths()
[u'/usr/share/ngqgis/svg/', u'/opt/ngw/.qgis2//svg/', u'/svgpaths']
>>> from qgis.PyQt.QtCore import QSettings
>>> QSettings().value( 'svg/searchPathsForSVG' )
>>> QSettings().setValue( 'svg/searchPathsForSVG', '/svgpaths2' )
>>> qgis.svgPaths()
[u'/svgpaths2', u'/usr/share/ngqgis/svg/', u'/opt/ngw/.qgis2//svg/', u'/svgpaths']
>>> $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic |
I can confirm, that this list populates as expected but QGIS doesn't take into account some of these paths. @BishopGIS try to render an image programmatically using custom SVGs. |
Can you check the second case to set custom svg path: >>> QSettings().setValue( 'svg/searchPathsForSVG', '/svgpaths2' )
>>> qgis.svgPaths()
[u'/svgpaths2', u'/usr/share/ngqgis/svg/', u'/opt/ngw/.qgis2//svg/', u'/svgpaths'] It this not working too? For first case I think I found out the root of problem. |
Default svg icons path |
It seems like looking up of SVG icons in custom paths doesn't work in nextgisqgis. I've discovered it while working with nextgisweb. Here we add paths to list of paths where QGIS should be able to search SVGs https://github.com/nextgis/nextgisweb_qgis/blob/ffce27d0055f5344907f29681021597f313e1405/nextgisweb_qgis/__init__.py#L81-L89. It works in official QGIS but not in nextgisqgis. The one way I was able to overcome this issue is to create
/ngw/management/env/share/ngqgis/svg/
directory and put icons there.The text was updated successfully, but these errors were encountered: