summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAlessandro Portale <aportale@trolltech.com>2009-05-30 16:48:27 (GMT)
committerAlessandro Portale <aportale@trolltech.com>2009-05-30 16:48:27 (GMT)
commit824e8c4decf952b93279dc2c8c58e5d8dc0aa509 (patch)
tree032073f0fa6b1ad63a18df8c50626a17d5d0dc53 /src/gui/widgets
parentafef05497be340509ffb604ab23d7d036bc363ea (diff)
downloadQt-824e8c4decf952b93279dc2c8c58e5d8dc0aa509.zip
Qt-824e8c4decf952b93279dc2c8c58e5d8dc0aa509.tar.gz
Qt-824e8c4decf952b93279dc2c8c58e5d8dc0aa509.tar.bz2
Delete the actions in the popped SoftKeySets.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qsoftkeystack.cpp20
1 files 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<QSoftKeyAction*> &softkeys)
{
QSoftkeySet softKeySet(softkeys);
@@ -92,18 +91,15 @@ void QSoftKeyStackPrivate::push(const QList<QSoftKeyAction*> &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<QSoftKeyAction*> &softkeys)
@@ -111,8 +107,14 @@ void QSoftKeyStackPrivate::popandPush(const QList<QSoftKeyAction*> &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()