| 721 | } |
| 722 | |
| 723 | QMimeData *UBDocumentTreeModel::mimeData (const QModelIndexList &indexes) const |
| 724 | { |
| 725 | UBDocumentTreeMimeData *mimeData = new UBDocumentTreeMimeData(); |
| 726 | QList <QModelIndex> indexList; |
| 727 | QList<QUrl> urlList; |
| 728 | |
| 729 | foreach (QModelIndex index, indexes) { |
| 730 | if (index.isValid()) { |
| 731 | indexList.append(index); |
| 732 | urlList.append(QUrl()); |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | #if defined(Q_OS_OSX) |
| 737 | #if (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) |
| 738 | if (QOperatingSystemVersion::current().majorVersion() == 10 && QOperatingSystemVersion::current().minorVersion() < 15) /* <= Mojave */ |
| 739 | mimeData->setUrls(urlList); |
| 740 | #endif |
| 741 | #else |
| 742 | mimeData->setUrls(urlList); |
| 743 | #endif |
| 744 | mimeData->setIndexes(indexList); |
| 745 | |
| 746 | return mimeData; |
| 747 | } |
| 748 | |
| 749 | bool UBDocumentTreeModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) |
| 750 | { |
no test coverage detected