Important: Please read the Qt Code of Conduct -


  • Hi guys.
    I need simple task, to paste rich text via clipboard. I have html.
    Code like this works on Linux perfectly:

    auto*mime=new QMimeData();
    mime->setData( "text/html" ,  "<i>F</i><b>o</b><u>o</u>" );

    but on Windows that works only for Word, but for example in Google Docs doesn't works.
    But if paste in Word and then copy from it, GDocs works after that. I've tried to check, what mime types Word used for make that working, and there were some mad types like windows-application-x\type=Rich Text, some binary formats.
    I found that there is WinMime API in Qt, but it is abstract and not implemented.

    What can I do with that? Maybe some convert or some additional lib?

  • Ok, problem was HTML in Windows, not Qt. More precisely speaking, Chrome on Windows process HTML correctly only if HTML is inside <html><body></html></body>. On Linux works without it.

Log in to reply