Fixed crash after language change.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-11-05 14:06:45 +02:00
parent f4aabbcf06
commit 840a4a9d92

View File

@ -496,12 +496,15 @@ void TMainWindow::changeEvent(QEvent *event)
{
labelPatternUnit = new QLabel(tr("Pattern unit:"));
const qint32 index = comboBoxUnits->currentIndex();
comboBoxUnits->blockSignals(true);
comboBoxUnits->clear();
InitComboBoxUnits();
comboBoxUnits->setCurrentIndex(index);
comboBoxUnits->blockSignals(false);
if (comboBoxUnits != nullptr)
{
const qint32 index = comboBoxUnits->currentIndex();
comboBoxUnits->blockSignals(true);
comboBoxUnits->clear();
InitComboBoxUnits();
comboBoxUnits->setCurrentIndex(index);
comboBoxUnits->blockSignals(false);
}
}
}