NewActionDialog::NewActionDialog(ActionEditor *parent) :
QDialog(parent, Qt::Sheet),
m_ui(new Ui::NewActionDialog),
- m_actionEditor(parent)
+ m_actionEditor(parent),
+ m_autoUpdateObjectName(true)
{
m_ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
m_ui->editActionText->setFocus();
- m_auto_update_object_name = true;
updateButtons();
QDesignerFormWindowInterface *form = parent->formWindow();
m_ui->keySequenceEdit->setKeySequence(d.keysequence.value());
m_ui->checkableCheckBox->setCheckState(d.checkable ? Qt::Checked : Qt::Unchecked);
- m_auto_update_object_name = false;
+ // Suppress updating of the object name from the text for existing actions.
+ m_autoUpdateObjectName = d.name.isEmpty();
updateButtons();
}
void NewActionDialog::on_editActionText_textEdited(const QString &text)
{
- if (text.isEmpty())
- m_auto_update_object_name = true;
-
- if (m_auto_update_object_name)
+ if (m_autoUpdateObjectName)
m_ui->editObjectName->setText(ActionEditor::actionTextToName(text));
updateButtons();
void NewActionDialog::on_editObjectName_textEdited(const QString&)
{
updateButtons();
- m_auto_update_object_name = false;
+ m_autoUpdateObjectName = false;
}
void NewActionDialog::slotEditToolTip()