Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Windows HTML MIME
Forum Updated to NodeBB v4.3 + New Features

Windows HTML MIME

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 520 Views 1 Watching
  • 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.
  • UndeadBlowU Offline
    UndeadBlowU Offline
    UndeadBlow
    wrote on last edited by
    #1

    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
    0
    • UndeadBlowU Offline
      UndeadBlowU Offline
      UndeadBlow
      wrote on last edited by
      #2

      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
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved