forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user