Hi,
I develop an application that I want to copy tables of data to clipboard for pasting in OOCalc.
Searching through the forum and on the internet I found that a tabular csv form is needed with MIME type "text/plain".
Each column is separated with \t and each row with \n.
I format my table string to:
"1"\t"2"\t"3"\n
"4"\t"5"\t"6"\n
and set the qmimedata to "text/plain" and set the qmimedata object to QClipboard:
m_scene->writeCSVDocument(m_scene->selection,s);
qDebug()<<"csv:"<<s;
mimeData->setData("text/plain",s.toUtf8());
cb->setMimeData(mimeData);
QString s;
m_scene->writeCSVDocument(m_scene->selection,s);
qDebug()<<"csv:"<<s;
mimeData->setData("text/plain",s.toUtf8());
QClipboard* cb=KApplication::clipboard();
cb->setMimeData(mimeData);
To copy to clipboard, switch view to plain text mode
When I paste in OOCalc, a "Text/Import" window is popped up, and pressing "OK" , my table is transfered to OOCalc.
The thing is that I DON'T want the popping "Text/Import" window. I want my table data, to be processed by OOCalc, nativelly, and paste them directly on it, without the window.
The question is: Does anyone knows the internal native data format of OOCalc and the correct mimetype to use, so that OOCalc sees the data like its own, and not to try to import them?
Thank you in advance.
Bookmarks