diff --git a/widgets/iconwidget.cpp b/widgets/iconwidget.cpp index c550bae80..fe917c2c4 100644 --- a/widgets/iconwidget.cpp +++ b/widgets/iconwidget.cpp @@ -377,7 +377,7 @@ void IconWidget::removeIconAction(QAction *action) foreach (IconAction *iconAction, d->cornerActions) { if (found) { iconAction->setRect(d->actionRect((IconWidgetPrivate::ActionPosition)count)); - } else if (iconAction->action() == action) { + } else if (!action || iconAction->action() == action) { delete iconAction; d->cornerActions.removeAll(iconAction); } diff --git a/widgets/iconwidget.h b/widgets/iconwidget.h index c4a2a9326..672bf3518 100644 --- a/widgets/iconwidget.h +++ b/widgets/iconwidget.h @@ -173,6 +173,8 @@ public: /** * Removes a previously set iconAction. The action will be removed from the widget * but will not be deleted. + * + * @param the QAction to be removed, if 0 all actions will be removed */ void removeIconAction(QAction *action);