Class: QgsExpressionItem

An expression item that can be used in the QgsExpressionBuilderWidget tree.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsExpressionItem

Base classes

QStandardItem

Methods

getExpressionText

getHelpText

Gets the help text that is associated with this expression item.

getItemType

Gets the type of expression item, e.g., header, field, ExpressionNode.

setHelpText

Set the help text for the current item

Attributes

CUSTOM_SORT_ROLE

Custom sort order role

ExpressionNode

Field

Header

ITEM_NAME_ROLE

Item name role

ITEM_TYPE_ROLE

Item type role

LAYER_ID_ROLE

SEARCH_TAGS_ROLE

Search tags role

class qgis.gui.QgsExpressionItem[source]

Bases: QStandardItem

CUSTOM_SORT_ROLE: int = 257

Custom sort order role

ExpressionNode = 2
Field = 1
Header = 0
ITEM_NAME_ROLE: int = 260

Item name role

ITEM_TYPE_ROLE: int = 258

Item type role

LAYER_ID_ROLE: int = 261

Added in version 3.24.

SEARCH_TAGS_ROLE: int = 259

Search tags role

getExpressionText(self) str[source]
Return type:

str

getHelpText(self) str[source]

Gets the help text that is associated with this expression item.

Return type:

str

Returns:

The help text.

getItemType(self) QgsExpressionItem.ItemType[source]

Gets the type of expression item, e.g., header, field, ExpressionNode.

Return type:

QgsExpressionItem.ItemType

Returns:

The QgsExpressionItem.ItemType

setHelpText(self, helpText: str | None)[source]

Set the help text for the current item

Note

The help text can be set as a html string.

Parameters:

helpText (Optional[str])