Save/restore file paths as relative to project file.

This commit is contained in:
Jim Evins
2019-08-18 21:56:37 -04:00
parent ec3d900e87
commit 6a789c9632
11 changed files with 312 additions and 132 deletions
+2 -2
View File
@@ -435,7 +435,7 @@ namespace glabels
{
// Look for image file relative to project file 1st then CWD 2nd
auto* model = dynamic_cast<Model*>( parent() );
QDir::setSearchPaths( "images", {model->dir(), QDir::currentPath()} );
QDir::setSearchPaths( "images", {model->dirPath(), QDir::currentPath()} );
QString filename = QString("images:") + mFilenameNode.text( record, variables );
auto* image = new QImage( filename );
@@ -537,7 +537,7 @@ namespace glabels
{
// Look for image file relative to project file 1st then CWD 2nd
auto* model = dynamic_cast<Model*>( parent() );
QDir::setSearchPaths( "images", {model->dir(), QDir::currentPath()} );
QDir::setSearchPaths( "images", {model->dirPath(), QDir::currentPath()} );
QString filename = QString("images:") + mFilenameNode.text( record, variables );
auto* image = new QImage( filename );