44 #ifndef QT_NO_CLIPBOARD 50 #include <QStringList> 52 #include <clipboard/clipboard.h> 58 static const char *
typeList[] = {
"text/html",
"text/plain",
"image/png",
"image/jpeg",
"application/x-color", 0};
63 if (is_clipboard_format_present(type) == 0) {
64 int size = get_clipboard_data(type, &pbuffer);
65 if (size != -1 && pbuffer) {
86 for (
int i = 0;
typeList[i] != 0; ++i) {
99 #if defined(QBBCLIPBOARD_DEBUG) 106 const bool result = is_clipboard_format_present(mimetype.
toUtf8().
constData()) == 0;
107 #if defined(QBBCLIPBOARD_DEBUG) 122 #if defined(QBBCLIPBOARD_DEBUG) 148 #if defined(QBBCLIPBOARD_DEBUG) 149 qDebug() <<
Q_FUNC_INFO <<
"mimetype=" << mimetype <<
"preferredType=" << preferredType;
162 #if defined(QBBCLIPBOARD_DEBUG) 208 #if defined(QBBCLIPBOARD_DEBUG) 219 #if defined(QBBCLIPBOARD_DEBUG) 220 qDebug() <<
"QBB: set " << format <<
"to clipboard, size=" << buf.
size() <<
";ret=" << ret;
243 #include "qbbclipboard.moc" 245 #endif //QT_NO_CLIPBOARD The QVariant class acts like a union for the most common Qt data types.
Mode
This enum type is used to control which part of the system clipboard is used by QClipboard::mimeData(...
void setUserMimeData(QMimeData *userMimeData)
static QWaylandClipboard * clipboard
void clear()
Removes all the MIME type and data entries in the object.
#define QT_END_NAMESPACE
This macro expands to.
virtual QStringList formats() const
Returns a list of formats supported by the object.
QVariant qVariantFromValue(const T &)
char * data()
Returns a pointer to the data stored in the byte array.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
The QByteArray class provides an array of bytes.
MimeData(QBBClipboard *clipboard)
virtual QMimeData * mimeData(QClipboard::Mode mode=QClipboard::Clipboard)
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const
Returns a variant with the given type containing data for the MIME type specified by mimeType...
The QString class provides a Unicode character string.
QBBClipboard *const m_clipboard
bool hasFormat(const QString &mimetype) const
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns...
QStringList formats() const
Returns a list of formats supported by the object.
Q_CORE_EXPORT void qDebug(const char *,...)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QSet< QString > m_formatsToCheck
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
static const char * data(const QByteArray &arr)
Type
This enum type defines the types of variable that a QVariant can contain.
static const char * typeList[]
QMimeData * userMimeData()
The QMimeData class provides a container for data that records information about its MIME type...
const char * constData() const
Returns a pointer to the data stored in the byte array.
virtual void setMimeData(QMimeData *data, QClipboard::Mode mode=QClipboard::Clipboard)
virtual QVariant retrieveData(const QString &mimetype, QVariant::Type preferredType) const
Returns a variant with the given type containing data for the MIME type specified by mimeType...
int size() const
Returns the number of bytes in this byte array.
#define Q_FOREACH(variable, container)
Same as foreach(variable, container).
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray readClipboardBuff(const char *type)
QMimeData * m_userMimeData
void addFormatToCheck(const QString &format)