title: Proper way to copy a QMimeData object
body: <p>I am developing a Qt application to store whatever goes through the clipboard so I can restore it later. My approach was to retrieve the <a href="http://qt-project.org/doc/qt-4.8/qmimedata.html" rel="noreferrer">QMimeData</a> from the <code>QApplication::clipboard()</code> and store it in a <code>QList&lt;QMimeData *&gt;</code>. As the data in the clipboard is volatile, I have to copy the QMimeData returned by <code>QClipboard::mimeData()</code>.
  There is no copy constructor for QMimeData so I figured that I would copy it like this :</p>
  
  <pre><code>const QMimeData * clipboardData = _clipboard-&gt;mimeData();
  QMimeData * mimeCopy = new QMimeData();
  
  foreach(const QString &amp; format, clipboardData-&gt;formats())
      mimeCopy-&gt;setData(format, clipboardData-&gt;data(format))
  </code></pre>
  
  <p>where <code>_clipboard</code> is the <code>QApplication::clipboard()</code>.</p>
  
  <p>This works relatively fine except for some application-specific MIME types. For example, I noticed that when I copy, restore and then paste a Skype message in a Skype conversation, the message is not "quoted" anymore. Does This proves that my copy is flawed ? Is there a better, more accurate way to copy QMimeData ?</p>
  
  <p>After some debugging, I found out that there are two formats in a Skype message mimedata.
  A <code>Text/Plain</code> type containing the text of the message itself and a <code>application/x-qt-windows-mime;value="SkypeMessageFragment"</code> type which contains some xml-like data. <a href="http://qt-project.org/doc/qt-4.8/qmimedata.html#platform-specific-mime-types" rel="noreferrer">Qt's documentation on MIME types</a> indicates that the <code>value="..."</code> describes how the data is encoded. Do I have to encode or decode something at some point to make my QMimeData's copy valid ?</p>