You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*!
* FIXME -- This is almost certainly a Qt bug-workaround.
* Changing this widget's parent causes a segfault in QComboBox.
* Start with no parent, set parent, clear parent, set again -> segfault.
* The workaround is to create a new QComboBox and restore its state.
*/
bool event(QEvent *e)
{
if (e->type() == QEvent::ParentAboutToChange)
{
const auto oldIndex = _comboBox->currentIndex();
QStringList oldItems; for (int i = 0; i < _comboBox->count(); i++) oldItems.push_back(_comboBox->itemText(i));
delete _comboBox;
_comboBox = (new QComboBox(this));
layout()->addWidget(_comboBox);
_comboBox->addItems(oldItems);
_comboBox->setCurrentIndex(oldIndex);
}
return QWidget::event(e);
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: