Fcitx 'no input window' in at least some qt applications

I’m getting odd behaviour with fcitx in qt applications like LibreOffice, Kate, and TexStudio, where fcitx simply refuses to believe there’s an input window for it to activate and input things into - mousing over the tray icon reports ‘no input window’, and I can’t activate any input method editor; all I get is plain text input. Doing some research has suggested that this might be because system environment variables aren’t set right; fcitx-diagnose reports that all of ${XMODIFIERS}, ${QT4_IM_MODULE}, ${QT_IM_MODULE}, and ${GTK_IM_MODULE} are unset. But it’s not clear to me what the correct procedure is to set them; different posts claim different locations, some of which I think are outdated now (e.g. ~/.pam_environment).

What’s the correct file to place those environment variable settings (e.g. QT_IM_MODULE=fcitx), and if I place those settings there, will that solve my problem? (Will I need to reboot after altering whatever file?)

EDIT - solved; yep, /etc/environment is the correct place and a reboot causes everything to work properly. Hooray!