Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [SOLVED]Application calling many plugins (dlls) - do each of the dlls need to have a QTranslator (and a QApplication)

    General and Desktop
    2
    3
    2163
    Loading More Posts
    • 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.
    • D
      Dolphin last edited by

      The exe runs a menu structure which is used to load plugins/addons/dlls whatever you want to call them. Do they each need a QTranslator and if so do they each need a QApplication - each dll has its own translation file.

      1 Reply Last reply Reply Quote 0
      • M
        MuldeR last edited by

        I think there should be exactly one instance of QApplication in your application. Create it in your "main" EXE and let the Plugin-DLL's get the single instance via the static function QApplication::instance().

        Furthermore, I think each plug-in DLL will need its own translation and thus its own translator, because only the plug-in DLL can know which strings it contains and how they need to be translated, i.e. there will be a separate .ts and thus a spearate .qm file for each plug-in DLL, probably compiled into the individual DLL as a resource...

        --

        From the docs:

        bq. Multiple translation files can be installed. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched first and the first translation file installed is searched last. The search stops as soon as a translation containing a matching string is found.

        My OpenSource software at: http://muldersoft.com/

        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

        Go visit the coop: http://youtu.be/Jay...

        1 Reply Last reply Reply Quote 0
        • D
          Dolphin last edited by

          Thanks. I thought that was the case.

          My plan was to give each addin a Translator my difficulty then is how do I account for the QML translation? Information is passed to the QML from c++ side, loading the pro translation gives me those strings but I have to translate the QML strings too - is it just a question of putting all strings in QML or c++?

          Ahhhh, I cracked it

          @
          lupdate_only
          {
          SOURCES = main.qml
          MainPage.qml
          }@

          1 Reply Last reply Reply Quote 0
          • First post
            Last post