Support invokation of cv windows in parallel to a qt app

This brings in what was pull requested to the 2.4 branch in #3194. See that pull request's description for all the gory details.