| 138 | } |
| 139 | |
| 140 | QMimeData* StructDetailModel::mimeData(const QModelIndexList& indexes) const |
| 141 | { |
| 142 | QMimeData* mimeData = new QMimeData; |
| 143 | QByteArray data; |
| 144 | |
| 145 | QDataStream stream(&data, QIODevice::WriteOnly); |
| 146 | |
| 147 | int startRow = indexes[0].row(); |
| 148 | int endRow = indexes.last().row(); |
| 149 | |
| 150 | stream << static_cast<int>(indexes[0].row()); |
| 151 | stream << static_cast<int>(endRow - startRow + 1); |
| 152 | |
| 153 | mimeData->setData("application/x-structfield", data); |
| 154 | return mimeData; |
| 155 | } |
| 156 | |
| 157 | bool StructDetailModel::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, |
| 158 | int column, const QModelIndex& parent) |