DocumentViewer: Streamline translation code
- Remove tr() calls from the viewer plugin init() functions
and call retranslate() from them to set the UI texts.
- Parent the QAction's on the viewer plugins instead
of the toolbars/menus and initialize them in the
viewer constructors (except UI texts).
- Remove the UI text parameters from the addToolBar()/addMenu()
functions.
- Remove the QMenu/QToolBar members from the viewer plugins
- Streamline the retranslate() functions, check only
once for the presence of the toolbars to detect
whether initialization has happened.
Pick-to: 6.11
Change-Id: I1a9d25b8bde755cf24a6957ee39ee28b535d79bc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Masoud Jami <masoud.jami@qt.io>
| commit | 5dd9b80a7c504c3993da5a32faf41101160dbfc0 |
| parent | 3dd226340236c0edad92d80203d13dedb027c36a |
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> |
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> |
| commit time | Thu, 9 Apr 2026 17:29:58 +0200 |
- M examples/demos/documentviewer/app/abstractviewer.cpp
- M examples/demos/documentviewer/app/abstractviewer.h
- M examples/demos/documentviewer/plugins/imageviewer/imageviewer.cpp
- M examples/demos/documentviewer/plugins/imageviewer/imageviewer.h
- M examples/demos/documentviewer/plugins/jsonviewer/jsonviewer.cpp
- M examples/demos/documentviewer/plugins/jsonviewer/jsonviewer.h
- M examples/demos/documentviewer/plugins/pdfviewer/pdfviewer.cpp
- M examples/demos/documentviewer/plugins/pdfviewer/pdfviewer.h
- M examples/demos/documentviewer/plugins/txtviewer/txtviewer.cpp
- M examples/demos/documentviewer/plugins/txtviewer/txtviewer.h