Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Bold text disappears when changing translation and default font
Forum Updated to NodeBB v4.3 + New Features

Bold text disappears when changing translation and default font

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 739 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.
  • U Offline
    U Offline
    uroller
    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
    • U Offline
      U Offline
      uroller
      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 Extensions
      • Unsolved