Class: QgsOptionsWidgetFactory¶
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: createWidget()
Class Hierarchy¶
Base classes¶
Abstract Methods
Factory function to create the widget on demand as needed by the options dialog. |
Methods
Set the icon to show in the interface for the factory object. |
|
Set the key for the interface. |
|
Set the title for the interface. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsOptionsWidgetFactory. See the FAQ for more details.
The icon that will be shown in the UI for the panel. |
|
The key of the panel (untranslated title). |
|
Returns a tab name hinting at where this page should be inserted into the options properties tab list. |
|
Returns the path to place the widget page at, for options dialogs which are structured using a tree view. |
|
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] = '')
- abstract 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.
- virtual 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
- virtual key(self) str [source]¶
The key of the panel (untranslated title).
See also
Added in version 3.32.
- Return type:
str
- virtual 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
- virtual 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
- Parameters:
icon (QIcon)
- setKey(self, key: str | None)[source]¶
Set the
key
for the interface.See also
- Parameters:
key (Optional[str])
- setTitle(self, title: str | None)[source]¶
Set the
title
for the interface.See also
- Parameters:
title (Optional[str])