'What are the configure options for Qt that enable dead keys usage?

I use a bare Ubuntu LTS 16.04 vm to create an AppImage for one of my projects. I create a minimalistic static Qt for this, so that the AppImage's size is as small as possible. I recently managed to build a static Qt 5.14.2 with the following configure options:

../configure -prefix ~/Qt/5.14.2_static -opensource -confirm-license -release -static -optimize-size -no-opengl -no-gif -no-ico -no-libjpeg -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtxmlpatterns -nomake examples -nomake tests -nomake tools -qt-zlib -sql-sqlite -qt-sqlite -qt-libpng -qt-pcre -qt-xcb

Building my program and an AppImage works, I noticed however, that dead keys don't work. I use a German locale here, and pressing accent keys does nothing. E. g. when I input an ´ and an e into a QLineEdit, I simply get an e instead of é.

I first thought this was due to something missing in the vm, but when I do the same Qt build on my Gentoo host (where dead keys always have been working in Qt programs), I get the same result: the dead keys don't work. So most probably, this is due to wrong configuration.

I experimented with the -libinput, -xkb, -xkbcommon and -qt-harfbuzz configure switches, but I can't get dead keys to work.

Which configure options have to be set when building Qt so that dead keys work?

Edit: When I build Qt with this exact configure statement, but the shared version instead of the static one, the dead keys work. What does cause this?



Solution 1:[1]

This happened due to a missing QTPLUGIN parameter. Imho this is almost impossible to figure out, but easy to solve:

Adding QTPLUGIN += composeplatforminputcontextplugin to the .pro file does the trick. Q_IMPORT_PLUGIN(QComposePlatformInputContextPlugin) appears automatically in project_plugin_import.cpp.

Doing so, the dead keys work as expected with a static build.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tobias Leupold