If you are using older Ubuntu, your Ubuntu might only have im-switch, you could use
im-switch -s fcitx
or run language-selector from your desktop launcher.
You need to logout to get all setting works.
If you are using newer Ubuntu, your Ubuntu might use im-config instead of im-switch, you simply run im-config and choose the input method.
Due to a inconsistency variable check in im-switch, QT4_IM_MODULE is not exported.
1. Don't forget install fcitx-frontend-qt4
2. Install qt4-qtconfig, run qtconfig-qt4 and select fcitx in interface tab.