<div id="geary-body" dir="auto"><div><br></div></div><div id="geary-signature" dir="auto">Hi Laurent,</div><div id="geary-quote" dir="auto"><br>On Thu, Apr 30, 2020 at 18:36, Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:<br><blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">Hi Umang,

On Thu, Apr 30, 2020 at 04:07:41PM +0100, Kieran Bingham wrote:
<blockquote> On 30/04/2020 15:15, Umang Jain wrote:
 > 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.
 
 Ohh - nice catch - thanks, tested with and without this patch and I see
 what you mean!
 
 Reviewed-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>>
 Tested-by: Kieran Bingham <<a href="mailto:kieran.bingham@ideasonboard.com">kieran.bingham@ideasonboard.com</a>>
 
 > Signed-off-by: Umang Jain <<a href="mailto:email@uajain.com">email@uajain.com</a>>
 > ---
 >  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);
</blockquote>
How about

        cameraCombo_->setCurrentText(QString::fromStdString(cameraName));

?</div></blockquote><span style="white-space: pre-wrap;"><br>Oh yes, that's quite good. From documentation, it seems setCurrentText()</span><div><span style="white-space: pre-wrap;">will do, what is being done in this patch much explicitly.</span></div><div><span style="white-space: pre-wrap;"><br></span></div><div><span style="white-space: pre-wrap;">> The setter setCurrentText() simply calls setEditText() if the combo box is editable. </span></div><div><span style="white-space: pre-wrap;">     Otherwise, if there is a matching text in the list, currentIndex is set to the corresponding index.</span></div><div><span style="white-space: pre-wrap;"><br></span></div><div><span style="white-space: pre-wrap;">Thanks.<br></span><blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">
With that change, or without it if it doesn't work,

Reviewed-by: Laurent Pinchart <<a href="mailto:laurent.pinchart@ideasonboard.com">laurent.pinchart@ideasonboard.com</a>>

<blockquote> > +
 >   return 0;
 >  }
 >  
</blockquote>
<div>-- 
</div>Regards,

Laurent Pinchart
</div></blockquote></div></div><img src="https://u15657259.ct.sendgrid.net/wf/open?upn=GCEip0g28ftA9O9fsCR2M7x08El53O4YVYtHuSI-2FrLwtytoSlmO-2FnSq-2B0q807R-2FEaQo5XTUdcLSwTT95IaJhnEykIgHfslGOMuzps0XsuWGy2t5M2tvEiiLNNJGeOlV1bsRuxV-2Fl9aO76SV0D-2FiUFcZzofo0FxfXRFnQzj6GAKTbXOTvih-2BwrzvXc2aJN2P-2B86ySSk75FeNDZRy2v4ZSY0Ibo8qP-2BUREXgaEvgoHCWbVpe3G9EDYGXN1Clvqdrtk" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>