How to add the current project path in Print Composer?
As I investigated in this answer it seems anywhere you can use the Expression String Builder
you can use the @project_folder
variable in at least QGIS 2.16
.
Other potentially useful variables can be found in the annotated screenshot below.
I have not tried this, however it looks like you can create your own custom expression functions (python). This custom expression could be displayed within a composer label. A good how to for creating this would be to go through this blog:
Nathan's QGIS Blog - User defined expression functions for QGIS
Within your function you could use this statement to get your current project document path:
myProjectPath = QgsProject.instance().readPath("./")
A basic implementation that you can add to startup.py
:
from qgis.core import QgsProject
@qgsfunction(0, "Python")
def projectpath(values, feature, parent):
return QgsProject.instance.fileName()
Typing...
[% @project_path %]
...in a QGIS print composer text label will print the file path in the same way as the dynamic text expression does in ArcMap (using QGIS 2.14).