I got this working in 6.2.3 recently. At first I was tripped up by the qrc path. Note that if you have something like:
qml.files = $$files(*.qml)
qml.prefix = /qml
fonts.files = $$files(fonts/*)
fonts.prefix = / # will automatically get directory name "fonts" as prefix
RESOURCES += qml fonts
in your .pro file, then Qt will expect to find qml files in the top-level directory, but their qrc path will have a "/qml" prefix. On the other hand it will expect to find ttf files in the fonts subdirectory, and still need to be accessed using a "/fonts" prefix.
So with the /pro above, this works for me in main.cpp:
QFontDatabase::addApplicationFont(":/fonts/Arial.ttf");
QFontDatabase::addApplicationFont(":/fonts/Arial Italic.ttf");
QFontDatabase::addApplicationFont(":/fonts/Arial Bold.ttf");
QFontDatabase::addApplicationFont(":/fonts/Arial Bold Italic.ttf");
returning 0, 1, 2 and 3 respectively.
Also remember to clean your build before re-building, because the qrc resource files might be pre-built by qmake.
PS. I'm not recommending anyone distribute Arial with your app. Do you own legal research.