Class: QgsOptionsDialogHighlightWidget

Container for a widget to be used to search text in the option dialog.

If the widget type is handled, it is valid.

It can perform a text search in the widget and highlight it in case of success. This uses stylesheets.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: highlightText(), reset(), searchText()

Class Hierarchy

Inheritance diagram of qgis.gui.QgsOptionsDialogHighlightWidget

Subclasses

QgsOptionsDialogHighlightButton

A highlight widget for buttons.

QgsOptionsDialogHighlightCheckBox

A highlight widget for checkboxes.

QgsOptionsDialogHighlightGroupBox

A highlight widget for group boxes.

QgsOptionsDialogHighlightLabel

A highlight widget for labels.

QgsOptionsDialogHighlightTable

A highlight widget for table widgets.

QgsOptionsDialogHighlightTree

A highlight widget for trees.

QgsSettingsTreeWidget

A widget with the settings tree to visualize, search and edit settings.

Abstract Methods

highlightText

Highlight the text in the widget.

reset

reset the style of the widgets to its original state

searchText

Search for the text in the widget and return True if it was found

Methods

isValid

Returns if it valid: if the widget type is handled and if the widget is not still available

searchHighlight

search for a text pattern and highlight the widget if the text is found

widget

Returns the widget

Static Methods

createWidget

create a highlight widget implementation for the proper widget type.

class qgis.gui.QgsOptionsDialogHighlightWidget[source]

Bases: object

__init__(widget: QWidget | None = None)

Constructor

Parameters:

widget (Optional[QWidget] = None) – the widget used to search text into

__init__(a0: QgsOptionsDialogHighlightWidget)
Parameters:

a0 (QgsOptionsDialogHighlightWidget)

static createWidget(widget: QWidget | None) QgsOptionsDialogHighlightWidget | None[source]

create a highlight widget implementation for the proper widget type. For instance a QgsOptionsDialogHighlightButton for button.

Return type:

Optional[QgsOptionsDialogHighlightWidget]

Returns:

a QgsOptionsDialogHighlightWidget or None if there is no implementation for the given widget.

Parameters:

widget (Optional[QWidget])

abstract highlightText(self, text: str | None) bool[source]

Highlight the text in the widget.

Return type:

bool

Returns:

True if the text could be highlighted.

Parameters:

text (Optional[str])

isValid(self) bool[source]

Returns if it valid: if the widget type is handled and if the widget is not still available

Return type:

bool

abstract reset(self)[source]

reset the style of the widgets to its original state

searchHighlight(self, text: str | None) bool[source]

search for a text pattern and highlight the widget if the text is found

Return type:

bool

Returns:

True if the text pattern is found

Parameters:

text (Optional[str])

abstract searchText(self, text: str | None) bool[source]

Search for the text in the widget and return True if it was found

Parameters:

text (Optional[str])

Return type:

bool

widget(self) QWidget | None[source]

Returns the widget

Return type:

Optional[QWidget]