mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-19 18:35:07 +03:00
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>
This commit is contained in:
parent
b0f1307fcf
commit
1d80ed1feb
1 changed files with 3 additions and 1 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QImageWriter>
|
#include <QImageWriter>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
|
#include <QStandardPaths>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
@ -348,8 +349,9 @@ void MainWindow::stopCapture()
|
||||||
void MainWindow::saveImageAs()
|
void MainWindow::saveImageAs()
|
||||||
{
|
{
|
||||||
QImage image = viewfinder_->getCurrentImage();
|
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)");
|
"Image Files (*.png *.jpg *.jpeg)");
|
||||||
|
|
||||||
std::cout << "Save image to " << filename.toStdString() << std::endl;
|
std::cout << "Save image to " << filename.toStdString() << std::endl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue