mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-05 18:54:14 +02:00
Fix macro drag-and-drop placement and preview for Qt6
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user