Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96192

Performance concerns for a qmlengine->retranslate() call

    XMLWordPrintable

Details

    • All
    • d4039298e710b6b79c018589bcc2145e22e1d5aa (qt/qtdeclarative/dev) f51231164e7074bfcd4deea31e82428b31483e53 (qt/qtdeclarative/6.2)

    Description

        When we call qmlengine->retranslate() for a dynamic language translation, void QQmlContextData::refreshExpressions() in qqmlcontext.cpp will be called and re-evaluate (refresh) including "all" expressions regardless of language change.

      781 void QQmlContextData::refreshExpressions()
      782 {  
      783     bool isGlobal = (parent == nullptr);
      784    
      785     // For efficiency, we try and minimize the number of guards we have to create
      786     if (expressions_to_run(this, isGlobal) && childContexts) {
      787         QQmlGuardedContextData guard(this);
      788    
      789         childContexts->refreshExpressionsRecursive(isGlobal); 
      790    
      791         if (!guard.isNull() && expressions_to_run(this, isGlobal))
      792             refreshExpressionsRecursive(expressions);
      793    
      794     } else if (expressions_to_run(this, isGlobal)) {
      795 
      796         refreshExpressionsRecursive(expressions);
      797 
      798     } else if (childContexts) {
      799 
      800         childContexts->refreshExpressionsRecursive(isGlobal);
      801 
      802     }
      803 } 

       

      Although we can use trick such as https://wiki.qt.io/How_to_do_dynamic_translation_in_QML without qmlengine->retranslate() but it's not a general way.

       

      In particular, in a customer's specific environment, dozens of applications are simultaneously executed, so performance concerns are high.

       

      So I want to know if there are any plans for performance improvement.

      Attachments

        Issue Links

          Activity

            People

              fabiankosmale Fabian Kosmale
              seokhako Seokha Ko
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              16 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: