File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,25 @@ def getQgisTestApp():
67
67
68
68
if QGISAPP is None :
69
69
myGuiFlag = True # All test will run qgis in gui mode
70
-
71
70
QGISAPP = QgsApplication (sys .argv , myGuiFlag )
71
+ # Note: QGIS_PREFIX_PATH is set by cmake to the output dir
72
+ if 'QGIS_PREFIX_PATH' in os .environ :
73
+ myPath = os .environ ['QGIS_PREFIX_PATH' ]
74
+ myUseDefaultPathFlag = True
75
+ QGISAPP .setPrefixPath (myPath , myUseDefaultPathFlag )
76
+
77
+ if sys .platform .startswith ('darwin' ):
78
+ # override resource paths, otherwise looks for Resources in app
79
+ if 'QGIS_MAC_PKGDATA_DIR' in os .environ :
80
+ myPkgPath = os .environ ['QGIS_MAC_PKGDATA_DIR' ]
81
+ QGISAPP .setPkgDataPath (myPkgPath )
82
+ if 'QGIS_MAC_SVG_DIR' in os .environ :
83
+ mySVGPath = os .environ ['QGIS_MAC_SVG_DIR' ]
84
+ mySVGPaths = QGISAPP .svgPaths ()
85
+ # doesn't get rid of incorrect path, just adds correct one
86
+ mySVGPaths .prepend (mySVGPath )
87
+ QGISAPP .setDefaultSvgPaths (mySVGPaths )
88
+
72
89
QGISAPP .initQgis ()
73
90
s = QGISAPP .showSettings ()
74
91
print s
You can’t perform that action at this time.
0 commit comments