Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Camera functionality not working as expected in Qt 6
Forum Updated to NodeBB v4.3 + New Features

Camera functionality not working as expected in Qt 6

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 720 Views 1 Watching
  • 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.
  • HackSawH Offline
    HackSawH Offline
    HackSaw
    wrote on last edited by
    #1

    Re: QCamera switches not to Active State

    I have this simple implementation for Camera in qml, but when I try to get the active state of the camera, it gives false and if I try to set the active to true by default, my application crashes. Is there anything wrong with my code. I am migrating my project from Qt 5.15 to Qt 6.4 and have gone through the documentation. My project runs the camera fine on Qt 5.15 but not in Qt 6.4.

    I get the below output upon printing default media device:
    QCameraDevice(\\?\usb#vid_0c45&pid_6d14&mi_00#6&6d2bd98&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\global, Integrated Webcam, false, UnspecifiedPosition, )

    Item {
        id: captureImage
        height: 300
        width: 300
    
        MediaDevices {
            id: mediaDevices
        }
    
        CaptureSession {
            camera: Camera {
                id: camera
                cameraDevice: mediaDevices.defaultVideoInput
                whiteBalanceMode: Camera.WhiteBalanceManual
                focusMode: Camera.FocusModeAutoNear
            }
            imageCapture: ImageCapture {
                id: imageCapture
            }
            videoOutput: VideoOutput {
                id: videoOutput
            }
        }
    }
    
    1 Reply Last reply
    0
    • HackSawH Offline
      HackSawH Offline
      HackSaw
      wrote on last edited by
      #2

      @SGaist Can I please have a response on this? I have tried the exact same way as per QML Camera Example but it didn't run. The example project on the other hand runs fine.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Do you mean that the example provided with Qt 6 is working properly but not your code ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        HackSawH 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Do you mean that the example provided with Qt 6 is working properly but not your code ?

          HackSawH Offline
          HackSawH Offline
          HackSaw
          wrote on last edited by
          #4

          @SGaist Yes, you are correct.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            How are you doing things differently from the example ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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