我有两个网络摄像头,但 QCameraInfo::availableCameras 返回空数组 [英] I have two webcams, but QCameraInfo::availableCameras returns empty array
问题描述
根据文档,QCameraInfo::availableCameras
应该返回可用摄像机的列表.根据文档,没有任何问题.
According to the documentation, QCameraInfo::availableCameras
should return list of available cameras. There's no catch to it according to the docs.
但是,我有两个网络摄像头,可用摄像头阵列返回空.我能做什么?这是否在编程范围内,或者这是否意味着 Qt 仅支持有限的网络摄像头子集?
But still, I have two webcams and the array of available cameras is returned empty. What can I do? Is this even in the scope of programming, or does this mean Qt only supports limited subset of webcams?
我现在使用的操作系统是 Windows 7x64.
The OS I'm using right now is Windows 7x64.
推荐答案
我也有这个问题.然后我读了这个例子.我发现一旦你声明了 QCamera 对象,它就会返回正确的信息.像这样:`
I have this Problem too.Then I read about the example. I found that once you have declared QCamera object.it will return the right info. Like this :`
QCamera *cam = new QCamera;
qDebug()<<QCameraInfo::availableCameras().count();`
我有一个摄像头,所以最后返回1;
I have one camera,so it returns 1 at last;
这篇关于我有两个网络摄像头,但 QCameraInfo::availableCameras 返回空数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!