After taking a closer look i can say that my previous comments were wrong
Also i can say that dead keys do work in Qt5, when using ibus and installing the corresponding input method engine. For latin languages that would be "sudo apt-get install ibus ibus-m17n m17n-db m17n-contrib". In steps:
1) install the packages mentioned above;
2) restart ibus-daemon;
3) run "ibus-setup" from command line;
4) select French language as input method;
5) start a Qt application and start using dead keys;
Problem with this is that it doesn't work just out-of-the-box. I am wondering if this is an intended behaviour?
Regarding the XIM code from qt4.x, i think its intentionally left behind, since ibus supports it internally.
The way to improve this in my opinion is:
1) start ibus-daemon on demand when Qt app starts (is this possible?)
2) load/unload IM engine on daemon programmatically
Regarding step 2, i think we already have an API for that in qibusinputcontextproxy.h:
inline QDBusPendingReply<> SetEngine(const QString &name)
inline QDBusPendingReply<QDBusVariant> GetEngine()