PyQt5 set multiple MIME Types in Clipboard

393 views Asked by At

I have been trying to create an HTML-Like table using PyQt5 in terms of copying functionality.

However, I am stuck at the following issue: when copying data from an HTML table and pasting to https://madebyevan.com/clipboard-test/, I get the following:

HTML table MIMES

There are two types of data listed, text/plain and text/html, which is my goal.

However, in PyQt5's QClipboard, I can only find QClipboard.setMimeData which uses a single QMimeData.

I was not able to define 2 MIME types in a single QMimeData object or use 2 different QMimeData objects in QClipboard.setMimeData.

Is there a way to have 2 MIME types in clipboard using QClipboard?

Why am I trying to do this?
I would like the same copied data to be paste-able in E-Mail software as a text/html table type but in Notepad as text/plain as text/html does not work there.

Useful links: https://doc.qt.io/qt-5/qclipboard.html https://doc.qt.io/qt-5/qmimedata.html

0

There are 0 answers