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. Trigger QEvent::LanguageChange
Forum Updated to NodeBB v4.3 + New Features

Trigger QEvent::LanguageChange

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 588 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.
  • C Offline
    C Offline
    Circuits
    wrote on last edited by
    #1

    Is it possible to trigger QEvent::LanguageChange from QML. For instance, from a MouseArea's onClicked event?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #4

      I would created a class that handles the loading/unloading of QTranslator objects. You can then use an instance of it as a context property so you can call the method you want to change the language.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        From the looks of it, not directly, you'll need some C++. See here

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          From the looks of it, not directly, you'll need some C++. See here

          C Offline
          C Offline
          Circuits
          wrote on last edited by
          #3

          @SGaist Sorry, I am just getting back to this. So, I guess I am not seeing in the link you posted how I might trigger the event in C++ either. I have a signal, lets call it: currentLocaleChanged(); is there a simple way to connect that signal s/t it will trigger the event?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            I would created a class that handles the loading/unloading of QTranslator objects. You can then use an instance of it as a context property so you can call the method you want to change the language.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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