qt下载路径
https://download.qt.io/
qt官方文档
https://doc.qt.io/
遇到的bug
1、Project ERROR: Unknown module(s) in QT: core gui
排查:
是否存在对应库
是否存在对应pri文件:如qt_lib_core.pri
qt.conf文件中HostData指向的路径是否为modules/qt_lib_core.pri所在路径
2、linnuxfb 不能初始化
报错如下:
qt.qpa.plugin: Could not load the Qt platform plugin “linuxfb” in “/usr/lib/qt/plugins” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
排查:
设置环境变量
QT_DEBUG_PLUGINS=“1”
运行qt程序,此时报错如下:
Cannot load library /usr/lib/qt/plugins/platforms/libqlinuxfb.so: (libdrm.so.2: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on “/usr/lib/qt/plugins/platforms/libqlinuxfb.so” : “Cannot load library /usr/lib/qt/plugins/platforms/libqlinuxfb.so: (libdrm.so.2: cannot open shared object file: No such file or directory)”
qt.qpa.plugin: Could not load the Qt platform plugin “linuxfb” in “/usr/lib/qt/plugins” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
发现是没有libdrm.so,此时可以编译一个libdrm进文件系统,或者重新编译qtbase,设置配置项-no-kms。
qt webengine开发
关于qt webengine在无opengl的设备上运行,可参考以下链接
Qt的QWebengine在部分win7设备上黑屏和网页突然消失的问题排查解决
待续