Windows HTML MIME



  • 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->setText("Foo"); 
    mime->setData( "text/html" ,  "<i>F</i><b>o</b><u>o</u>" );
    
    auto*clip=QApplication::clipboard();
    clip->clear();
    clip->setMimeData(mime);
    

    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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.