diff options
author | Andreas Eliasson <andreas.eliasson@qt.io> | 2023-09-12 13:24:17 +0200 |
---|---|---|
committer | Andreas Eliasson <andreas.eliasson@qt.io> | 2023-09-13 13:23:10 +0200 |
commit | f73c768bb41d453c17adc55f7090e869720d4473 (patch) | |
tree | c961693d53c517dfd9b077e0bd48b7a6618546ee /doc/src/snippets | |
parent | 8a9b3567a316036590855f688a5f1a67578abe9b (diff) |
Doc: Mention retranslateUi() in source code translation page
When using Qt Widgets with uic, inform the user of the ui.retranslateUi
function. Also, add code snippet to clarify how to use the function.
Fixes: QTBUG-110846
Pick-to: 6.6 6.5
Change-Id: I67a01fe5fbda47124396792bd2198bdf908838c2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/code/doc_src_i18n.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/src/snippets/code/doc_src_i18n.cpp b/doc/src/snippets/code/doc_src_i18n.cpp index 717c387fd..e488321d8 100644 --- a/doc/src/snippets/code/doc_src_i18n.cpp +++ b/doc/src/snippets/code/doc_src_i18n.cpp @@ -188,3 +188,14 @@ public: } }; //! [16] + + +//! [17] +void MyWidget::changeEvent(QEvent *event) +{ + if (event->type() == QEvent::LanguageChange) { + ui.retranslateUi(this); + } else + QWidget::changeEvent(event); +} +//! [17] |