aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/infobar.cpp
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2022-03-23 10:11:03 +0100
committerDavid Schulz <david.schulz@qt.io>2022-03-23 13:28:52 +0000
commitd70150818f27c5d4a375247f8d054163ff9b21cc (patch)
tree69f6b51249b64f5c3102b41a4b1e16d6c63f8b89 /src/libs/utils/infobar.cpp
parentbe0b962ce8b418cdeefde39bf9b971449bdf1b38 (diff)
Utils: postpone combo box handling of the info bar
We might want to remove the info bar in the callback. This makes sure that all direct connections are handled before removing the info bar and the combo box gets deleted. Change-Id: Icfce358d69923fa0558d48c2513e1cfff4926ed9 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/libs/utils/infobar.cpp')
-rw-r--r--src/libs/utils/infobar.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/utils/infobar.cpp b/src/libs/utils/infobar.cpp
index 68f9a43643a..694709ad5f0 100644
--- a/src/libs/utils/infobar.cpp
+++ b/src/libs/utils/infobar.cpp
@@ -322,9 +322,9 @@ void InfoBarDisplay::update()
cb->addItem(comboInfo.displayText, comboInfo.data);
if (info.m_currentComboIndex >= 0 && info.m_currentComboIndex < cb->count())
cb->setCurrentIndex(info.m_currentComboIndex);
- connect(cb, QOverload<int>::of(&QComboBox::currentIndexChanged), [cb, info]() {
+ connect(cb, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [cb, info]() {
info.m_comboCallBack({cb->currentText(), cb->currentData()});
- });
+ }, Qt::QueuedConnection);
hbox->addWidget(cb);
}