[qtdeclarative] cherry-pick relevant changes from upstream