在移植qt5.9.4的时候遇到了一个问题,linuxfb插件下执行QML报错:
This plugin does not support createPlatformOpenGLContext!
Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 1, profile QSurfaceFormat::OpenGLContextProfile(NoProfile))
Aborted
这问题差不多卡了一周左右,通过查找网上给出的解决方法,有说配置时加-kms参数的,也有说在配置时要将EGL on X....................................yes的,当然绝大多数博客上给出的解释是:
The problem is likely that you are using qt quick 2, which requires OpenGL. OpenGL does not support the frame buffer used for the small display.
经过漫长的查找路程之后,在qt官方给出的一篇文章中发现(http://doc.qt.io/qt-5/embedded-linux.html):
Building Qt for a given device requires a toolchain and a sysroot. Additionally, some devices require vendor-specific adaptation code for EGL and OpenGL ES 2.0 support. This is not relevant for non-accelerated platforms, for example the ones using the LinuxFB plugin, which is meant for software-based rendering only.
也就是说linuxfb只支持基于软件的渲染方式,不支持OPENGL的渲染方式,即qt quick2方式的QML程序都不被支持。特此记录。