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. Pasting Graphics From Word for Mac into Qt
Qt 6.11 is out! See what's new in the release blog

Pasting Graphics From Word for Mac into Qt

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

    In summary, copying a picture on Word for Mac (2011 tested) and then pasting through QClipboard fails. This is not strictly a bug in Qt or Word. I am looking for ANY advice on where to go with this issue.

    Qt (4.7.4 and 4.8.0 tested) removes support for the com.apple.pict clipboard format as it is apparently not supported on 64 bit versions of Mac OS. Based on my reading, this is a correct decision.

    Most applications seem to place a variety of picture formats on the clipboard including things like public.tiff. Unfortunately, Word for Mac does not - it only puts com.apple.pict. What it puts is valid, as other applications can paste it. Qt apps, however, look at the format and say "I don't know what to do". This means that

    QImage image = QApplication::clipboard()->image();

    returns a null image even when one is there.

    My understanding is that MacOS will accept com.apple.pict formats and silently changes them to a TIFF format internally. MacOS does not, however, update the UTI and still reports the data as com.apple.pict. I have not been able to confirm this.

    Creating my own QMacPasteboardMime type would solve the issue but I have had trouble - copying the examples buried in qmime_mac.cpp does not help as many of the symbols are not accessible. I initially tried to subclass QMacPasteboardMimeTiff and just change the format names - but again the QMacPasteboardMimeTiff class is not externally accessible.

    Any ideas welcome!

    1 Reply Last reply
    0
    • M Offline
      M Offline
      msx_br
      wrote on last edited by
      #2

      I understood your question, but i don't have a Mac to test your case...

      Btw you can look at:

      const QMimeData * QClipboard::mimeData ( Mode mode = Clipboard ) const

      and

      "QMimeData Class Reference":http://qt-project.org/doc/qt-4.7/QMimeData.html

      bq. On Windows, the MIME format does not always map directly to the clipboard formats. Qt provides QWindowsMime to map clipboard formats to open-standard MIME formats. Similarly, the QMacPasteboardMime maps MIME to Mac flavors.

      msx_br - Brazil (Netherlands)

      1 Reply Last reply
      0
      • E Offline
        E Offline
        efofex
        wrote on last edited by
        #3

        Thanks for the suggestion. Unfortunately, the issue seems to lie at a level below QMimeData. QMimeData never gets to see the data attached to com.apple.pict so there is noting to retrieve.

        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