Class: QgsGui

class qgis.gui.QgsGui

Bases: PyQt5.QtCore.QObject

QgsGui is a singleton class containing various registry and other global members related to GUI classes.

Methods

editorWidgetRegistry

Returns the global editor widget registry, used for managing all known edit widget factories.

enableAutoGeometryRestore

Register the widget to allow its position to be automatically saved and restored when open and closed.

higFlags

Returns the platform’s HIG flags.

instance

Returns a pointer to the singleton instance.

layerTreeEmbeddedWidgetRegistry

Returns the global layer tree embedded widget registry, used for registering widgets that may be embedded into layer tree view.

layoutItemGuiRegistry

Returns the global layout item GUI registry, used for registering the GUI behavior of layout items.

mapLayerActionRegistry

Returns the global map layer action registry, used for registering map layer actions.

processingGuiRegistry

Returns the global processing gui registry, used for registering the GUI behavior of processing algorithms.

processingRecentAlgorithmLog

Returns the global processing recent algorithm log, used for tracking recently used processing algorithms.

setWindowManager

Sets the global window manager.

shortcutsManager

Returns the global shortcuts manager, used for managing a QAction and QShortcut sequences.

sourceSelectProviderRegistry

Returns the global source select provider registry, used for managing all known source select widget factories.

windowManager

Returns the global window manager, if set.

Attributes

HigDialogTitleIsTitleCase

HigMenuTextIsTitleCase

UseCrsOfFirstLayerAdded

UsePresetCrs

HigDialogTitleIsTitleCase = 2
class HigFlag

Bases: int

class HigFlags

Bases: sip.wrapper

QgsGui.HigFlags(Union[QgsGui.HigFlags, QgsGui.HigFlag]) QgsGui.HigFlags(QgsGui.HigFlags)

HigMenuTextIsTitleCase = 1
class ProjectCrsBehavior

Bases: int

baseClass

alias of QgsGui

UseCrsOfFirstLayerAdded = 1
UsePresetCrs = 2
editorWidgetRegistry() → QgsEditorWidgetRegistry

Returns the global editor widget registry, used for managing all known edit widget factories.

Return type

QgsEditorWidgetRegistry

enableAutoGeometryRestore(widget: QWidget, key: str = '')

Register the widget to allow its position to be automatically saved and restored when open and closed. Use this to avoid needing to call saveGeometry() and restoreGeometry() on your widget.

Parameters
  • widget (QWidget) –

  • key (str = '') –

higFlags() → QgsGui.HigFlags

Returns the platform’s HIG flags.

New in version 3.4.

Return type

QgsGui.HigFlags

instance() → QgsGui

Returns a pointer to the singleton instance.

Return type

QgsGui

layerTreeEmbeddedWidgetRegistry() → QgsLayerTreeEmbeddedWidgetRegistry

Returns the global layer tree embedded widget registry, used for registering widgets that may be embedded into layer tree view.

Return type

QgsLayerTreeEmbeddedWidgetRegistry

layoutItemGuiRegistry() → QgsLayoutItemGuiRegistry

Returns the global layout item GUI registry, used for registering the GUI behavior of layout items.

Return type

QgsLayoutItemGuiRegistry

mapLayerActionRegistry() → QgsMapLayerActionRegistry

Returns the global map layer action registry, used for registering map layer actions.

Return type

QgsMapLayerActionRegistry

processingGuiRegistry() → QgsProcessingGuiRegistry

Returns the global processing gui registry, used for registering the GUI behavior of processing algorithms.

New in version 3.2.

Return type

QgsProcessingGuiRegistry

processingRecentAlgorithmLog() → QgsProcessingRecentAlgorithmLog

Returns the global processing recent algorithm log, used for tracking recently used processing algorithms.

New in version 3.4.

Return type

QgsProcessingRecentAlgorithmLog

setWindowManager(manager: QgsWindowManagerInterface)

Sets the global window manager. Ownership is transferred to the QgsGui instance.

See also

windowManager()

New in version 3.4.

Parameters

manager (QgsWindowManagerInterface) –

shortcutsManager() → QgsShortcutsManager

Returns the global shortcuts manager, used for managing a QAction and QShortcut sequences.

Return type

QgsShortcutsManager

sourceSelectProviderRegistry() → QgsSourceSelectProviderRegistry

Returns the global source select provider registry, used for managing all known source select widget factories.

Return type

QgsSourceSelectProviderRegistry

windowManager() → QgsWindowManagerInterface

Returns the global window manager, if set.

New in version 3.4.

Return type

QgsWindowManagerInterface