|
不需要你去delete释放。因为QClipboard::setMimeData本身就会发生所有权转移。你new出来的mimedata由clipboard管理了。你可以显式调用clipboard的clear函数清除。
void QClipboard::setMimeData(QMimeData *src, QClipboard::Mode mode = Clipboard)
Sets the clipboard data to 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 mode argument is used to control which part of the system clipboard is used. If mode is QClipboard::Clipboard, the data is stored in the global clipboard. If mode is QClipboard::Selection, the data is stored in the global mouse selection. If mode is QClipboard::FindBuffer, the data is stored in the search string buffer. |
|