From 9977fc3fcbfa0a6aaab04118fc67f0b9b9627570 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 16 Jan 2020 22:50:15 +0000 Subject: qcam: Support scaling of the viewfinder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The viewfinder is drawn using a QLabel. This could support scaling through QLabel::setScaledContents(), but in a very inefficient way. To maintain reasonable efficiency, turn the viewfinder into a QWidget and draw the image directly using a QPainter. No performance change was noticed running on a fast x86 machine, and performance was 60% higher when scaling up to full screen compared to QLabel. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- src/qcam/main_window.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/qcam/main_window.cpp') diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 1d9c756f..df51fa88 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -33,7 +33,6 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options) viewfinder_ = new ViewFinder(this); setCentralWidget(viewfinder_); - viewfinder_->setFixedSize(500, 500); adjustSize(); ret = openCamera(cm); -- cgit v1.2.1