forked from qt-creator/qt-creator
Fix crash in ShortcutSettingsWidget.
Setting the validation function on a FancyLineEdit immediately validates now, so everything accessed by the validation function has to be set up when setting it. Change-Id: I07900058d7047d61d1b153bdfbfe44acf3164174 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Eike Ziller
parent
6da1403543
commit
74eb8db29f
@@ -227,9 +227,6 @@ ShortcutSettingsWidget::ShortcutSettingsWidget(QWidget *parent)
|
|||||||
m_shortcutEdit = new Utils::FancyLineEdit(m_shortcutBox);
|
m_shortcutEdit = new Utils::FancyLineEdit(m_shortcutBox);
|
||||||
m_shortcutEdit->setFiltering(true);
|
m_shortcutEdit->setFiltering(true);
|
||||||
m_shortcutEdit->setPlaceholderText(tr("Enter key sequence as text"));
|
m_shortcutEdit->setPlaceholderText(tr("Enter key sequence as text"));
|
||||||
m_shortcutEdit->setValidationFunction([this](Utils::FancyLineEdit *, QString *) {
|
|
||||||
return validateShortcutEdit();
|
|
||||||
});
|
|
||||||
auto shortcutLabel = new QLabel(tr("Key sequence:"));
|
auto shortcutLabel = new QLabel(tr("Key sequence:"));
|
||||||
shortcutLabel->setToolTip(Utils::HostOsInfo::isMacHost()
|
shortcutLabel->setToolTip(Utils::HostOsInfo::isMacHost()
|
||||||
? QLatin1String("<html><body>")
|
? QLatin1String("<html><body>")
|
||||||
@@ -274,6 +271,10 @@ ShortcutSettingsWidget::ShortcutSettingsWidget(QWidget *parent)
|
|||||||
layout()->addWidget(m_shortcutBox);
|
layout()->addWidget(m_shortcutBox);
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
|
|
||||||
|
m_shortcutEdit->setValidationFunction([this](Utils::FancyLineEdit *, QString *) {
|
||||||
|
return validateShortcutEdit();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ShortcutSettingsWidget::~ShortcutSettingsWidget()
|
ShortcutSettingsWidget::~ShortcutSettingsWidget()
|
||||||
|
Reference in New Issue
Block a user