I want to add a custom font to my application, and I already added it to my resource file.

And my code is as follows:
int id = QFontDatabase::addApplicationFont(":/fonts/ae_AlMateen.ttf"); QMessageBox::information(this,"Message",QString::number(id));
Also the contents of the .qrc file.
<RCC> <qresource prefix="/fonts"> <file alias="ae_AlMateen">ae_AlMateen.ttf</file> </qresource> </RCC>
But the problem is that addApplicationFont always returns -1 .
Please note that when changing :/fonts/ae_AlMateen.ttf to the direct path ex: C://ae_AlMateen.ttf it works fine.
I want the font file to be integrated with the application executable so that the application does not need to attach a font file to it.
source share