a useful method to remove a previously set iconAction

svn path=/trunk/KDE/kdelibs/; revision=916376
This commit is contained in:
Alessandro Diaferia 2009-01-25 09:58:02 +00:00
parent bb8c603060
commit 82fb975523
2 changed files with 16 additions and 0 deletions

View File

@ -348,6 +348,16 @@ void IconWidget::addIconAction(QAction *action)
iconAction->setRect(d->actionRect((IconWidgetPrivate::ActionPosition)count));
}
void IconWidget::removeIconAction(QAction *action)
{
foreach (IconAction *i_action, d->cornerActions) {
if (i_action->action() == action) {
delete i_action;
d->cornerActions.removeAll(i_action);
}
}
}
void IconWidget::setAction(QAction *action)
{
if (d->action) {

View File

@ -151,6 +151,12 @@ public:
*/
void addIconAction(QAction *action);
/**
* Removes a previously set iconAction. The action will be removed from the widget
* but will not be deleted.
*/
void removeIconAction(QAction *action);
/**
* Associate an action with this IconWidget
* this makes the IconWidget follow the state of the action, using its icon, text, etc.