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
Forum Updated to NodeBB v4.3 + New Features

How to set QCamera resolution on Qt 6

Scheduled Pinned Locked Moved Solved Qt for Python
4 Posts 2 Posters 568 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 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 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 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
        1
        • F friedemannkleint

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

          R Offline
          R Offline
          rainzee
          wrote on last edited by
          #4

          @friedemannkleint Thx

          1 Reply Last reply
          0
          • R rainzee has marked this topic as solved on

          • Login

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