TextEditor: Handle overloaded operators as functions

Overloaded operators are semantically very similar to functions. So it make
sense to highlight them the same. It provides the user also with feedback
that he can jump to the declaration of the operator etc..

Change-Id: I110084e3e53882c9d5cbfa88442a93914792db17
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Marco Bubke
2018-09-25 11:38:22 +02:00
parent 6f14b6f399
commit 25ea9a4d24

View File

@@ -180,10 +180,11 @@ TextEditorSettings::TextEditorSettings()
tr("Name of function at its definition."), tr("Name of function at its definition."),
Format::createMixinFormat(), Format::createMixinFormat(),
FormatDescription::ShowAllControls); FormatDescription::ShowAllControls);
functionFormat.setItalic(true); Format virtualFunctionFormat(functionFormat);
virtualFunctionFormat.setItalic(true);
formatDescr.emplace_back(C_VIRTUAL_METHOD, tr("Virtual Function"), formatDescr.emplace_back(C_VIRTUAL_METHOD, tr("Virtual Function"),
tr("Name of function declared as virtual."), tr("Name of function declared as virtual."),
functionFormat); virtualFunctionFormat);
formatDescr.emplace_back(C_BINDING, tr("QML Binding"), formatDescr.emplace_back(C_BINDING, tr("QML Binding"),
tr("QML item property, that allows a " tr("QML item property, that allows a "
@@ -246,7 +247,7 @@ TextEditorSettings::TextEditorSettings()
formatDescr.emplace_back(C_OVERLOADED_OPERATOR, formatDescr.emplace_back(C_OVERLOADED_OPERATOR,
tr("Overloaded Operators"), tr("Overloaded Operators"),
tr("Calls and declarations of overloaded (user-defined) operators."), tr("Calls and declarations of overloaded (user-defined) operators."),
Format::createMixinFormat(), functionFormat,
FormatDescription::ShowAllControls); FormatDescription::ShowAllControls);
formatDescr.emplace_back(C_PREPROCESSOR, tr("Preprocessor"), formatDescr.emplace_back(C_PREPROCESSOR, tr("Preprocessor"),
tr("Preprocessor directives."), Qt::darkBlue); tr("Preprocessor directives."), Qt::darkBlue);