+ Reply to Thread
Results 1 to 1 of 1

Thread: Copy a custom image to clip board

  1. #1
    Join Date
    Jul 2017
    Posts
    16
    Qt products
    Qt5
    Platforms
    Windows

    Default Copy a custom image to clip board

    I have the following code on my program, when the button is clicked it supposed to copy the document on the clipboard, but does nothing. Am i missing something to make this work?

    Qt Code:
    1. void DocumentQueue::on_clipboard_clicked()
    2. {
    3. QMimeData *pdfDocument = new QMimeData();
    4. pdfDocument->setData("application/pdf",mDocImage);
    5.  
    6. QClipboard *comOperClipBoard= QApplication::clipboard();
    7. comOperClipBoard->setMimeData(pdfDocument);
    8. }
    To copy to clipboard, switch view to plain text mode 

    Just for the heck of it i changed the "application/pdf" for "text/plain" and the document is copied to the clipboard (is just garbage when pasted) so this tells me that the problem has to be with the declaration of Mime object or the way that is passed to the clipboard.
    Last edited by dan3460; 13th September 2017 at 18:22. Reason: updated contents

+ Reply to Thread

Similar Threads

  1. How can I copy image from anohter image
    By chong_kimkeang in forum Newbie
    Replies: 12
    Last Post: 27th September 2012, 11:05
  2. Colibri Board -> Windows CE (Custom SDK) -> Qt 4.7.3 -> LINKER Problem!! :/
    By snospmis_eht in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 6th May 2011, 17:16
  3. Clip/crop/cut an image
    By greenvirag in forum Qt Programming
    Replies: 3
    Last Post: 15th November 2008, 13:29
  4. Image for Board
    By AP.Sakkthivel in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 18th April 2006, 09:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts