diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-08-31 09:23:33 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-08-31 09:23:33 (GMT) |
commit | 54d69ef97327e735cdeca1f1a808ba09a781cf08 (patch) | |
tree | fbc22e92da2c359dacfc6b54a0c551fdc7495275 /src/gui | |
parent | 3d23d79ce125f596333bc00236085eccfcbd9537 (diff) | |
parent | 298d7a2032c0c6de06c82afc8e9f7356cb5d7840 (diff) | |
download | Qt-54d69ef97327e735cdeca1f1a808ba09a781cf08.zip Qt-54d69ef97327e735cdeca1f1a808ba09a781cf08.tar.gz Qt-54d69ef97327e735cdeca1f1a808ba09a781cf08.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 8 |
4 files changed, 14 insertions, 9 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index ac8e690..8e8266c 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -334,6 +334,10 @@ QWidgetPrivate::QWidgetPrivate(int version) QWidgetPrivate::~QWidgetPrivate() { +#ifdef Q_OS_SYMBIAN + _q_cleanupWinIds(); +#endif + if (widgetItem) widgetItem->wid = 0; @@ -12561,9 +12565,11 @@ void QWidget::clearMask() */ #ifdef Q_OS_SYMBIAN -void QWidgetPrivate::_q_delayedDestroy(WId winId) +void QWidgetPrivate::_q_cleanupWinIds() { - delete winId; + foreach (WId wid, widCleanupList) + delete wid; + widCleanupList.clear(); } #endif diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 2c89405..2f8545e 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -787,7 +787,7 @@ private: Q_DISABLE_COPY(QWidget) Q_PRIVATE_SLOT(d_func(), void _q_showIfNotHidden()) #ifdef Q_OS_SYMBIAN - Q_PRIVATE_SLOT(d_func(), void _q_delayedDestroy(WId winId)) + Q_PRIVATE_SLOT(d_func(), void void _q_cleanupWinIds()) #endif QWidgetData *data; diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index c00b8ed..e30497c 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -409,7 +409,7 @@ public: #ifdef Q_OS_SYMBIAN void setSoftKeys_sys(const QList<QAction*> &softkeys); void activateSymbianWindow(WId wid = 0); - void _q_delayedDestroy(WId winId); + void _q_cleanupWinIds(); #endif void raise_sys(); @@ -889,6 +889,7 @@ public: void s60UpdateIsOpaque(); void reparentChildren(); void registerTouchWindow(); + QList<WId> widCleanupList; #endif }; diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 5630706..3c2d63c 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -58,9 +58,7 @@ #endif // This is necessary in order to be able to perform delayed invocation on slots -// which take arguments of type WId. One example is -// QWidgetPrivate::_q_delayedDestroy, which is used to delay destruction of -// CCoeControl objects until after the CONE event handler has finished running. +// which take arguments of type WId. Q_DECLARE_METATYPE(WId) // Workaround for the fact that S60 SDKs 3.x do not contain the akntoolbar.h @@ -476,8 +474,8 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de // Delay deletion of the control in case this function is called in the // context of a CONE event handler such as // CCoeControl::ProcessPointerEventL - QMetaObject::invokeMethod(q, "_q_delayedDestroy", - Qt::QueuedConnection, Q_ARG(WId, destroyw)); + widCleanupList << destroyw; + QMetaObject::invokeMethod(q, "_q_cleanupWinIds", Qt::QueuedConnection); } if (q->testAttribute(Qt::WA_AcceptTouchEvents)) |