Revise QTBUG-40585 patch.

Make the original QTBUG-40585 patch more solid. This delivery also includes a patch adding Qt support for OS X 10.10/Yosemite macros, which will hopefully make Qt behave a little better under Yosemite.