Class: QgsOptionsWidgetFactory

Class Hierarchy

Inheritance diagram of qgis.gui.QgsOptionsWidgetFactory

Base classes

QObject

Methods

createWidget

Factory function to create the widget on demand as needed by the options dialog.

icon

The icon that will be shown in the UI for the panel.

key

The key of the panel (untranslated title).

pagePositionHint

Returns a tab name hinting at where this page should be inserted into the options properties tab list.

path

Returns the path to place the widget page at, for options dialogs which are structured using a tree view.

setIcon

Set the icon to show in the interface for the factory object.

setKey

Set the key for the interface.

setTitle

Set the title for the interface.

title

The title of the panel.

class qgis.gui.QgsOptionsWidgetFactory[source]

Bases: QObject

__init__(title: str | None, icon: QIcon, key: str | None = '')

Constructor

Parameters:
  • title (Optional[str])

  • icon (QIcon)

  • key (Optional[str] = '')

createWidget(self, parent: QWidget | None = None) QgsOptionsPageWidget | None[source]

Factory function to create the widget on demand as needed by the options dialog.

Parameters:

parent (Optional[QWidget] = None) – The parent of the widget.

Return type:

Optional[QgsOptionsPageWidget]

Returns:

A new widget to show as a page in the options dialog.

icon(self) QIcon[source]

The icon that will be shown in the UI for the panel.

Return type:

QIcon

Returns:

A QIcon for the panel icon.

See also

setIcon()

key(self) str[source]

The key of the panel (untranslated title).

See also

setKey()

Added in version 3.32.

Return type:

str

pagePositionHint(self) str[source]

Returns a tab name hinting at where this page should be inserted into the options properties tab list.

If the returned string is non-empty, the options widget page will be inserted before the existing page with matching object name.

The default implementation returns an empty string, which causes the widget to be placed at the end of the dialog page list.

Added in version 3.18.

Return type:

str

path(self) List[str][source]

Returns the path to place the widget page at, for options dialogs which are structured using a tree view.

A factory which returns “Code”, “Javascript” would have its widget placed in a group named “Javascript”, contained in a parent group named “Code”.

Added in version 3.22.

Return type:

List[str]

setIcon(self, icon: QIcon)[source]

Set the icon to show in the interface for the factory object.

See also

icon()

Parameters:

icon (QIcon)

setKey(self, key: str | None)[source]

Set the key for the interface.

See also

key()

Parameters:

key (Optional[str])

setTitle(self, title: str | None)[source]

Set the title for the interface.

See also

title()

Parameters:

title (Optional[str])

title(self) str[source]

The title of the panel.

See also

setTitle()

Return type:

str