0

Asking this because i can't figure it out. Environment: Windows 10 x64, Qt Creator 4.11.1, OpenCv 3.9, msvc 2017_64

I tried this as like the Qt Documentation says:

    QList<QCameraInfo> availableCameras = QCameraInfo::availableCameras();
    for (const QCameraInfo &cameraInfo : availableCameras) {
        std::cout << cameraInfo.description().toStdString() << std::endl;
    }
    if(availableCameras.isEmpty())
        cout << availableCameras.size() << endl;
        cout << "Empty" << endl;

But in output i get: "0, empty"

I don't know if it's a bug, but with another blank project without including OpenCv this code works. Can someone explain?

-EDIT- I solved the problem deleting the directory

"build-ProjectName-Desktop_Qt_5_14_1_MSVC2017_64bit-Release"

So, i rebuilding and deploying with "windeployqt.exe ." in the directory of my project.exe

  • Welcome to stack overflow. You should probably post your code that is not working the way it should. Simply stating "It doesn't work" isn't going to help. – Andy Apr 02 '20 at 14:22
  • Sorry, just edited. – Ivano Blend Simone Apr 02 '20 at 14:29
  • try reading thru: https://stackoverflow.com/questions/42567750/i-have-two-webcams-but-qcamerainfoavailablecameras-returns-empty-array – Andy Apr 02 '20 at 14:32
  • Thanks Andy i read it, but I don't find the solution there. Because someone answered by building in debug mode, but i want that works in release mode to share and use the software in the right way – Ivano Blend Simone Apr 02 '20 at 14:42

0 Answers0