summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-11-09 14:39:27 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-11-11 15:15:40 (GMT)
commit9a5b72eb64d698aff507d5c2b2ea6d19bda0b65e (patch)
tree4d84e80c495e9827eea55525ef16c160eebc5711 /src/gui/kernel
parent7a81735272b5ee065f499a492cca4b4a703e0659 (diff)
downloadQt-9a5b72eb64d698aff507d5c2b2ea6d19bda0b65e.zip
Qt-9a5b72eb64d698aff507d5c2b2ea6d19bda0b65e.tar.gz
Qt-9a5b72eb64d698aff507d5c2b2ea6d19bda0b65e.tar.bz2
Send WinIdChange event when winId is set to zero
This allows an observer to get a notification just before the window handle owned by a native widget is destroyed. Note that, at the point when the event is sent, the widget's internalWinId() will return the new value, but the old native window handle will not be destroyed until after the event handler is run. Task-number: QTMOBILITY-645 Reviewed-by: sroedal
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwidget.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index e22ec55..cbf4886 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -1673,13 +1673,8 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier
}
if(oldWinId != id) {
- // Do not emit an event when the old winId is destroyed. This only
- // happens (a) during widget destruction, and (b) immediately prior
- // to creation of a new winId, for example as a result of re-parenting.
- if(id != 0) {
- QEvent e(QEvent::WinIdChange);
- QCoreApplication::sendEvent(q, &e);
- }
+ QEvent e(QEvent::WinIdChange);
+ QCoreApplication::sendEvent(q, &e);
}
}