1、问题描述
第一步,确保手动启动Qt程序没有报错!如果报以下错误,参见博客
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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.
Available platform plugins are: xcb.
第二步,在Ubuntu系统中设置自启动脚本,例如在 /etc/rc.local 文件中添加启动脚本,但是在自启动时报错:
*******XOpenDisplay Fail *******
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in <