From 271936b063fb261293e3f77f7a2273e3a4dbb5d6 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Tue, 1 Dec 2009 14:54:40 +0100 Subject: Creator crashes when reloading externally modified .ui files on Mac On Mac QWidget::destroy() sends an AcceptDropsChange event after clearing the guards for QPointer. This was used to store a QPointer to the widget being deleted & that will never be cleared. The fix removed the setAcceptDrops() from destroy. And as an extra protection make sure designer will not treat that event as interesting. Task-number: QTCREATORBUG-307 Reviewed-by: Denis Dzyubenko Reviewed-by: Friedemann Kleint --- src/gui/kernel/qwidget_mac.mm | 2 -- tools/designer/src/components/formeditor/formwindowmanager.cpp | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 0d9f9ee..1907cca 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -2617,8 +2617,6 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) releaseMouse(); if(mac_keyboard_grabber == this) releaseKeyboard(); - if(acceptDrops()) - setAcceptDrops(false); if(testAttribute(Qt::WA_ShowModal)) // just be sure we leave modal QApplicationPrivate::leaveModal(this); diff --git a/tools/designer/src/components/formeditor/formwindowmanager.cpp b/tools/designer/src/components/formeditor/formwindowmanager.cpp index 23d8580..246c56f 100644 --- a/tools/designer/src/components/formeditor/formwindowmanager.cpp +++ b/tools/designer/src/components/formeditor/formwindowmanager.cpp @@ -196,6 +196,7 @@ bool FormWindowManager::eventFilter(QObject *o, QEvent *e) case QEvent::HoverEnter: case QEvent::HoverLeave: case QEvent::HoverMove: + case QEvent::AcceptDropsChange: return false; default: break; -- cgit v0.12