Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QCameraDevice::photoResolutions() empty output
Forum Update on Monday, May 27th 2025

QCameraDevice::photoResolutions() empty output

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 2 Posters 222 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.
  • M Offline
    M Offline
    marcezav
    wrote on last edited by
    #1

    Hello everyone,
    I've been testing some of the QCameraDevice's methods in Android for a project, the code is the following:

    const QList<QCameraDevice> cameras = QMediaDevices::videoInputs();
        for (const QCameraDevice &cameraDevice : cameras)
        {
            qDebug() << "Camera: " << cameraDevice << ", isDefault: " << cameraDevice.isDefault();
            qDebug() << "Photo Resolutions: " << cameraDevice.photoResolutions();
        }
    

    As shown in the code above, I'm listing every QCameraDevice detected in the phone and listing its Photos resolutions.
    The problem is that when I'm compiling in the Qt 6.7 or 6.8 versions the returning QList is empty. However in the Qt 6.5 version it doesn't do that, it returns a QList with the resolutions.

    Is there something that has to be modified in the code from the Qt 6.7 version forward for the QList to return NOT empty?

    Thanks a lot in advance.

    jsulmJ 1 Reply Last reply
    0
    • M marcezav

      Hello everyone,
      I've been testing some of the QCameraDevice's methods in Android for a project, the code is the following:

      const QList<QCameraDevice> cameras = QMediaDevices::videoInputs();
          for (const QCameraDevice &cameraDevice : cameras)
          {
              qDebug() << "Camera: " << cameraDevice << ", isDefault: " << cameraDevice.isDefault();
              qDebug() << "Photo Resolutions: " << cameraDevice.photoResolutions();
          }
      

      As shown in the code above, I'm listing every QCameraDevice detected in the phone and listing its Photos resolutions.
      The problem is that when I'm compiling in the Qt 6.7 or 6.8 versions the returning QList is empty. However in the Qt 6.5 version it doesn't do that, it returns a QList with the resolutions.

      Is there something that has to be modified in the code from the Qt 6.7 version forward for the QList to return NOT empty?

      Thanks a lot in advance.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @marcezav said in QCameraDevice::photoResolutions() empty output:

      Is there something that has to be modified in the code from the Qt 6.7 version forward for the QList to return NOT empty?

      Do you mean the "cameras" list is empty? Or are the cameras detected but the resolutions list is empty?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • jsulmJ jsulm

        @marcezav said in QCameraDevice::photoResolutions() empty output:

        Is there something that has to be modified in the code from the Qt 6.7 version forward for the QList to return NOT empty?

        Do you mean the "cameras" list is empty? Or are the cameras detected but the resolutions list is empty?

        M Offline
        M Offline
        marcezav
        wrote on last edited by
        #3

        @jsulm
        The cameras are detected but the Photo Resolution QLists are empty, this is the output:

        D libappQMediaDevices_Format_arm64-v8a.so: Camera:   "QCameraDevice(name=Rear Camera: 0, id=0, position=BackFace)"  , isDefault:  false
        D libappQMediaDevices_Format_arm64-v8a.so: Photo Resolutions:  QList()
        D libappQMediaDevices_Format_arm64-v8a.so: Camera:   "QCameraDevice(name=Front Camera: 1, id=1, position=FrontFace)"  , isDefault:  false
        D libappQMediaDevices_Format_arm64-v8a.so: Photo Resolutions:  QList()
        
        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