Raspberry Pi 3 上的 QML 性能

QML Peformance on Raspberry Pi 3

我已经从我的 rasp 中的存储库安装了 Qt5.7。编译我的 qml 程序后,我收到以下消息并且我的 qml 太慢了:

libEGL warning: DRI2: failed to authenticate
qt5ct: using qt5ct plugin
JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
inotify_add_watch("/home/pi/.config/qt5ct") failed: "No such file or directory"

我还启用了 openGL 驱动程序并向 .pro 添加了 QMAKE_CXXFLAGS += -mthumb-interwork -mthumb -march=armv7 标志,但没有帮助...

您可以尝试启用 Qt Quick Compiler

The Qt Quick Compiler is a development add-on for Qt Quick applications which allows you to compile QML source code into the final binary.

根据官方文档,您可以尝试最新版本的 Qt:

Since Qt version 5.11, the functionality of the Qt Quick Compiler has been integrated into the Qt Quick module itself. This separate add-on remains available in the earlier long term support releases of Qt.

如果您仍然想使用相同的版本,只需在您的 qmake 配置文件中添加:

CONFIG += qtquickcompiler

您还需要添加编译器标志,如 wiki 页面所述:

QMAKE_CXXFLAGS += -mthumb -mthumb-interwork

最后,按照以下步骤启用正确的驱动程序:

  1. 打开 raspi-config
  2. 转到高级选项
  3. 转到 GL 驱动程序
  4. 启用 GL(完整 KMS)