If you do: 
    QMailMessageIdList ids;
    for ( ...) {
        ids << someId;
    }
    QMailStore->updateMessagesMetaData(QMailMessageKey::id(ids), status, true);

then you'll only get get one DB operation, rather than one per message.