Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void QMimeData::setData ( const QString mimeType,
const QByteArray data 
) [inherited]

Sets the data associated with the MIME type given by mimeType to the specified data.

For the most common types of data, you can call the higher-level functions setText(), setHtml(), setUrls(), setImageData(), and setColorData() instead.

Note that if you want to use a custom data type in an item view drag and drop operation, you must register it as a Qt {QMetaType}{meta type}, using the Q_DECLARE_METATYPE() macro, and implement stream operators for it. The stream operators must then be registered with the qRegisterMetaTypeStreamOperators() function.

See also:
hasFormat(), QMetaType, qRegisterMetaTypeStreamOperators()

Definition at line 544 of file qmimedata.cpp.

Referenced by SourceWidget::createData(), Q3DragObject::drag(), Phonon::ObjectDescriptionModelData::mimeData(), PiecesModel::mimeData(), DragDropListModel::mimeData(), BookmarksModel::mimeData(), QAbstractItemModel::mimeData(), DragDropModel::mimeData(), QStandardItemModel::mimeData(), FinalWidget::mouseMoveEvent(), DragWidget::mouseMoveEvent(), TabBar::mouseMoveEvent(), PuzzleWidget::mousePressEvent(), QInternalMimeData::retrieveData(), and PiecesList::startDrag().

    d->setData(mimeType, QVariant(data));

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index