Handle QtDeclarative correctly for both Qt major versions.
Fix Qt4 build, and make this argument a const reference.