summaryrefslogtreecommitdiff
path: root/src/qcam/main_window.cpp
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-02-17 15:39:13 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-02-19 10:32:22 +0000
commit1d80ed1febbd4560c13cb670672cb67befc850ea (patch)
treef1df8d9166aa74661f769df944b2fcafb91d73c9 /src/qcam/main_window.cpp
parentb0f1307fcfbb95519cdf19ac63dfd650d3fe5256 (diff)
qcam: Use standard PicturesLocation path for capture
Utilise the QStandardPaths::PicturesLocation as a starting point for saving images from qcam. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/qcam/main_window.cpp')
-rw-r--r--src/qcam/main_window.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index 29eaba84..ae1760df 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -17,6 +17,7 @@
#include <QImage>
#include <QImageWriter>
#include <QInputDialog>
+#include <QStandardPaths>
#include <QTimer>
#include <QToolBar>
#include <QToolButton>
@@ -348,8 +349,9 @@ void MainWindow::stopCapture()
void MainWindow::saveImageAs()
{
QImage image = viewfinder_->getCurrentImage();
+ QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
- QString filename = QFileDialog::getSaveFileName(this, "Save Image", "",
+ QString filename = QFileDialog::getSaveFileName(this, "Save Image", defaultPath,
"Image Files (*.png *.jpg *.jpeg)");
std::cout << "Save image to " << filename.toStdString() << std::endl;