November 28, 2011

Bareos Bareos
Lab Rat
11 posts

copy & paste for UserTextObjects in QTextEdit

 

Hi.
I work on a QTextEdit with some self created TextObjects. The TextObjects containing some QImages. I know that normaly “copy & past” don’t funktion with self created TextObjects. So I reimplemented the createMimeDataFromSelection(). In this Methode I replace my TextObjects with a normal QTextImageFormat, let QTextEdit creat my QMimeData and switch the Images back. Additional I write my QImage in an QTemoraryFile, so that other Programms like maybe MSWord could read the MimeData.

Okay, now my questions:

  • Are there a better way to implement the “copy & paste”-functionality for UserTextObjects or a better way to creat the MimeData?
  • Is there an other way to transfer the Images through the Clipboard without temporary Files?

0 replies

 
  ‹‹ How to disable antialiasing when drawing text      unavailable synchronous data using QSharedData ››

You must log in to post a reply. Not a member yet? Register here!