ScxmlEditor: Prevent crash

Create the connection after populating the combobox prevents an
assertion.

Change-Id: I35be1cf724ed7084123e7070b377b50274132e55
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2022-08-10 09:30:49 +02:00
parent c86d61846d
commit 52b8b51b32

View File

@@ -39,11 +39,6 @@ ColorSettings::ColorSettings(QWidget *parent)
m_ui.setupUi(this);
m_ui.m_colorThemeView->setEnabled(false);
connect(m_ui.m_comboColorThemes, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &ColorSettings::selectTheme);
connect(m_ui.m_colorThemeView, &ColorThemeView::colorChanged, this, &ColorSettings::updateCurrentColors);
connect(m_ui.m_addColorTheme, &QToolButton::clicked, this, &ColorSettings::createTheme);
connect(m_ui.m_removeColorTheme, &QToolButton::clicked, this, &ColorSettings::removeTheme);
const QSettings *s = Core::ICore::settings();
@@ -53,6 +48,12 @@ ColorSettings::ColorSettings(QWidget *parent)
for (auto it = m_colorThemes.cbegin(); it != m_colorThemes.cend(); ++it)
m_ui.m_comboColorThemes->addItem(it.key());
m_ui.m_comboColorThemes->setCurrentText(s->value(Constants::C_SETTINGS_COLORSETTINGS_CURRENTCOLORTHEME).toString());
connect(m_ui.m_comboColorThemes, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &ColorSettings::selectTheme);
connect(m_ui.m_colorThemeView, &ColorThemeView::colorChanged, this, &ColorSettings::updateCurrentColors);
connect(m_ui.m_addColorTheme, &QToolButton::clicked, this, &ColorSettings::createTheme);
connect(m_ui.m_removeColorTheme, &QToolButton::clicked, this, &ColorSettings::removeTheme);
}
void ColorSettings::save()