Could it be possible to have the GUI part of QT4.x not being built when USE=-X? It seems to be possible: http://doc.trolltech.com/4.1/qt4-intro.html#build-system and that would be cool to be able to install GUI-less QT applications running without having to install X.
It's not possible directly. If you provide a patch I'd be happy to look and incorporate it, but it would require some major patching. The Qt build system doesn't support it directly, however.
Well, I'm right installing a brand new system. I'll play with the 4.1.0-r2 ebuild to check if it can compile without X11 when I disable all X related configuration option... if it works I'll post the modifications here. If not, I'll eventually check if I can patch deeper over the weekend. Else.... let's hope that deinstalling xorg after the QT4 installation doesn't cause problems with guiless apps...
Well. It's not possible :-( I achieved to skip the gui part by adjusting the configuration phase and by patching some .pro files, but the install phase fails because it needs some tools that link against the gui part. So... the only solution would be to compile with gui, to install and then to remove all was is not needed. Well, I'll forget this idea except if someone else is interested too.