This problem happen to me also when trying to switch to xim using im-config.
$ printenv | grep -E '(_IM|XMOD)' CLUTTER_IM_MODULE=xim QT_IM_MODULE=ibus XMODIFIERS=@im=ibus QT4_IM_MODULE=xim GTK_IM_MODULE=xim
as you can see QT_IM_MODULE and XMODIFIERS still unchanged.
This problem happen to me also when trying to switch to xim using im-config.
$ printenv | grep -E '(_IM|XMOD)' IM_MODULE= xim
CLUTTER_
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
QT4_IM_MODULE=xim
GTK_IM_MODULE=xim
as you can see QT_IM_MODULE and XMODIFIERS still unchanged.