-
Bug
-
Resolution: Done
-
P2: Important
-
5.15, 6.1.0
-
-
d4039298e710b6b79c018589bcc2145e22e1d5aa (qt/qtdeclarative/dev) f51231164e7074bfcd4deea31e82428b31483e53 (qt/qtdeclarative/6.2)
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.
- relates to
-
QTBUG-84196 Crash when calling QQmlEngine::retranslate
-
- Closed
-
| For Gerrit Dashboard: QTBUG-96192 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 374316,1 | WIP: fine grained translation binding tracking | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
| 375491,8 | QQmlEngine: Fine grained translation binding tracking | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
| 375933,3 | QQmlEngine: Fine grained translation binding tracking | 6.2 | qt/qtdeclarative | Status: MERGED | +2 | 0 |