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

Message ID 20200430155946.15605-3-email@uajain.com
State Accepted
Headers show
Series
  • Fix combo-box entry selection on startup
Related show

Commit Message

Umang Jain April 30, 2020, 4 p.m. UTC
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@uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/qcam/main_window.cpp | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index c95d097..3e92cd9 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -250,6 +250,9 @@  int MainWindow::openCamera()
 		return -EBUSY;
 	}
 
+	/* Set the combo-box entry with the currently selected Camera */
+	cameraCombo_->setCurrentText(QString::fromStdString(cameraName));
+
 	return 0;
 }