QDropEvent::pos() is deprecated since 6.0.
This commit is contained in:
parent
10c6ff1181
commit
885a618820
|
@ -205,7 +205,7 @@ void VPMainGraphicsView::dropEvent(QDropEvent *event)
|
|||
event->acceptProposedAction();
|
||||
|
||||
piece->ClearTransformations();
|
||||
piece->SetPosition(mapToScene(event->pos()));
|
||||
piece->SetPosition(mapToScene(DropEventPos(event)));
|
||||
piece->SetZValue(1.0);
|
||||
|
||||
auto *command = new VPUndoMovePieceOnSheet(layout->GetFocusedSheet(), piece);
|
||||
|
|
|
@ -318,4 +318,15 @@ inline auto VLocaleCharacter(const QChar &character) -> QChar
|
|||
{
|
||||
return character;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
inline auto DropEventPos(const QDropEvent *event) -> QPoint
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
return event->position().toPoint();
|
||||
#else
|
||||
return event->pos();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // COMPATIBILITY_H
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#include "../vmisc/vabstractapplication.h"
|
||||
#include "../vmisc/vcommonsettings.h"
|
||||
#include "../vmisc/literals.h"
|
||||
#include "../vmisc/compatibility.h"
|
||||
#include "global.h"
|
||||
#include "../ifc/xml/utils.h"
|
||||
|
||||
|
@ -711,7 +712,7 @@ void VMainGraphicsView::dropEvent(QDropEvent *event)
|
|||
QFileInfo f(fileName);
|
||||
if (f.exists() && IsMimeTypeImage(QMimeDatabase().mimeTypeForFile(fileName)))
|
||||
{
|
||||
emit currentScene->AddBackgroundImage(mapToScene(event->pos()), fileName);
|
||||
emit currentScene->AddBackgroundImage(mapToScene(DropEventPos(event)), fileName);
|
||||
event->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user