apps: qcam: Show QImageWriter errors
When saving the current iamge, `QImageWriter::write()` may fail for various reasons. However, this is currently not reported in any way. Use a simple `QMessageBox` to report the issues. Link: https://gitlab.freedesktop.org/camera/libcamera/-/issues/313 Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <QFileDialog>
|
||||
#include <QImage>
|
||||
#include <QImageWriter>
|
||||
#include <QMessageBox>
|
||||
#include <QMutexLocker>
|
||||
#include <QStandardPaths>
|
||||
#include <QStringList>
|
||||
@@ -637,7 +638,8 @@ void MainWindow::saveImageAs()
|
||||
|
||||
QImageWriter writer(filename);
|
||||
writer.setQuality(95);
|
||||
writer.write(image);
|
||||
if (!writer.write(image))
|
||||
QMessageBox::warning(this, "Failed to save image", writer.errorString());
|
||||
}
|
||||
|
||||
void MainWindow::captureRaw()
|
||||
|
||||
Reference in New Issue
Block a user