mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-11 18:50:55 +00:00
Qt: Always set QEvent::isAccepted is drag&drop events
This commit is contained in:
parent
00502e94b5
commit
46350200d7
1 changed files with 5 additions and 8 deletions
|
@ -3298,12 +3298,15 @@ main_window::drop_type main_window::IsValidFile(const QMimeData& md, QStringList
|
||||||
|
|
||||||
void main_window::dropEvent(QDropEvent* event)
|
void main_window::dropEvent(QDropEvent* event)
|
||||||
{
|
{
|
||||||
|
event->accept();
|
||||||
|
|
||||||
QStringList drop_paths;
|
QStringList drop_paths;
|
||||||
|
|
||||||
switch (IsValidFile(*event->mimeData(), &drop_paths)) // get valid file paths and drop type
|
switch (IsValidFile(*event->mimeData(), &drop_paths)) // get valid file paths and drop type
|
||||||
{
|
{
|
||||||
case drop_type::drop_error:
|
case drop_type::drop_error:
|
||||||
{
|
{
|
||||||
|
event->ignore();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case drop_type::drop_pkg: // install the packages
|
case drop_type::drop_pkg: // install the packages
|
||||||
|
@ -3403,18 +3406,12 @@ void main_window::dropEvent(QDropEvent* event)
|
||||||
|
|
||||||
void main_window::dragEnterEvent(QDragEnterEvent* event)
|
void main_window::dragEnterEvent(QDragEnterEvent* event)
|
||||||
{
|
{
|
||||||
if (IsValidFile(*event->mimeData()) != drop_type::drop_error)
|
event->setAccepted(IsValidFile(*event->mimeData()) != drop_type::drop_error);
|
||||||
{
|
|
||||||
event->accept();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void main_window::dragMoveEvent(QDragMoveEvent* event)
|
void main_window::dragMoveEvent(QDragMoveEvent* event)
|
||||||
{
|
{
|
||||||
if (IsValidFile(*event->mimeData()) != drop_type::drop_error)
|
event->setAccepted(IsValidFile(*event->mimeData()) != drop_type::drop_error);
|
||||||
{
|
|
||||||
event->accept();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void main_window::dragLeaveEvent(QDragLeaveEvent* event)
|
void main_window::dragLeaveEvent(QDragLeaveEvent* event)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue