summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindowsysteminterface_qpa.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-09-03 07:27:44 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-09-03 10:55:50 (GMT)
commit975490d721ca98251aefa7e7f50e6e54e63b79c1 (patch)
treef1b637461352c10bb133321e51b6b8ac9f30e2fa /src/gui/kernel/qwindowsysteminterface_qpa.cpp
parent4e630e3af2f33a123abb58f15f95d640d9054cd6 (diff)
downloadQt-975490d721ca98251aefa7e7f50e6e54e63b79c1.zip
Qt-975490d721ca98251aefa7e7f50e6e54e63b79c1.tar.gz
Qt-975490d721ca98251aefa7e7f50e6e54e63b79c1.tar.bz2
Lighthouse: Fix eventhandling for when widgets are in destructor
This is a problem when you send events from a seperate thread
Diffstat (limited to 'src/gui/kernel/qwindowsysteminterface_qpa.cpp')
-rw-r--r--src/gui/kernel/qwindowsysteminterface_qpa.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
index c49bd36..f10c038 100644
--- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp
+++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp
@@ -61,6 +61,10 @@ extern QPointer<QWidget> qt_last_mouse_receiver;
void QWindowSystemInterface::handleEnterEvent(QWidget *tlw)
{
+ QWidgetData *data = qt_qwidget_data(tlw);
+ if (data->in_destructor)
+ return;
+
if (tlw) {
QWindowSystemInterfacePrivate::EnterEvent *e = new QWindowSystemInterfacePrivate::EnterEvent(tlw);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
@@ -69,12 +73,20 @@ void QWindowSystemInterface::handleEnterEvent(QWidget *tlw)
void QWindowSystemInterface::handleLeaveEvent(QWidget *tlw)
{
+ QWidgetData *data = qt_qwidget_data(tlw);
+ if (data->in_destructor)
+ return;
+
QWindowSystemInterfacePrivate::LeaveEvent *e = new QWindowSystemInterfacePrivate::LeaveEvent(tlw);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
void QWindowSystemInterface::handleGeometryChange(QWidget *tlw, const QRect &newRect)
{
+ QWidgetData *data = qt_qwidget_data(tlw);
+ if (data->in_destructor)
+ return;
+
QWindowSystemInterfacePrivate::GeometryChangeEvent *e = new QWindowSystemInterfacePrivate::GeometryChangeEvent(tlw,newRect);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}
@@ -102,6 +114,9 @@ void QWindowSystemInterface::handleMouseEvent(QWidget *w, const QPoint & local,
void QWindowSystemInterface::handleMouseEvent(QWidget *tlw, ulong timestamp, const QPoint & local, const QPoint & global, Qt::MouseButtons b)
{
+ QWidgetData *data = qt_qwidget_data(tlw);
+ if (data->in_destructor)
+ tlw = 0;
QWindowSystemInterfacePrivate::MouseEvent * e =
new QWindowSystemInterfacePrivate::MouseEvent(tlw, timestamp, local, global, b);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
@@ -114,6 +129,10 @@ void QWindowSystemInterface::handleKeyEvent(QWidget *w, QEvent::Type t, int k, Q
void QWindowSystemInterface::handleKeyEvent(QWidget *tlw, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count)
{
+ QWidgetData *data = qt_qwidget_data(tlw);
+ if (data->in_destructor)
+ tlw = 0;
+
QWindowSystemInterfacePrivate::KeyEvent * e =
new QWindowSystemInterfacePrivate::KeyEvent(tlw, timestamp, t, k, mods, text, autorep, count);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
@@ -126,6 +145,10 @@ void QWindowSystemInterface::handleWheelEvent(QWidget *w, const QPoint & local,
void QWindowSystemInterface::handleWheelEvent(QWidget *tlw, ulong timestamp, const QPoint & local, const QPoint & global, int d, Qt::Orientation o)
{
+ QWidgetData *data = qt_qwidget_data(tlw);
+ if (data->in_destructor)
+ tlw = 0;
+
QWindowSystemInterfacePrivate::WheelEvent *e =
new QWindowSystemInterfacePrivate::WheelEvent(tlw, timestamp, local, global, d, o);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);