I think the qtpim equivalent is QTCONTACTS_USE_NAMESPACE.