From 644986c2b77eef28150f6ea2083f9b828c509d26 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 20 Jun 2024 16:49:19 +0100 Subject: qcam: viewfinder_qt: Maintain aspect ratio Keep the image aspect ratio when displaying in the viewfinder. When the window is adjusted to a size that differs in aspect ratio to the image, keep the image centered in the main window. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/apps/qcam/viewfinder_qt.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/apps/qcam/viewfinder_qt.h') diff --git a/src/apps/qcam/viewfinder_qt.h b/src/apps/qcam/viewfinder_qt.h index 4f4b9f11..50fde88e 100644 --- a/src/apps/qcam/viewfinder_qt.h +++ b/src/apps/qcam/viewfinder_qt.h @@ -44,6 +44,7 @@ Q_SIGNALS: protected: void paintEvent(QPaintEvent *) override; + void resizeEvent(QResizeEvent *) override; QSize sizeHint() const override; private: @@ -51,6 +52,7 @@ private: libcamera::PixelFormat format_; QSize size_; + QRect place_; /* Camera stopped icon */ QSize vfSize_; -- cgit v1.2.1