Fix macro drag-and-drop placement and preview for Qt6

This commit is contained in:
Kellermorph
2026-09-13 10:09:44 +02:00
parent a583b3c43c
commit 0c2cf409f8
2 changed files with 12 additions and 11 deletions
+4 -8
View File
@@ -211,10 +211,10 @@ void DiagramView::handleElementDrop(QDropEvent *event)
}
QPointF drop_pos;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
drop_pos = mapToScene(event->pos());
#else
drop_pos = event->position();
drop_pos = mapToScene(event->position().toPoint());
#endif
if (location.path().endsWith(".qetmak")) {
@@ -290,16 +290,12 @@ void DiagramView::handleTextDrop(QDropEvent *e) {
iti -> setHtml (e -> mimeData() -> text());
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt 6: remove
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
m_diagram->undoStack().push(new AddGraphicsObjectCommand(
iti, m_diagram, mapToScene(e->pos())));
#else
#if TODO_LIST
#pragma message("@TODO remove code for QT 6 or later")
#endif
m_diagram->undoStack().push(new AddGraphicsObjectCommand(
iti, m_diagram, e->position()));
iti, m_diagram, mapToScene(e->position().toPoint())));
#endif
}