From 46350200d78513381d1126ac5b8b5c52555c3878 Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 23 Jun 2023 19:05:44 +0300 Subject: [PATCH] Qt: Always set QEvent::isAccepted is drag&drop events --- rpcs3/rpcs3qt/main_window.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 83830c1335..9bb5474aa8 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -3298,12 +3298,15 @@ main_window::drop_type main_window::IsValidFile(const QMimeData& md, QStringList void main_window::dropEvent(QDropEvent* event) { + event->accept(); + QStringList drop_paths; switch (IsValidFile(*event->mimeData(), &drop_paths)) // get valid file paths and drop type { case drop_type::drop_error: { + event->ignore(); break; } case drop_type::drop_pkg: // install the packages @@ -3403,18 +3406,12 @@ void main_window::dropEvent(QDropEvent* event) void main_window::dragEnterEvent(QDragEnterEvent* event) { - if (IsValidFile(*event->mimeData()) != drop_type::drop_error) - { - event->accept(); - } + event->setAccepted(IsValidFile(*event->mimeData()) != drop_type::drop_error); } void main_window::dragMoveEvent(QDragMoveEvent* event) { - if (IsValidFile(*event->mimeData()) != drop_type::drop_error) - { - event->accept(); - } + event->setAccepted(IsValidFile(*event->mimeData()) != drop_type::drop_error); } void main_window::dragLeaveEvent(QDragLeaveEvent* event)