Hmm, well its a long time ago I did something with X-windows where Qt had its roots, but I do remember that there used to be some widget (desktop?) from which you could inherit properties about the underlying system environment.
That said: unless one is a purist, I think it hardly justifies the effort to make it work for the above mentioned trivial issue.