From 824e8c4decf952b93279dc2c8c58e5d8dc0aa509 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sat, 30 May 2009 18:48:27 +0200 Subject: Delete the actions in the popped SoftKeySets. --- src/gui/widgets/qsoftkeystack.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.cpp b/src/gui/widgets/qsoftkeystack.cpp index db9b7a2..494471e 100644 --- a/src/gui/widgets/qsoftkeystack.cpp +++ b/src/gui/widgets/qsoftkeystack.cpp @@ -79,10 +79,9 @@ void QSoftKeyStackPrivate::push(QSoftKeyAction *softKey) { QSoftkeySet softKeySet; softKeySet.append(softKey); - softKeyStack.push(softKeySet); - setNativeSoftKeys(); - + push(softKeySet); } + void QSoftKeyStackPrivate::push(const QList &softkeys) { QSoftkeySet softKeySet(softkeys); @@ -92,18 +91,15 @@ void QSoftKeyStackPrivate::push(const QList &softkeys) void QSoftKeyStackPrivate::pop() { - softKeyStack.pop(); + qDeleteAll(softKeyStack.pop()); setNativeSoftKeys(); } void QSoftKeyStackPrivate::popandPush(QSoftKeyAction *softKey) { - QSoftkeySet oldSoftKeySet = softKeyStack.pop(); QSoftkeySet newSoftKeySet; newSoftKeySet.append(softKey); - softKeyStack.push(newSoftKeySet); - if( !isSame(oldSoftKeySet, newSoftKeySet)) - setNativeSoftKeys(); + popandPush(newSoftKeySet); } void QSoftKeyStackPrivate::popandPush(const QList &softkeys) @@ -111,8 +107,14 @@ void QSoftKeyStackPrivate::popandPush(const QList &softkeys) QSoftkeySet oldSoftKeySet = softKeyStack.pop(); QSoftkeySet newSoftKeySet(softkeys); softKeyStack.push(newSoftKeySet); - if( !isSame(oldSoftKeySet, newSoftKeySet)) +#ifdef Q_WS_S60 + // Don't flicker on Symbian. + // Platforms that use QActions as native SoftKeys must always call setNativeSoftKeys + // Otherwise the following deletion of oldSoftKeySet would remove the softkeys + if (!isSame(oldSoftKeySet, newSoftKeySet)) +#endif setNativeSoftKeys(); + qDeleteAll(oldSoftKeySet); } const QSoftkeySet& QSoftKeyStackPrivate::top() -- cgit v0.12