[libcamera-devel] [PATCH 2/2] qcam: main_window: Fix combo-box entry selection on startup

Umang Jain email at uajain.com
Thu Apr 30 16:15:03 CEST 2020


When one of the camera is selected and opened from the
"Select Cameras" items list, the entry of the combo-box
in the main-window doesn't update its item index to reflect
the camera which was earlier selected. Fix that.

Signed-off-by: Umang Jain <email at uajain.com>
---
 src/qcam/main_window.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index 344b7ec..fa05515 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -249,6 +249,10 @@ int MainWindow::openCamera()
 		return -EBUSY;
 	}
 
+	/* Set the combo-box with the current selected Camera */
+	int camIndex = cameraCombo_->findText(QString::fromStdString(cameraName));
+	cameraCombo_->setCurrentIndex(camIndex);
+
 	return 0;
 }
 
-- 
2.26.0



More information about the libcamera-devel mailing list