Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. detect disconnect webcam
Qt 6.11 is out! See what's new in the release blog

detect disconnect webcam

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 856 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neda
    wrote on last edited by
    #1

    hi
    how to detect disconnect webcam?
    i use many event for detect change state of webcam but does not work.
    and after disconnect camera i does not see any log.
    please guide me
    thanks

    Camera {
                                    id: camera
                                    captureMode: Camera.CaptureStillImage
    
    
                                    onErrorChanged: {
                                        console.log("neda");
                                    }
    
                                    onError: {
                                        console.log("neda");
                                    }
    
                                    onCameraStateChanged: {
                                        console.log("Camera State = " + camera.cameraState);
                                        if (camera.cameraState === Camera.LoadedState) {
    onsole.log("neda");
                                        }
    
                                        if (camera.cameraState === Camera.ActiveState) {
    onsole.log("neda");
                                        }
                                    }
    
                                    videoRecorder {
                                        id:vr
                                        
                                    }
                               onAvailabilityChanged: {
                                        console.log("Availability: ")
                                        if (availability == camera.ResourceMissing) {
                                            console.debug("neda: " + status);
                                        }
    
                                    }
    
                                    onCameraStatusChanged: {
                                        console.debug("Camera status changed: " + cameraState);
    
                                        if (cameraStatus == camera.UnavailableStatus) {
                                            console.debug("neda: " + status);
                                        }
    
                                        if (cameraStatus == Camera.ActiveStatus) {
    
                                            var fr = camera.supportedViewfinderFrameRateRanges();
                                            fpsList.model = fr;
    
                                            var res = camera.supportedViewfinderResolutions(15);
                                            resolutionList.model = res;
                                        }
                                    }                                
    
    
                                    flash.mode: Camera.FlashRedEyeReduction
                                    imageCapture {
                                        onImageCaptured: {
                                            photoPreview.source = preview
                                            stillControls.previewAvailable = true
                                            cameraUI.state = "PhotoPreview"
                                        }
                                    }
    
    
    
                                }
    
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved