diff --git a/mapeditor/mapview.cpp b/mapeditor/mapview.cpp index f2176d2d2..c719b80f1 100644 --- a/mapeditor/mapview.cpp +++ b/mapeditor/mapview.cpp @@ -362,8 +362,9 @@ void MapView::dragEnterEvent(QDragEnterEvent * event) { auto encodedData = event->mimeData()->data("application/vcmi.object"); QDataStream stream(&encodedData, QIODevice::ReadOnly); - QJsonObject data; - stream >> data; + QVariant vdata; + stream >> vdata; + auto data = vdata.toJsonObject(); if(!data.empty()) { auto preview = data["preview"]; diff --git a/mapeditor/objectbrowser.cpp b/mapeditor/objectbrowser.cpp index d29c0e04f..b0cc1f707 100644 --- a/mapeditor/objectbrowser.cpp +++ b/mapeditor/objectbrowser.cpp @@ -108,7 +108,7 @@ QMimeData * ObjectBrowserProxyModel::mimeData(const QModelIndexList & indexes) c if(!index.isValid()) return nullptr; - auto text = standardModel->itemFromIndex(mapToSource(index))->data().toJsonObject(); + auto text = standardModel->itemFromIndex(mapToSource(index))->data(); stream << text; QMimeData * mimeData = new QMimeData;