path: root/src/platformsupport/clipboard/
diff options
authorMorten Johan Sørvig <>2016-05-11 12:41:41 +0200
committerMorten Johan Sørvig <>2016-05-18 19:09:55 +0000
commitd16692ed1b12b2d464afcb32799580402e82e393 (patch)
tree8ef9a8d935cb16a70efc1289ee679f8a8c10814a /src/platformsupport/clipboard/
parentf162e29acca99aaab173fb323d112aad9ec6c2b5 (diff)
Cocoa: Allow pasting text from Qt apps to Mail
Apple Mail will pick up and attempt to use the vCard flavor, which then fails since the data Qt placed on the clipboard is not actually a valid vCard. Place data in the vCard format on the clipboard only if the mime type is “text/vcard”. [ChangeLog][OS X] Pasting text from Qt applications to Apple Mail now works. [ChangeLog][OS X] “text/vcard” is now required as the mime type when placing vCards on the clipboard. Task-number: QTBUG-48953 Change-Id: Id029b20317f2c5ad8ae225912484de3c97498d29 Reviewed-by: Timur Pocheptsov <> Reviewed-by: Jake Petroules <> Reviewed-by: Gabriel de Dietrich <>
Diffstat (limited to 'src/platformsupport/clipboard/')
1 files changed, 4 insertions, 4 deletions
diff --git a/src/platformsupport/clipboard/ b/src/platformsupport/clipboard/
index dbb7e6f754..317648956c 100644
--- a/src/platformsupport/clipboard/
+++ b/src/platformsupport/clipboard/
@@ -748,7 +748,7 @@ bool QMacPasteboardMimeVCard::canConvert(const QString &mime, QString flav)
QString QMacPasteboardMimeVCard::flavorFor(const QString &mime)
- if (mime.startsWith(QLatin1String("text/plain")))
+ if (mime.startsWith(QLatin1String("text/vcard")))
return QLatin1String("public.vcard");
return QString();
@@ -756,14 +756,14 @@ QString QMacPasteboardMimeVCard::flavorFor(const QString &mime)
QString QMacPasteboardMimeVCard::mimeFor(QString flav)
if (flav == QLatin1String("public.vcard"))
- return QLatin1String("text/plain");
+ return QLatin1String("text/vcard");
return QString();
QVariant QMacPasteboardMimeVCard::convertToMime(const QString &mime, QList<QByteArray> data, QString)
QByteArray cards;
- if (mime == QLatin1String("text/plain")) {
+ if (mime == QLatin1String("text/vcard")) {
for (int i=0; i<data.size(); ++i)
cards += data[i];
@@ -773,7 +773,7 @@ QVariant QMacPasteboardMimeVCard::convertToMime(const QString &mime, QList<QByte
QList<QByteArray> QMacPasteboardMimeVCard::convertFromMime(const QString &mime, QVariant data, QString)
QList<QByteArray> ret;
- if (mime == QLatin1String("text/plain"))
+ if (mime == QLatin1String("text/vcard"))
return ret;