Cocoa: use defaultPixmap() if pixmap is not set for drag

Task-number: QTBUG-26971

Change-Id: I6aed56a6b292c5aeebf38278d2a1fa982346c909
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Teemu Katajisto 2012-10-16 12:06:14 +03:00 committed by The Qt Project
parent 8fdef974b7
commit 4135951ae8

View File

@ -119,7 +119,11 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
m_drag = o;
m_executed_drop_action = Qt::IgnoreAction;
NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(m_drag->pixmap()));
QPixmap pm = m_drag->pixmap();
if (pm.isNull())
pm = defaultPixmap();
NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(pm));
QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacPasteboardMime::MIME_DND);
m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));