Utils: allow passing data via info bar combo box

Change-Id: I47daa83a533a76eb4ad0ab3f5cf8c04faf389b98
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
David Schulz
2022-03-18 11:38:35 +01:00
parent 1960799be2
commit 2b286c755b
4 changed files with 31 additions and 13 deletions

View File

@@ -3254,8 +3254,8 @@ void TextEditorWidgetPrivate::updateSyntaxInfoBar(const Highlighter::Definitions
BaseTextEditor::tr("More than one highlight definition was found for this file. "
"Which one should be used to highlight this file?"));
info.setComboInfo(Utils::transform(definitions, &Highlighter::Definition::name),
[this](const QString &definition) {
this->configureGenericHighlighter(Highlighter::definitionForName(definition));
[this](const InfoBarEntry::ComboInfo &info) {
this->configureGenericHighlighter(Highlighter::definitionForName(info.displayText));
});
info.addCustomButton(BaseTextEditor::tr("Remember My Choice"), [multiple, this]() {