From d70150818f27c5d4a375247f8d054163ff9b21cc Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 23 Mar 2022 10:11:03 +0100 Subject: [PATCH] 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: Reviewed-by: Eike Ziller --- src/libs/utils/infobar.cpp | 4 ++-- 1 file 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::of(&QComboBox::currentIndexChanged), [cb, info]() { + connect(cb, QOverload::of(&QComboBox::currentIndexChanged), this, [cb, info]() { info.m_comboCallBack({cb->currentText(), cb->currentData()}); - }); + }, Qt::QueuedConnection); hbox->addWidget(cb); }