clone of https://qt.gitorious.org/qt-solutions/qt-solutions/source/qtwinmigrate