diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-07-19 17:37:09 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-07-20 10:29:00 +0000 |
commit | 98ba797f760bdb77f3f6cd516f9f2d12a72859f7 (patch) | |
tree | 5b59f262019967b9f3216b2948ad187acd95d32b /src/libs/utils/infobar.cpp | |
parent | 3ec87e37ee5fa42ea217e840c6ec9748e8b8b898 (diff) |
InfoBar: Avoid using sender()
Change-Id: I575aa4999b4cb8d39135880a3bc6d1b2fe44cf4a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/libs/utils/infobar.cpp')
-rw-r--r-- | src/libs/utils/infobar.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libs/utils/infobar.cpp b/src/libs/utils/infobar.cpp index aa8a3fb7736..24feab5c7fb 100644 --- a/src/libs/utils/infobar.cpp +++ b/src/libs/utils/infobar.cpp @@ -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 |