Add support for custom screen with env variable in Qt version.

Another version of #6937 for Qt