Kai Köhne 095cacd668 Do not treat the installation of an empty QTranslator as an error
The return value of installTranslator() should indicate whether
the _registration_ was successful. Apart from merely logging
the result, the only sensible action the calling code might
take is to delete the QTranslator object that failed to register.

The old behavior of installTranslator() for empty QTranslator
objects was to store the pointer for further use, but still return
false. This might lead to hard-to-detect memory corruption.

The patch changes behavior to _not_ consider installing empty
QTranslator objects as an error.

This has the following reasons:

* As translations are often done later in the SW development process,
it is common to replace empty .qm files with translated
ones in a very late stage. But having different code paths based on
this can be surprising.

* The other parts of the QTranslator toolchain do not treat
empty translations in a specific way, either.

While at it, also remove the now unused QT_NO_TRANSLATION_BUILDER
macro (left over from Qt 4).

[ChangeLog][Core][Behavior Change] QCoreApplication::installTranslator()
will now return true even for empty translators
(QTranslator::isEmpty()). This makes it explicit that empty QTranslator
objects are registered and queried, and therefore deleting the object
prematurely might result in undefined behavior.

Change-Id: Ia0531afcf5c72aa837406cf5de2cf73052014445
Reviewed-by: Masoud Jami <masoud.jami@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2025-05-06 06:53:31 +00:00
2025-03-24 19:01:57 +02:00
2024-11-05 14:36:16 +01:00
2024-11-05 14:36:16 +01:00
2025-03-24 23:19:04 +01:00
2025-04-09 13:49:11 +02:00
2024-06-25 11:44:00 +02:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%