Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.7.1
-
None
-
Linux using LSB compilers
Description
When Qt is built with LSB compilers, it will typically reject Qt plugins that come with the operating system. This is related to how the build key is constructed, since the plugins are rejected because their build keys don't match that of Qt. Looking at the build keys involved, a Qt built with LSB compilers results in a build key something like "x86_64 linux lsb-g++ full-config". With a more traditional GCC build, the build key comes out something like "x86_64 linux g++-4 full-config". As you can see, the only difference is the "lsb-g++" compared to the "g++-4" part. However, the LSB compilers are just a front end for g++ and it can be argued that these two build keys could/should be considered as matching.
One of the nasty consequences of this problem is that if you build Qt and your applications with LSB compilers (which makes them more portable to a wider variety of linux flavours), they do not pick up any style-related plugins supplied by the operating system, so the application does not honour the user's preferred style. This can have a significant negative impact on the look of an application and the user (and developer!) is left wondering why their app looks the way it does.
Looking through the Qt source code logic in qlibrary.cpp, it would appear that there are cases where some parts of the build key are modified for special cases already. For example. the no-stl option is stripped out since it doesn't affect binary compatibility (according to the comment in the source). It would seem reasonable to add an additional special case to change "lsb-g++" to "g++-4" for the key matching algorithm (the "4" part could be replaced by the actual major GCC version for better robustness). Around line 715 of the Qt 4.7.1 qlibrary.cpp source would seem the right place to add a few lines similar to this:
#ifdef __GNUC__ key.replace("lsb-g++", "g++-" + QString::number(__GNUC__)); #endif
See QTBUG-16385 for additional context for building Qt with LSB compilers.