Contents > Appendix > Clipboard Format
Previous | Next

5.5 Clipboard Format

7yuv uses an internal clipboard format to copy&paste raw binary data without loosing information.

It is using Qt's clipboard mechanism via the QMimeData type. If you want to develop a Qt application that interoperates with 7yuv's copy&paste, you can refer to this format description:

Mime-type: application/x-7e-raw Mime data payload:

struct ClipRaw
{
    DWORD mSize;    //!< Size of data in bytes
    BYTE  mData[1]; //!< \a mSize bytes of embedded data
};

Code snipped to read clipboad:

const QMimeData* pData = QApplication::clipboard()->mimeData();

if (pData->hasFormat("application/x-7e-raw"))
{
    const QByteArray buffer = pData->data("application/x-7e-raw");
    const ClipRaw* pRawData = buffer.data();

    ... access data via pRawData
} 

http://datahammer.de
Previous | Next