Qt modules have a feature system to enable or disable features. I.e. you can compile qtdeclarative without networking by calling inside qtdeclarative
Qt's Yocto recipes should directly support enabling and disabling features for custom projects, i.e. by evaluating a 'features' variable that can be set in a .bbappend file.