Fix issue with GDB printer tests when running on the KDE CI.
The compiler optimizes more aggressively there than on my machine
and thus changes the behavior of the tests.
Also, the Qt pretty printer did not follow the code stricly, which
is now fixed.