Wednesday, August 8, 2018

Qt on Raspberry: QFontDatabase error

After deploying a cross-compiled Qt application for the Raspberry Pi boards (by following this guide), this error message appears:

QFontDatabase: Cannot find font directory /usr/local/qt5pi/lib/fonts.
Note that Qt no longer ships fonts. Deploy some (from http://dejavu-fonts.org for example) or switch to fontconfig.

The solution I found was to make a symbolic link from existing fonts on the RPi to the location Qt framework usually expects them:

ln -snf /usr/share/fonts/truetype/dejavu /usr/local/Qt5pi/lib/fonts

And it worked !!!!

No comments:

Post a Comment