From c238f7b7e299e742e71fdb043a7bc81bbfd6c419 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 20 Oct 2009 14:47:42 +0300 Subject: Fixed QFileDialog crash on Symbian softKeyActions QHash in QDialogButtonBoxPrivate was not kept properly in sync with standardButtonHash, causing QFileDialog to crash upon startup. Reviewed-by: Sami Merila --- src/gui/widgets/qdialogbuttonbox.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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(); -- cgit v0.12