Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to set QCamera resolution on Qt 6
QtWS25 Last Chance

How to set QCamera resolution on Qt 6

Scheduled Pinned Locked Moved Solved Qt for Python
4 Posts 2 Posters 407 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.
  • R Offline
    R Offline
    rainzee
    wrote on 26 Nov 2024, 06:09 last edited by
    #1

    We all know that setting the resolution of the camera in Qt5 is as follows:

    code.png

    There have been many changes to Qt6's multimedia module, among them the deprecation of QCameraViewfinderSettings, which QCameraFormat recommended in the documentation, so how do I set the resolution of the camera now? I didn't find any information about it.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rainzee
      wrote on 26 Nov 2024, 06:55 last edited by
      #2

      image.png

      This is a change in the documentation. According to the documentation, it should use QCameraFormat, but QCameraFormat does not have any setter or method to define the resolution, only get.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        friedemannkleint
        wrote on 28 Nov 2024, 12:38 last edited by
        #3

        Use QCamera.setCameraFormat() to set one of the formats enumerated by QCameraDevice.videoFormats() (obtained via QCamera.cameraDevice()).

        R 1 Reply Last reply 30 Nov 2024, 06:19
        1
        • F friedemannkleint
          28 Nov 2024, 12:38

          Use QCamera.setCameraFormat() to set one of the formats enumerated by QCameraDevice.videoFormats() (obtained via QCamera.cameraDevice()).

          R Offline
          R Offline
          rainzee
          wrote on 30 Nov 2024, 06:19 last edited by
          #4

          @friedemannkleint Thx

          1 Reply Last reply
          0
          • R rainzee has marked this topic as solved on 30 Nov 2024, 06:19

          1/4

          26 Nov 2024, 06:09

          • Login

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