KContacts::VCardDrag Namespace

namespace KContacts::VCardDrag

Utility function for implementing drag&drop for vCards. More...

Header: #include <KContacts/VCardDrag>
CMake: find_package(KF6 REQUIRED COMPONENTS Contacts)
target_link_libraries(mytarget PRIVATE KF6::Contacts)
Since: 4.5

Functions

bool canDecode(const QMimeData *md)
bool fromMimeData(const QMimeData *md, KContacts::Addressee::List &contacts)
bool fromMimeData(const QMimeData *md, QByteArray &content)
bool populateMimeData(QMimeData *md, const KContacts::Addressee::List &contacts)
bool populateMimeData(QMimeData *md, const QByteArray &content)

Detailed Description

See the Qt drag'n'drop documentation.

Function Documentation

bool VCardDrag::canDecode(const QMimeData *md)

Returns if drag&drop object can be decoded to vCard.

md the object to check for vCard data

Returns true if the given data object contains a vCard MIME type, otherwise false

bool VCardDrag::fromMimeData(const QMimeData *md, KContacts::Addressee::List &contacts)

Decodes the MIME data md and puts the resulting vCard into contacts.

md the object to check for vCard data

contacts where to put the parsed vCards from @p md

Returns true if there was data for the vCard MIME type and it could be parsed successfully, otherwise false

See also canDecode().

bool VCardDrag::fromMimeData(const QMimeData *md, QByteArray &content)

Decodes the drag&drop object to vCard component content.

md the object to check for vCard data

content where to put the vCard data from md

Returns true if there was data for the vCard MIME type, otherwise false

See also canDecode().

bool VCardDrag::populateMimeData(QMimeData *md, const KContacts::Addressee::List &contacts)

Adds the vCard representation as data of the drag object.

md the object to set the data on

contacts list of Addressee objects to serialize to vCard

Returns true if serializing of the given list worked, otherwise false

See also VCardConverter::createVCards().

bool VCardDrag::populateMimeData(QMimeData *md, const QByteArray &content)

Adds the vCard representation as data of the drag object.

md the object to set the data on

content the vCard data to set

Always returns true