Class: QgsOptionsPageWidget

Base class for widgets for pages included in the options dialog.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsOptionsPageWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

apply

Called to permanently apply the settings shown in the options page (e.g. save them to QgsSettings objects).

cancel

Called to cancel settings changed in the options page (e.g. save them to QgsSettings objects).

helpKey

Returns the optional help key for the options page.

isValid

Validates the current state of the widget.

registerHighlightWidget

Register a highlight widget to be used to search and highlight text in options dialogs.

class qgis.gui.QgsOptionsPageWidget[source]

Bases: QWidget

__init__(parent: QWidget | None = None)

Constructor for QgsOptionsPageWidget.

Parameters:

parent (Optional[QWidget] = None)

apply(self)[source]

Called to permanently apply the settings shown in the options page (e.g. save them to QgsSettings objects). This is usually called when the options dialog is accepted.

cancel(self)[source]

Called to cancel settings changed in the options page (e.g. save them to QgsSettings objects). This is usually called when the options dialog is canceled.

helpKey(self) str[source]

Returns the optional help key for the options page. The default implementation returns an empty string.

If a non-empty string is returned by this method, it will be used as the help key retrieved when the “help” button is clicked while this options page is active.

If an empty string is returned by this method the default QGIS options help will be retrieved.

Return type:

str

isValid(self) bool[source]

Validates the current state of the widget.

Subclasses should return True if the widget state is currently valid and acceptable to apply().

The default implementation returns True.

Added in version 3.24.

Return type:

bool

registerHighlightWidget(self, highlightWidget: QgsOptionsDialogHighlightWidget | None)[source]

Register a highlight widget to be used to search and highlight text in options dialogs. This can be used to provide a custom implementation of QgsOptionsDialogHighlightWidget.

Parameters:

highlightWidget (Optional[QgsOptionsDialogHighlightWidget])