Important: Please read the Qt Code of Conduct -

[SOLVED] [Qt5] crash when using qApp and installTranslator But working when using qApp and setFont

  • I would like to install my fonts and i have done the following:

    qApp->setFont(QFont("Helvetica Neue"));

    and this seems to work but when i do the same for translations it fails

    if (anitaTranslator->load("anita_nl", ":/translations/"))

    even though both use the same setup + because it tries to install the translator i know it has found the file and still crashes.

    another thing i find strange is that when doing this QGuiApplication *app = QGuiApplication::instance(); the compiler complains that it is getting a QCoreApplication instead of a QGuiApplication

    am i doing something wrong?

  • Ok i solved the issue, i was trying to access qApp with a GUI function outside the GUI thread or event loop ... once i made sure i did only run it on the GUI thread then everything is working.

Log in to reply