ActionContainer: Avoid usind sender()

Change-Id: Ic83179de74943a20de6abf516aa43a5cf034de65
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-07-21 13:25:04 +02:00
parent 59fde5be05
commit 2eb682802f
2 changed files with 3 additions and 4 deletions

View File

@@ -369,11 +369,10 @@ void ActionContainerPrivate::clear()
scheduleUpdate(); scheduleUpdate();
} }
void ActionContainerPrivate::itemDestroyed() void ActionContainerPrivate::itemDestroyed(QObject *sender)
{ {
QObject *obj = sender();
for (Group &group : m_groups) { for (Group &group : m_groups) {
if (group.items.removeAll(obj) > 0) if (group.items.removeAll(sender) > 0)
break; break;
} }
} }

View File

@@ -90,7 +90,7 @@ protected:
private: private:
void scheduleUpdate(); void scheduleUpdate();
void update(); void update();
void itemDestroyed(); void itemDestroyed(QObject *sender);
QList<Group>::const_iterator findGroup(Utils::Id groupId) const; QList<Group>::const_iterator findGroup(Utils::Id groupId) const;
QAction *insertLocation(QList<Group>::const_iterator group) const; QAction *insertLocation(QList<Group>::const_iterator group) const;