Important: Please read the Qt Code of Conduct -

QClipboard problem

  • In my application i have to copy data to clipboard in text, RTF(Microsoft) and image formats. I copy RTF data like so:

    @ QMimeData* mimeData = new QMimeData();
    QByteArray ba;
    ba.append("{\rtf1\ansi\pard\plain some{\ul text}}");
    mimeData->setData("Rich Text Format", ba);

    Then I paste data in Microsoft Word - it work fine. But after that if I copy data in clipboard in any other format (text, image) and paste it in Word, I view only few strange symbols, but copy-paste RTF data continue to work correct. In WordPad all formats work correctly.
    Drag-and-drop data from my application work correctly only if I don't try drag-and-drop RTF data, in other case drag-and-drop data in any other formats does not work neither in Word nor in WordPad(few symbols), but drag-and-drop RTF data continue to work correct. Sometimes droping not- RTF data to Word or WordPad cause crash.
    In both cases(clipboard and drag-and-drop ), the incorrect operation starts only after working with RTF format.

    Please help me to fix this problem
    P.S. I use QT 4.3.2

  • You should be using the standard MIME formats (list "here": )

Log in to reply