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?
void DocumentQueue::on_clipboard_clicked()
{
pdfDocument->setData("application/pdf",mDocImage);
comOperClipBoard->setMimeData(pdfDocument);
}
void DocumentQueue::on_clipboard_clicked()
{
QMimeData *pdfDocument = new QMimeData();
pdfDocument->setData("application/pdf",mDocImage);
QClipboard *comOperClipBoard= QApplication::clipboard();
comOperClipBoard->setMimeData(pdfDocument);
}
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.
Bookmarks