InfoBar: Avoid using sender()

Change-Id: I575aa4999b4cb8d39135880a3bc6d1b2fe44cf4a
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-19 17:37:09 +02:00
parent 3ec87e37ee
commit 98ba797f76
2 changed files with 3 additions and 7 deletions

View File

@@ -402,15 +402,12 @@ void InfoBarDisplay::update()
hbox->addWidget(infoWidgetSuppressButton);
}
connect(infoWidget, &QObject::destroyed, this, &InfoBarDisplay::widgetDestroyed);
connect(infoWidget, &QObject::destroyed, this, [this, infoWidget] {
m_infoWidgets.removeOne(infoWidget);
});
m_boxLayout->insertWidget(m_boxIndex, infoWidget);
m_infoWidgets << infoWidget;
}
}
void InfoBarDisplay::widgetDestroyed()
{
m_infoWidgets.removeOne(static_cast<QWidget *>(sender()));
}
} // namespace Utils

View File

@@ -158,7 +158,6 @@ public:
private:
void update();
void infoBarDestroyed();
void widgetDestroyed();
QList<QWidget *> m_infoWidgets;
InfoBar *m_infoBar = nullptr;