Skip to content
Snippets Groups Projects
Commit 1a122c2e authored by Eike Ziller's avatar Eike Ziller
Browse files

Get rid of FancyLineEdit::validate


Use aggregation instead of inheritance for customization of validation

Change-Id: I5a9703bad5bace78e8c3cc1e2c353a734001bd0a
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent dca023a8
No related branches found
No related tags found
No related merge requests found
......@@ -40,10 +40,11 @@ ClangStaticAnalyzerConfigWidget::ClangStaticAnalyzerConfigWidget(
chooser->setHistoryCompleter(QLatin1String("ClangStaticAnalyzer.ClangCommand.History"));
chooser->setPromptDialogTitle(tr("Clang Command"));
chooser->setPath(settings->clangExecutable());
const auto validator = [chooser](const QString &, QString *errorMessage) {
return isClangExecutableUsable(chooser->fileName().toString(), errorMessage);
const auto validator = [chooser](Utils::FancyLineEdit *edit, QString *errorMessage) {
return chooser->defaultValidationFunction()(edit, errorMessage)
&& isClangExecutableUsable(chooser->fileName().toString(), errorMessage);
};
chooser->setAdditionalPathValidator(validator);
chooser->setValidationFunction(validator);
connect(m_ui->clangExecutableChooser, &Utils::PathChooser::changed,
[settings](const QString &path) { settings->setClangExecutable(path); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment