Important: Please read the Qt Code of Conduct -

QCameraExposure not possible to get or set attributes (Camera Example)

  • Hello to everyone,

    I am just trying to set exposure mode to the webcam using the class QCamera::QExposureMode. Running the example from installation of QT Creator under Windows 7 (qt/examples/multimedia/ Camera in real time and capture of pictures are both working, but changing exposure compensation seems to do nothing. In fact, changing the code to get apperture or shutterspeeds returns -1 (it is supposed to return a qreal with some value not negative). While checking if the camera allows exposuremode, the result is that it is not supported. Is this behaviour normal? Strange thing is that with apertura or other parameters, I do not have access to any of its attributes (the functions return 0, false or a negative value).

    I would appreciate some help with that!!!

    Thanks a lot,

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Not all backends of QtMultimedia support all the features. You should check whether the parameters are supported.

  • @SGaist Thanks for your help. I had checked all these parameters but as I said, all these callings return FALSE, it means Not Supported (for exposure, shutterspeed, etc). The point is that if I try to change exposure, brightness or other parameters from Skype (Configuring Webcam video) for example, I am allowed to change any of these parameters successfully. This means that it is not a problem with the webcam, those parameters are supported. Does it have any sense?


  • Lifetime Qt Champion

    I didn't wrote that there was any problem with your webcam, just that the backend used might not implement these parameters.

    You can check which backend is loaded by setting the "Q_DEBUG_PLUGINS" environment variable to 1 in the Run part of the Project panel in Qt Creator.

Log in to reply