Copy to clipboard in C++? [duplicate]

牧云@^-^@ 提交于 2019-12-07 09:31:50

问题


I want to copy some string to clipboard in my C++ application. How can I do that? Also is it possible to copy the formatting as well? Thank You


回答1:


You said you use Qt in one of your comments.

Qt has the class QClipboard, which is what you want (bonus: this is cross-platform).

You can put almost anything you want, data is managed via MIME types. That means you can use your own data formatting in the clipboard, with a 'custom' MIME type. Note that formatting is usually done with html text (text/html), whereas plain text is in text/plain (for plain text Qt provides the function text()).



来源:https://stackoverflow.com/questions/15741811/copy-to-clipboard-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!