X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Factioncollection.cpp;h=8a5d6067ed34885910b694bdb9973d032d5d4823;hp=a20d9183027bb49183f65c4ac30dbd47b4c82a73;hb=ba934ceb1bfe30d01d5fb5c072c3197f8080be04;hpb=bfc967d449565c7435aecfb007e2df6fab1f9188 diff --git a/src/uisupport/actioncollection.cpp b/src/uisupport/actioncollection.cpp index a20d9183..8a5d6067 100644 --- a/src/uisupport/actioncollection.cpp +++ b/src/uisupport/actioncollection.cpp @@ -21,6 +21,7 @@ ***************************************************************************/ #include +#include #include "actioncollection.h" @@ -49,7 +50,7 @@ QList ActionCollection::actions() const { } Action *ActionCollection::addAction(const QString &name, Action *action) { - QAction *act = addAction(name, action); + QAction *act = addAction(name, static_cast(action)); Q_ASSERT(act == action); return action; } @@ -206,6 +207,10 @@ void ActionCollection::clearAssociatedWidgets() { _associatedWidgets.clear(); } +void ActionCollection::associatedWidgetDestroyed(QObject *obj) { + _associatedWidgets.removeAll(static_cast(obj)); +} + bool ActionCollection::unlistAction(QAction *action) { // This might be called with a partly destroyed QAction!