Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]Application calling many plugins (dlls) - do each of the dlls need to have a QTranslator (and a QApplication)
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.4k Views
  • 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 Offline
    D Offline
    Dolphin
    wrote on last edited by
    #1

    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
    0
    • M Offline
      M Offline
      MuldeR
      wrote on last edited by
      #2

      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
      0
      • D Offline
        D Offline
        Dolphin
        wrote on last edited by
        #3

        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
        0

        • Login

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