Qt 4.8
Public Functions | Static Public Functions | Protected Functions | List of all members
QInternalMimeData Class Referenceabstract

#include <qdnd_p.h>

Inheritance diagram for QInternalMimeData:
QMimeData QObject QClipboardWatcher QClipboardWatcher QCocoaDropData QDropData QWaylandMimeData QXlibMime QXlibClipboardMime

Public Functions

QStringList formats () const
 Returns a list of formats supported by the object. More...
 
bool hasFormat (const QString &mimeType) const
 Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns false. More...
 
 QInternalMimeData ()
 
 ~QInternalMimeData ()
 
- Public Functions inherited from QMimeData
void clear ()
 Removes all the MIME type and data entries in the object. More...
 
QVariant colorData () const
 Returns a color if the data stored in the object represents a color (MIME type application/x-color); otherwise returns a null variant. More...
 
QByteArray data (const QString &mimetype) const
 Returns the data stored in the object in the format described by the MIME type specified by mimeType. More...
 
bool hasColor () const
 Returns true if the object can return a color (MIME type application/x-color); otherwise returns false. More...
 
bool hasHtml () const
 Returns true if the object can return HTML (MIME type text/html); otherwise returns false. More...
 
bool hasImage () const
 Returns true if the object can return an image; otherwise returns false. More...
 
bool hasText () const
 Returns true if the object can return plain text (MIME type text/plain); otherwise returns false. More...
 
bool hasUrls () const
 Returns true if the object can return a list of urls; otherwise returns false. More...
 
QString html () const
 Returns a string if the data stored in the object is HTML (MIME type text/html); otherwise returns an empty string. More...
 
QVariant imageData () const
 Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null variant. More...
 
 QMimeData ()
 Constructs a new MIME data object with no data in it. More...
 
void removeFormat (const QString &mimetype)
 Removes the data entry for mimeType in the object. More...
 
void setColorData (const QVariant &color)
 Sets the color data in the object to the given color. More...
 
void setData (const QString &mimetype, const QByteArray &data)
 Sets the data associated with the MIME type given by mimeType to the specified data. More...
 
void setHtml (const QString &html)
 Sets html as the HTML (MIME type text/html) used to represent the data. More...
 
void setImageData (const QVariant &image)
 Sets the data in the object to the given image. More...
 
void setText (const QString &text)
 Sets text as the plain text (MIME type text/plain) used to represent the data. More...
 
void setUrls (const QList< QUrl > &urls)
 Sets the URLs stored in the MIME data object to those specified by urls. More...
 
QString text () const
 Returns a plain text (MIME type text/plain) representation of the data. More...
 
QList< QUrlurls () const
 Returns a list of URLs contained within the MIME data object. More...
 
 ~QMimeData ()
 Destroys the MIME data object. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Static Public Functions

static bool canReadData (const QString &mimeType)
 
static QStringList formatsHelper (const QMimeData *data)
 
static bool hasFormatHelper (const QString &mimeType, const QMimeData *data)
 
static QByteArray renderDataHelper (const QString &mimeType, const QMimeData *data)
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 

Protected Functions

virtual QStringList formats_sys () const =0
 
virtual bool hasFormat_sys (const QString &mimeType) const =0
 
QVariant retrieveData (const QString &mimeType, QVariant::Type type) const
 Returns a variant with the given type containing data for the MIME type specified by mimeType. More...
 
virtual QVariant retrieveData_sys (const QString &mimeType, QVariant::Type type) const =0
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 79 of file qdnd_p.h.

Constructors and Destructors

◆ QInternalMimeData()

QInternalMimeData::QInternalMimeData ( )

Definition at line 329 of file qdnd.cpp.

330  : QMimeData()
331 {
332 }
QMimeData()
Constructs a new MIME data object with no data in it.
Definition: qmimedata.cpp:291

◆ ~QInternalMimeData()

QInternalMimeData::~QInternalMimeData ( )

Definition at line 334 of file qdnd.cpp.

335 {
336 }

Functions

◆ canReadData()

bool QInternalMimeData::canReadData ( const QString mimeType)
static

Definition at line 408 of file qdnd.cpp.

