-2

I am a total beginner in QT, I am trying to add a customized font that I can use in my GUI but I couldn't. Any help please? I have already added the font to my Resources file but I don't know what to do next in order to use it.

piet.t
  • 11,718
  • 21
  • 43
  • 52
  • I think the QT documentation should be able to help you more than this forum. – StarShine Nov 17 '20 at 10:11
  • 3
    Does this answer your question? [Add a custom font in Qt](https://stackoverflow.com/questions/8687653/add-a-custom-font-in-qt) – Botje Nov 17 '20 at 10:16

1 Answers1

1
QFontDatabase::addApplicationFont(":/fonts/greatvibes.otf");
QFont myCustomFont("Great Vibes", 14, QFont::Normal);
ui->label->setFont(myCustomFont);
  • Thanks for your answer, I have already tried that but it didn't change anything. I think the problem might be in the font I have downloaded. – Mehdi bedoui Nov 17 '20 at 10:55