Skip to content

Commit 51db4f7

Browse files
committed
Update
1 parent fab72ed commit 51db4f7

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

examples/qt_barcode_scanner/mainwindow.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ void MainWindow::changeEvent(QEvent *event)
375375

376376
// Use a single-shot timer to resume camera updates after window state change completes
377377
QTimer::singleShot(500, this, [this]()
378-
{
379-
cameraUpdatesPaused = false; });
378+
{ cameraUpdatesPaused = false; });
380379

381380
// Window state changed - camera updates paused temporarily
382381
}
@@ -423,25 +422,26 @@ void MainWindow::startCamera()
423422
if (!cameras.isEmpty())
424423
{
425424
ui->resultsTextEdit->append(QString("Found %1 Qt camera(s)").arg(cameras.size()));
426-
425+
427426
// Create camera and capture session
428427
camera = std::make_unique<QCamera>(cameras.first());
429428
captureSession = std::make_unique<QMediaCaptureSession>();
430-
429+
431430
captureSession->setCamera(camera.get());
432431
captureSession->setVideoOutput(videoWidget.get());
433-
432+
434433
// Start camera
435434
camera->start();
436-
435+
437436
// Show Qt video widget, hide OpenCV label
438437
videoWidget->show();
439-
if (cameraLabel) cameraLabel->hide();
438+
if (cameraLabel)
439+
cameraLabel->hide();
440440
useOpenCVCamera = false;
441-
441+
442442
ui->startCameraButton->setEnabled(false);
443443
ui->stopCameraButton->setEnabled(true);
444-
444+
445445
ui->resultsTextEdit->append("Qt6 camera started successfully!");
446446
return;
447447
}
@@ -497,7 +497,8 @@ bool MainWindow::tryStartOpenCVCamera()
497497
{
498498
// Show OpenCV camera label, hide Qt video widget
499499
cameraLabel->show();
500-
if (videoWidget) videoWidget->hide();
500+
if (videoWidget)
501+
videoWidget->hide();
501502
useOpenCVCamera = true;
502503

503504
ui->startCameraButton->setEnabled(false);

0 commit comments

Comments
 (0)