forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
@@ -158,7 +158,6 @@ public:
|
||||
private:
|
||||
void update();
|
||||
void infoBarDestroyed();
|
||||
void widgetDestroyed();
|
||||
|
||||
QList<QWidget *> m_infoWidgets;
|
||||
InfoBar *m_infoBar = nullptr;
|
||||
|
Reference in New Issue
Block a user