44 #include "private/qobject_p.h" 72 for (
int i=0; i<dataList.size(); i++) {
73 if (dataList.at(i).format ==
format) {
94 for (
int i=0; i<dataList.size(); i++) {
95 if (dataList.at(i).format ==
format) {
96 data = dataList.at(i).
data;
126 #ifndef QT_NO_TEXTCODEC 134 #endif // QT_NO_TEXTCODEC 155 for (
int i = 0; i < urls.
size(); ++i) {
169 switch(data.
type()) {
184 for (
int i = 0; i < list.
size(); ++i) {
319 for (
int i = 0; i < list.
size(); ++i) {
338 for (
int i = 0; i < urls.
size(); ++i)
583 for (
int i=0; i<
d->dataList.size(); i++)
584 list +=
d->dataList.at(i).format;
607 return d->getData(mimeType);
630 d->removeData(mimeType);
The QVariant class acts like a union for the most common Qt data types.
bool hasUrls() const
Returns true if the object can return a list of urls; otherwise returns false.
void chop(int n)
Removes n bytes from the end of the byte array.
void setData(const QString &mimetype, const QByteArray &data)
Sets the data associated with the MIME type given by mimeType to the specified data.
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.
void removeData(const QString &format)
void setImageData(const QVariant &image)
Sets the data in the object to the given image.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
QVariant colorData() const
Returns a color if the data stored in the object represents a color (MIME type application/x-color); ...
bool hasHtml() const
Returns true if the object can return HTML (MIME type text/html); otherwise returns false...
The QByteArray class provides an array of bytes.
void setColorData(const QVariant &color)
Sets the color data in the object to the given color.
void removeFormat(const QString &mimetype)
Removes the data entry for mimeType in the object.
static QTextCodec * codecForHtml(const QByteArray &ba)
Tries to detect the encoding of the provided snippet of HTML in the given byte array, ba, by checking the BOM (Byte Order Mark) and the content-type meta header and returns a QTextCodec instance that is capable of decoding the html to unicode.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
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...
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QS...
QList< QMimeDataStruct > dataList
QVariant getData(const QString &format) const
QMimeData()
Constructs a new MIME data object with no data in it.
void append(const T &t)
Inserts value at the end of the list.
QVariant retrieveTypedData(const QString &format, QVariant::Type type) const
#define QT_BEGIN_NAMESPACE
This macro expands to.
QString text() const
Returns a plain text (MIME type text/plain) representation of the data.
static bool setData(const QByteArray &data, STGMEDIUM *pmedium)
QByteArray trimmed() const
Returns a byte array that has whitespace removed from the start and the end.
const T & at(int i) const
Returns the item at index position i in the list.
QString html() const
Returns a string if the data stored in the object is HTML (MIME type text/html); otherwise returns an...
The QStringList class provides a list of strings.
void setUrls(const QList< QUrl > &urls)
Sets the URLs stored in the MIME data object to those specified by urls.
static QTextCodec * codec(MYSQL *mysql)
Type
This enum type defines the types of variable that a QVariant can contain.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
QList< QUrl > urls() const
Returns a list of URLs contained within the MIME data object.
The QMimeData class provides a container for data that records information about its MIME type...
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
~QMimeData()
Destroys the MIME data object.
bool convert(Type t)
Casts the variant to the requested type, t.
QByteArray toEncoded(FormattingOptions options=None) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
QVariant imageData() const
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null varia...
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
virtual bool hasFormat(const QString &mimetype) const
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns...
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
#define Q_DECLARE_PUBLIC(Class)
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...
Type type() const
Returns the storage type of the value stored in the variant.
void setHtml(const QString &html)
Sets html as the HTML (MIME type text/html) used to represent the data.
bool hasText() const
Returns true if the object can return plain text (MIME type text/plain); otherwise returns false...
int size() const
Returns the number of items in the list.
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
bool hasColor() const
Returns true if the object can return a color (MIME type application/x-color); otherwise returns fals...
void setText(const QString &text)
Sets text as the plain text (MIME type text/plain) used to represent the data.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
static QUrl fromEncoded(const QByteArray &url)
Parses input and returns the corresponding QUrl.
void setData(const QString &format, const QVariant &data)
The QTextCodec class provides conversions between text encodings.
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static QByteArray getData(int cf, IDataObject *pDataObj)
bool endsWith(const QByteArray &a) const
Returns true if this byte array ends with byte array ba; otherwise returns false. ...