在没有安装Qt的计算机上运行Qt应用程序。 QCamera看不到可用的设备 [英] Run Qt application on computer without installed Qt. QCamera don't see available devices

查看:506
本文介绍了在没有安装Qt的计算机上运行Qt应用程序。 QCamera看不到可用的设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个网络/ Gui应用程序。我在另一台计算机上测试应用程序,它没有安装Qt。但是当我启动应用程序时, QCamera :: availableDevices()返回一个空列表。当我在安装了Qt的计算机上启动此应用程序时,它会返回此计算机上所有摄像机的列表。

I'm developping a Network/Gui application. I'm testing the application on another computer, which does not have Qt installed. But when I start the application, QCamera::availableDevices() returns an empty list. When I start this application on the computer which has Qt installed, it returns a list with all cameras on this computer.

我认为问题出现在 QMultimedia 后端插件,它不会自动加载。

I think that the problem is in the QMultimedia back-end plugin, which is not loaded automatically. How can I get a list of loaded Qt plugins?

推荐答案

您可以尝试使用qt.conf文件方法设置插件位置。正如Qt文档所说:

You can try to use qt.conf file approach to set the depending plugins location. As Qt docs say:


如果没有qt.conf,Qt库将使用硬编码的路径
寻找插件,翻译,等等。这些路径在目标系统上可能不存在
,或者它们可能无法访问。因为这个,
你需要qt.conf让Qt库看起来在别处。

Without qt.conf, the Qt libraries will use the hard-coded paths to look for plugins, translations, and so on. These paths may not exist on the target system, or they may not be accessible. Because of this, you need qt.conf to make the Qt libraries look elsewhere.

如何使用qt.conf

这篇关于在没有安装Qt的计算机上运行Qt应用程序。 QCamera看不到可用的设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