Qt 4.8
Classes | Functions | Variables
qbbclipboard.cpp File Reference
#include "qbbclipboard.h"
#include <QDebug>
#include <QMimeData>
#include <QStringList>
#include <clipboard/clipboard.h>
#include <errno.h>
#include "qbbclipboard.moc"

Go to the source code of this file.

Classes

class  QBBClipboard::MimeData
 

Functions

static QByteArray readClipboardBuff (const char *type)
 

Variables

static const char * typeList [] = {"text/html", "text/plain", "image/png", "image/jpeg", "application/x-color", 0}
 

Function Documentation

◆ readClipboardBuff()

static QByteArray readClipboardBuff ( const char *  type)
static

Definition at line 60 of file qbbclipboard.cpp.

Referenced by QBBClipboard::MimeData::retrieveData().

61 {
62  char *pbuffer;
63  if (is_clipboard_format_present(type) == 0) {
64  int size = get_clipboard_data(type, &pbuffer);
65  if (size != -1 && pbuffer) {
66  const QByteArray result = QByteArray(pbuffer, size);
67  free(pbuffer);
68  return result;
69  }
70  }
71 
72  return QByteArray();
73 }
int type
Definition: qmetatype.cpp:239
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135

Variable Documentation

◆ typeList

const char* typeList[] = {"text/html", "text/plain", "image/png", "image/jpeg", "application/x-color", 0}
static

Definition at line 58 of file qbbclipboard.cpp.

Referenced by QBBClipboard::MimeData::MimeData().