MCPcopy Create free account
hub / github.com/YACReader/yacreader / mimeData

Method mimeData

YACReaderLibrary/db/comic_model.cpp:218–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218QMimeData *ComicModel::mimeData(const QModelIndexList &indexes) const
219{
220 // custom model data
221 // application/yacreader-comics-ids + list of ids in a QByteArray
222 QList<qulonglong> ids;
223 for (const auto &index : indexes) {
224 QLOG_DEBUG() << "dragging : " << index.data(IdRole).toULongLong();
225 ids << index.data(IdRole).toULongLong();
226 }
227
228 QByteArray data;
229 QDataStream out(&data, QIODevice::WriteOnly);
230 out << ids; // serialize the list of identifiers
231
232 auto mimeData = new QMimeData();
233 mimeData->setData(YACReader::YACReaderLibrarComiscSelectionMimeDataFormat, data);
234
235 return mimeData;
236}
237
238QStringList ComicModel::mimeTypes() const
239{

Callers 15

performDragMethod · 0.45
dragEnterEventMethod · 0.45
dragMoveEventMethod · 0.45
dropEventMethod · 0.45
dragEnterEventMethod · 0.45
dragMoveEventMethod · 0.45
dropEventMethod · 0.45
dropEventMethod · 0.45
dragEnterEventMethod · 0.45
dragMoveEventMethod · 0.45
dragEnterEventMethod · 0.45
dropEventMethod · 0.45

Calls 2

dataMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected