summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qdialogbuttonbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qdialogbuttonbox.cpp')
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 10f8db8..2231b98 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -873,6 +873,11 @@ void QDialogButtonBox::setOrientation(Qt::Orientation orientation)
void QDialogButtonBox::clear()
{
Q_D(QDialogButtonBox);
+#ifdef QT_SOFTKEYS_ENABLED
+ // Delete softkey actions as they have the buttons as parents
+ qDeleteAll(d->softKeyActions.values());
+ d->softKeyActions.clear();
+#endif
// Remove the created standard buttons, they should be in the other lists, which will
// do the deletion
d->standardButtonHash.clear();
@@ -1025,6 +1030,11 @@ QPushButton *QDialogButtonBox::addButton(StandardButton button)
void QDialogButtonBox::setStandardButtons(StandardButtons buttons)
{
Q_D(QDialogButtonBox);
+#ifdef QT_SOFTKEYS_ENABLED
+ // Delete softkey actions since they have the buttons as parents
+ qDeleteAll(d->softKeyActions.values());
+ d->softKeyActions.clear();
+#endif
// Clear out all the old standard buttons, then recreate them.
qDeleteAll(d->standardButtonHash.keys());
d->standardButtonHash.clear();