Qt: Always set QEvent::isAccepted is drag&drop events
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user