@@ -425,11 +425,11 @@ class CORE_EXPORT QgsExpressionContext
425
425
QVariantMap variablesToMap () const ;
426
426
427
427
/* *
428
- * Returns true if the specified variable name is intended to be highlighted to the
428
+ * Returns true if the specified variable \a name is intended to be highlighted to the
429
429
* user. This is used by the expression builder to more prominently display the
430
430
* variable.
431
- * \param name variable name
432
431
* \see setHighlightedVariables()
432
+ * \see isHighlightedFunction()
433
433
*/
434
434
bool isHighlightedVariable ( const QString &name ) const ;
435
435
@@ -438,9 +438,33 @@ class CORE_EXPORT QgsExpressionContext
438
438
* is used by the expression builder to more prominently display these variables.
439
439
* \param variableNames variable names to highlight
440
440
* \see isHighlightedVariable()
441
+ * \see setHighlightedFunctions()
441
442
*/
442
443
void setHighlightedVariables ( const QStringList &variableNames );
443
444
445
+ /* *
446
+ * Returns true if the specified function \a name is intended to be highlighted to the
447
+ * user. This is used by the expression builder to more prominently display the
448
+ * function.
449
+ * \see setHighlightedFunctions()
450
+ * \see isHighlightedVariable()
451
+ * \since QGIS 3.4
452
+ */
453
+ bool isHighlightedFunction ( const QString &name ) const ;
454
+
455
+ /* *
456
+ * Sets the list of function \a names intended to be highlighted to the user. This
457
+ * is used by the expression builder to more prominently display these functions.
458
+ *
459
+ * Note that these function names may include standard functions which are not functions
460
+ * specific to this context, and these standard functions will also be highlighted to users.
461
+ *
462
+ * \see isHighlightedFunction()
463
+ * \see setHighlightedVariables()
464
+ * \since QGIS 3.4
465
+ */
466
+ void setHighlightedFunctions ( const QStringList &names );
467
+
444
468
/* *
445
469
* Returns the currently active scope from the context for a specified variable name.
446
470
* As scopes later in the stack override earlier contexts, this will be the last matching
@@ -714,6 +738,7 @@ class CORE_EXPORT QgsExpressionContext
714
738
715
739
QList< QgsExpressionContextScope * > mStack ;
716
740
QStringList mHighlightedVariables ;
741
+ QStringList mHighlightedFunctions ;
717
742
718
743
// Cache is mutable because we want to be able to add cached values to const contexts
719
744
mutable QMap< QString, QVariant > mCachedValues ;
0 commit comments