Referenced by QLastResortMimes::mimeForFormat().

409 {
410  return imageReadMimeFormats().contains(mimeType);
411 }
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
static QStringList imageReadMimeFormats()
Definition: qdnd.cpp:292

◆ formats()

QStringList QInternalMimeData::formats ( ) const
virtual

Returns a list of formats supported by the object.

This is a list of MIME types for which the object can return suitable data. The formats in the list are in a priority order.

For the most common types of data, you can call the higher-level functions hasText(), hasHtml(), hasUrls(), hasImage(), and hasColor() instead.

See also
hasFormat(), setData(), data()

Reimplemented from QMimeData.

Definition at line 351 of file qdnd.cpp.

Referenced by QClipboardWatcher::empty(), QCocoaDropData::formats_sys(), QWaylandMimeData::hasFormat_sys(), QXlibClipboardMime::hasFormat_sys(), imageReadMimeFormats(), imageWriteMimeFormats(), and QXlibMime::mimeFormatsForAtom().

352 {
353  QStringList realFormats = formats_sys();
354  if (!realFormats.contains(QLatin1String("application/x-qt-image"))) {
355  QStringList imageFormats = imageReadMimeFormats();
356  for (int i = 0; i < imageFormats.size(); ++i) {
357  if (realFormats.contains(imageFormats.at(i))) {
358  realFormats += QLatin1String("application/x-qt-image");
359  break;
360  }
361  }
362  }
363  return realFormats;
364 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
virtual QStringList formats_sys() const =0
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static QStringList imageReadMimeFormats()
Definition: qdnd.cpp:292

◆ formats_sys()

virtual QStringList QInternalMimeData::formats_sys ( ) const
protectedpure virtual

◆ formatsHelper()

QStringList QInternalMimeData::formatsHelper ( const QMimeData data)
static

Definition at line 414 of file qdnd.cpp.

Referenced by QWindowsMime::allFormatsForMime(), findRealWindow(), send_targets_selection(), and QXlibClipboard::sendTargetsSelection().

415 {
416  QStringList realFormats = data->formats();
417  if (realFormats.contains(QLatin1String("application/x-qt-image"))) {
418  // add all supported image formats
419  QStringList imageFormats = imageWriteMimeFormats();
420  for (int i = 0; i < imageFormats.size(); ++i) {
421  if (!realFormats.contains(imageFormats.at(i)))
422  realFormats.append(imageFormats.at(i));
423  }
424  }
425  return realFormats;
426 }
virtual QStringList formats() const
Returns a list of formats supported by the object.
Definition: qmimedata.cpp:579
static QStringList imageWriteMimeFormats()
Definition: qdnd.cpp:311
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ hasFormat()

bool QInternalMimeData::hasFormat ( const QString mimeType) const
virtual

Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns false.

For the most common types of data, you can call the higher-level functions hasText(), hasHtml(), hasUrls(), hasImage(), and hasColor() instead.

See also
formats(), setData(), data()

Reimplemented from QMimeData.

Definition at line 338 of file qdnd.cpp.

339 {
340  bool foundFormat = hasFormat_sys(mimeType);
341  if (!foundFormat && mimeType == QLatin1String("application/x-qt-image")) {
342  QStringList imageFormats = imageReadMimeFormats();
343  for (int i = 0; i < imageFormats.size(); ++i) {
344  if ((foundFormat = hasFormat_sys(imageFormats.at(i))))
345  break;
346  }
347  }
348  return foundFormat;
349 }
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
static QStringList imageReadMimeFormats()
Definition: qdnd.cpp:292
virtual bool hasFormat_sys(const QString &mimeType) const =0

◆ hasFormat_sys()

virtual bool QInternalMimeData::hasFormat_sys ( const QString mimeType) const
protectedpure virtual

◆ hasFormatHelper()

bool QInternalMimeData::hasFormatHelper ( const QString mimeType,
const QMimeData data 
)
static

Definition at line 428 of file qdnd.cpp.

Referenced by QLastResortMimes::canConvertFromMime(), QXlibMime::mimeDataForAtom(), and QX11Data::xdndMimeDataForAtom().

429 {
430 
431  bool foundFormat = data->hasFormat(mimeType);
432  if (!foundFormat) {
433  if (mimeType == QLatin1String("application/x-qt-image")) {
434  // check all supported image formats
435  QStringList imageFormats = imageWriteMimeFormats();
436  for (int i = 0; i < imageFormats.size(); ++i) {
437  if ((foundFormat = data->hasFormat(imageFormats.at(i))))
438  break;
439  }
440  } else if (mimeType.startsWith(QLatin1String("image/"))) {
441  return data->hasImage() && imageWriteMimeFormats().contains(mimeType);
442  }
443  }
444  return foundFormat;
445 }
static QStringList imageWriteMimeFormats()
Definition: qdnd.cpp:311
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
Definition: qmimedata.cpp:471
virtual bool hasFormat(const QString &mimetype) const
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns...
Definition: qmimedata.cpp:563
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ renderDataHelper()

QByteArray QInternalMimeData::renderDataHelper ( const QString mimeType,
const QMimeData data 
)
static

Definition at line 447 of file qdnd.cpp.

Referenced by QBuiltInMimes::convertFromMime(), QLastResortMimes::convertFromMime(), QXlibMime::mimeDataForAtom(), and QX11Data::xdndMimeDataForAtom().

448 {
449  QByteArray ba;
450  if (mimeType == QLatin1String("application/x-color")) {
451  /* QMimeData can only provide colors as QColor or the name
452  of a color as a QByteArray or a QString. So we need to do
453  the conversion to application/x-color here.
454  The application/x-color format is :
455  type: application/x-color
456  format: 16
457  data[0]: red
458  data[1]: green
459  data[2]: blue
460  data[3]: opacity
461  */
462  ba.resize(8);
463  ushort * colBuf = (ushort *)ba.data();
464  QColor c = qvariant_cast<QColor>(data->colorData());
465  colBuf[0] = ushort(c.redF() * 0xFFFF);
466  colBuf[1] = ushort(c.greenF() * 0xFFFF);
467  colBuf[2] = ushort(c.blueF() * 0xFFFF);
468  colBuf[3] = ushort(c.alphaF() * 0xFFFF);
469  } else {
470  ba = data->data(mimeType);
471  if (ba.isEmpty()) {
472  if (mimeType == QLatin1String("application/x-qt-image") && data->hasImage()) {
473  QImage image = qvariant_cast<QImage>(data->imageData());
474  QBuffer buf(&ba);
475  buf.open(QBuffer::WriteOnly);
476  // would there not be PNG ??
477  image.save(&buf, "PNG");
478  } else if (mimeType.startsWith(QLatin1String("image/")) && data->hasImage()) {
479  QImage image = qvariant_cast<QImage>(data->imageData());
480  QBuffer buf(&ba);
481  buf.open(QBuffer::WriteOnly);
482  image.save(&buf, mimeType.mid(mimeType.indexOf(QLatin1Char('/')) + 1).toLatin1().toUpper());
483  }
484  }
485  }
486  return ba;
487 }
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
qreal alphaF() const
Returns the alpha color component of this color.
Definition: qcolor.cpp:1106
unsigned char c[8]
Definition: qnumeric_p.h:62
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
qreal greenF() const
Returns the green color component of this color.
Definition: qcolor.cpp:1241
QVariant colorData() const
Returns a color if the data stored in the object represents a color (MIME type application/x-color); ...
Definition: qmimedata.cpp:489
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
bool save(const QString &fileName, const char *format=0, int quality=-1) const
Saves the image to the file with the given fileName, using the given image file format and quality fa...
Definition: qimage.cpp:5346
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
Definition: qmimedata.cpp:524
The QBuffer class provides a QIODevice interface for a QByteArray.
Definition: qbuffer.h:57
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
QVariant imageData() const
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null varia...
Definition: qmimedata.cpp:442
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
Definition: qmimedata.cpp:471
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
unsigned short ushort
Definition: qglobal.h:995
qreal redF() const
Returns the red color component of this color.
Definition: qcolor.cpp:1213
void resize(int size)
Sets the size of the byte array to size bytes.
qreal blueF() const
Returns the blue color component of this color.
Definition: qcolor.cpp:1269
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ retrieveData()

QVariant QInternalMimeData::retrieveData ( const QString mimeType,
QVariant::Type  type 
) const
protectedvirtual

Returns a variant with the given type containing data for the MIME type specified by mimeType.

If the object does not support the MIME type or variant type given, a null variant is returned instead.

This function is called by the general data() getter and by the convenience getters (text(), html(), urls(), imageData(), and colorData()). You can reimplement it if you want to store your data using a custom data structure (instead of a QByteArray, which is what setData() provides). You would then also need to reimplement hasFormat() and formats().

See also
data()

Reimplemented from QMimeData.

Definition at line 366 of file qdnd.cpp.

367 {
368  QVariant data = retrieveData_sys(mimeType, type);
369  if (mimeType == QLatin1String("application/x-qt-image")) {
370  if (data.isNull() || (data.type() == QVariant::ByteArray && data.toByteArray().isEmpty())) {
371  // try to find an image
372  QStringList imageFormats = imageReadMimeFormats();
373  for (int i = 0; i < imageFormats.size(); ++i) {
374  data = retrieveData_sys(imageFormats.at(i), type);
375  if (data.isNull() || (data.type() == QVariant::ByteArray && data.toByteArray().isEmpty()))
376  continue;
377  break;
378  }
379  }
380  // we wanted some image type, but all we got was a byte array. Convert it to an image.
381  if (data.type() == QVariant::ByteArray
382  && (type == QVariant::Image || type == QVariant::Pixmap || type == QVariant::Bitmap))
383  data = QImage::fromData(data.toByteArray());
384 
385  } else if (mimeType == QLatin1String("application/x-color") && data.type() == QVariant::ByteArray) {
386  QColor c;
387  QByteArray ba = data.toByteArray();
388  if (ba.size() == 8) {
389  ushort * colBuf = (ushort *)ba.data();
390  c.setRgbF(qreal(colBuf[0]) / qreal(0xFFFF),
391  qreal(colBuf[1]) / qreal(0xFFFF),
392  qreal(colBuf[2]) / qreal(0xFFFF),
393  qreal(colBuf[3]) / qreal(0xFFFF));
394  data = c;
395  } else {
396  qWarning("Qt: Invalid color format");
397  }
398  } else if (data.type() != type && data.type() == QVariant::ByteArray) {
399  // try to use mime data's internal conversion stuf.
400  QInternalMimeData *that = const_cast<QInternalMimeData *>(this);
401  that->setData(mimeType, data.toByteArray());
402  data = QMimeData::retrieveData(mimeType, type);
403  that->clear();
404  }
405  return data;
406 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition: qcolor.h:67
void setData(const QString &mimetype, const QByteArray &data)
Sets the data associated with the MIME type given by mimeType to the specified data.
Definition: qmimedata.cpp:547
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
unsigned char c[8]
Definition: qnumeric_p.h:62
void clear()
Removes all the MIME type and data entries in the object.
Definition: qmimedata.cpp:613
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
Definition: qvariant.cpp:3102
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void setRgbF(qreal r, qreal g, qreal b, qreal a=1.0)
Sets the color channels of this color to r (red), g (green), b (blue) and a (alpha, transparency).
Definition: qcolor.cpp:954
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
Definition: qmimedata.cpp:524
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QS...
Definition: qvariant.cpp:2383
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
Q_CORE_EXPORT void qWarning(const char *,...)
unsigned short ushort
Definition: qglobal.h:995
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...
Definition: qmimedata.cpp:603
Type type() const
Returns the storage type of the value stored in the variant.
Definition: qvariant.cpp:1901
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
static QStringList imageReadMimeFormats()
Definition: qdnd.cpp:292
virtual QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const =0
static QImage fromData(const uchar *data, int size, const char *format=0)
Constructs a QImage from the first size bytes of the given binary data.
Definition: qimage.cpp:5313

◆ retrieveData_sys()

virtual QVariant QInternalMimeData::retrieveData_sys ( const QString mimeType,
QVariant::Type  type 
) const
protectedpure virtual

The documentation for this class was generated from the following files: