It's fairly easy to set an individual tag:
QContactTag tag;
tag.setTag(MY_TAG_NAME);
QContact contact = getTheContactFromSomewhere();
contact.saveDetail(&tag);
manager->saveContact(&contact);
(Though this is not suggested in the QContact or QContactTag documentation, so it's hard to guess.)
However, to discover if that tag exists, we need to get all tags and examine them all:
foreach (const QContactTag& tag, contact.details<QContactTag>())
{
if(tag.tag() == MY_TAG_NAME)
}
And this is not even suggested in the QContacts or QContactTag documentation.
In the end it's just a bool, so anything other than
void QContact::setTag(const QString& name, bool set = true);
and
bool QContact::hasTag() const
seems like architecture astronautism.