We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b7682ce commit f8025fdCopy full SHA for f8025fd
src/composer/qgscomposerpicture.cpp
@@ -23,6 +23,7 @@
23
#include <QMessageBox>
24
#include <QPainter>
25
#include <QImageWriter>
26
+#include <QSettings>
27
28
#include <cmath>
29
#include <iostream>
@@ -493,11 +494,21 @@ QString QgsComposerPicture::pictureDialog ( void )
493
494
}
495
filters += " )";
496
497
+ // Retrieve the last used directory
498
+ QSettings settings;
499
+ QString lastUsedDir = settings.readEntry("/UI/lastComposerPictureDir", ".");
500
+
501
QString file = QFileDialog::getOpenFileName(
502
0,
503
tr("Choose a file"),
- ".",
504
+ lastUsedDir,
505
filters );
506
+ if (file.length() != 0)
507
+ {
508
+ QFileInfo myFile(file);
509
+ QString myPath = myFile.dirPath();
510
+ settings.writeEntry("/UI/lastComposerPictureDir", myPath);
511
+ }
512
513
return file;
514
0 commit comments