Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Windows HTML MIME

    General and Desktop
    1
    2
    309
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • UndeadBlow
      UndeadBlow last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • UndeadBlow
        UndeadBlow last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post