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. QClipboard problem
Qt 6.11 is out! See what's new in the release blog

QClipboard problem

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.8k 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.
  • D Offline
    D Offline
    de_bug
    wrote on last edited by
    #1

    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);
    QApplication::clipboard()->setMimeData(mimeData);@

    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

    1 Reply Last reply
    0
    • L Offline
      L Offline
      loladiro
      wrote on last edited by
      #2

      You should be using the standard MIME formats (list "here":http://www.w3schools.com/media/media_mimeref.asp )

      1 Reply Last reply
      0

      • Login

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