Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Bold text disappears when changing translation and default font
Qt 6.12 LTS is out! See what's new in the release blog

Bold text disappears when changing translation and default font

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I am trying to change the language translations dynamically, using something like:

    @
    if (lang == "en")
    {
    if (translator)
    app->removeTranslator(translator);
    }
    else
    {
    translator->load(lang, "/translations");
    app->installTranslator(translator);
    QCoreApplication::installTranslator(translator);
    }

    if (lang == "ja")
    {
    QApplication::setFont(QFont("japanese"));
    }
    else
    {
    QApplication::setFont(defaultFont);
    }
    @

    This works well enough except when changing the default font to Japanese all of the text with font.bold disappears until the QML is reloaded.

    Is there something additional that needs to happen to change the default font for bold or something?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      This only seems to happen with the Japanese prerendered font bundled with Qt. Other TTF works okay.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt
      • Unsolved