Patch to https://bugreports.qt-project.org/browse/QTBUG-35731