Utils: Add missing connections to validChanged

FancyLineEdit and PathChoosers valid state can be
asyncronously update, so users need to connect to the
validChanged signal to correctly update the UI and not
just to textChanged, or rawPathChanged etc.

Fixes: QTCREATORBUG-29525
Change-Id: I706fef61f6228af7dae9271a146cf739c3202cc7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Marcus Tillmanns
2023-08-22 15:27:34 +02:00
committed by hjk
parent 806e24138b
commit 73c5cf29c4
4 changed files with 12 additions and 7 deletions

View File

@@ -467,6 +467,7 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD
labelSetter.setWarning(errorMessage);
};
connect(&d->clangdChooser, &Utils::PathChooser::textChanged, this, updateWarningLabel);
connect(&d->clangdChooser, &Utils::PathChooser::validChanged, this, updateWarningLabel);
updateWarningLabel();
connect(&d->useClangdCheckBox, &QCheckBox::toggled,

View File

@@ -290,8 +290,11 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
verticalLayout->addWidget(Layouting::createHr());
verticalLayout->addWidget(d->buttonBox);
connect(d->localExecutablePathChooser, &PathChooser::rawPathChanged,
this, &StartApplicationDialog::updateState);
connect(d->localExecutablePathChooser,
&PathChooser::validChanged,
this,
&StartApplicationDialog::updateState);
connect(d->buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(d->buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(d->historyComboBox, &QComboBox::currentIndexChanged,

View File

@@ -95,9 +95,11 @@ GitLabCloneDialog::GitLabCloneDialog(const Project &project, QWidget *parent)
connect(m_pathChooser, &PathChooser::textChanged, this, [this] {
m_directoryLE->validate();
GitLabCloneDialog::updateUi();
updateUi();
});
connect(m_pathChooser, &PathChooser::validChanged, this, &GitLabCloneDialog::updateUi);
connect(m_directoryLE, &FancyLineEdit::textChanged, this, &GitLabCloneDialog::updateUi);
connect(m_directoryLE, &FancyLineEdit::validChanged, this, &GitLabCloneDialog::updateUi);
connect(m_cloneButton, &QPushButton::clicked, this, &GitLabCloneDialog::cloneProject);
connect(m_cancelButton, &QPushButton::clicked,
this, &GitLabCloneDialog::cancel);

View File

@@ -48,10 +48,9 @@ ComponentNameDialog::ComponentNameDialog(QWidget *parent) :
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &ComponentNameDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &ComponentNameDialog::reject);
connect(m_pathEdit, &Utils::PathChooser::rawPathChanged,
this, &ComponentNameDialog::validate);
connect(m_componentNameEdit, &QLineEdit::textChanged,
this, &ComponentNameDialog::validate);
connect(m_pathEdit, &Utils::PathChooser::rawPathChanged, this, &ComponentNameDialog::validate);
connect(m_pathEdit, &Utils::PathChooser::validChanged, this, &ComponentNameDialog::validate);
connect(m_componentNameEdit, &QLineEdit::textChanged, this, &ComponentNameDialog::validate);
}
bool ComponentNameDialog::go(QString *proposedName,