qtui: Move code out of header files.