void QClipboard::setMimeData(QMimeData* src, Mode mode) { QPlatformClipboard *clipboard = QGuiApplicationPrivate::platformIntegration()->clipboard(); if (!clipboard->supportsMode(mode)) return; clipboard->setMimeData(src,mode); }
/*! \fn void QClipboard::setMimeData(QMimeData *src, Mode mode) Sets the clipboard data to \a src. Ownership of the data is transferred to the clipboard. If you want to remove the data either call clear() or call setMimeData() again with new data. The \a mode argument is used to control which part of the system clipboard is used. If \a mode is QClipboard::Clipboard, the data is stored in the global clipboard. If \a mode is QClipboard::Selection, the data is stored in the global mouse selection. If \a mode is QClipboard::FindBuffer, the data is stored in the search string buffer. The setText(), setImage() and setPixmap() functions are simpler wrappers for setting text, image and pixmap data respectively. \sa mimeData() */ void QClipboard::setMimeData(QMimeData* src, Mode mode) { QPlatformClipboard *clipboard = QGuiApplicationPrivate::platformIntegration()->clipboard(); if (!clipboard->supportsMode(mode)) { if (src != 0) { qWarning("Data set on unsupported clipboard mode. QMimeData object will be deleted."); src->deleteLater(); } } else { clipboard->setMimeData(src,mode); } }