summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qclipboard_mac.cpp
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-02-09 17:12:12 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2010-02-10 09:07:52 (GMT)
commit52e46af04738af62ad0da0daa161de707ff855e0 (patch)
tree87e6b6c88a6383760cada3afc8789411f51f0947 /src/gui/kernel/qclipboard_mac.cpp
parentbd145e708d97ffb5a68bf53bbdf04b8df8ea4a9b (diff)
downloadQt-52e46af04738af62ad0da0daa161de707ff855e0.zip
Qt-52e46af04738af62ad0da0daa161de707ff855e0.tar.gz
Qt-52e46af04738af62ad0da0daa161de707ff855e0.tar.bz2
Cannot drag actions in Designer on Mac OS X/Cocoa.
QMimeData sub classes reimplementing the formats() might not expose the temporary "application/x-qt-mime-type-name" mimetype used by DnD. So make sure that the NSDragPboard PasteBoard will contain this dummy mime type. Task-number: QTBUG-7981 Reviewed-by: mortens
Diffstat (limited to 'src/gui/kernel/qclipboard_mac.cpp')
-rw-r--r--src/gui/kernel/qclipboard_mac.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/kernel/qclipboard_mac.cpp b/src/gui/kernel/qclipboard_mac.cpp
index f3a971d..49a6cc8 100644
--- a/src/gui/kernel/qclipboard_mac.cpp
+++ b/src/gui/kernel/qclipboard_mac.cpp
@@ -388,6 +388,18 @@ QMacPasteboard::setMimeData(QMimeData *mime_src)
clear_helper();
QStringList formats = mime_src->formats();
+#ifdef QT_MAC_USE_COCOA
+ // QMimeData sub classes reimplementing the formats() might not expose the
+ // temporary "application/x-qt-mime-type-name" mimetype. So check the existence
+ // of this mime type while doing drag and drop.
+ QString dummyMimeType(QLatin1String("application/x-qt-mime-type-name"));
+ if (!formats.contains(dummyMimeType)) {
+ QByteArray dummyType = mime_src->data(dummyMimeType);
+ if (!dummyType.isEmpty()) {
+ formats.append(dummyMimeType);
+ }
+ }
+#endif
for(int f = 0; f < formats.size(); ++f) {
QString mimeType = formats.at(f);
for (QList<QMacPasteboardMime *>::Iterator it = availableConverters.begin(); it != availableConverters.end(); ++it) {