Class: QgsGui

QgsGui is a singleton class containing various registry and

Class Hierarchy

Inheritance diagram of qgis.gui.QgsGui

Base classes

QObject

Static Methods

advancedDigitizingToolsRegistry

Returns the global advanced digitizing tools registry, used for registering advanced digitizing tools.

annotationItemGuiRegistry

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

codeEditorColorSchemeRegistry

Returns the global code editor color scheme registry, used for registering the color schemes for QgsCodeEditor widgets.

dataItemGuiProviderRegistry

Returns the global data item GUI provider registry, used for tracking providers which affect the browser GUI.

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.

findScreenAt

Returns the screen at the given global point (pixel).

higFlags

Returns the platform's HIG flags.

historyProviderRegistry

Returns the global history provider registry, used for tracking history providers.

inputControllerManager

Returns the global input controller manager.

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.

numericFormatGuiRegistry

Returns the global numeric format gui registry, used for registering the GUI widgets associated with QgsNumericFormats.

processingFavoriteAlgorithmManager

Returns the global Processing favorite algorithm manager, used for tracking favorite Processing algorithms.

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.

projectStorageGuiRegistry

Returns the global GUI-related project storage registry

providerGuiRegistry

Returns the registry of GUI-related components of data providers

relationWidgetRegistry

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

sampleColor

Samples the color on screen at the specified global point (pixel).

sensorGuiRegistry

Returns the registry of GUI-related components for sensors

setWindowManager

Sets the global window manager.

settingsEditorWidgetRegistry

Returns the registry of settings editors.

settingsRegistryGui

Returns the gui's settings registry, used for managing gui settings.

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.

sourceWidgetProviderRegistry

Returns the registry of provider source widget providers.

subsetStringEditorProviderRegistry

Returns the registry of subset string editors of data providers

windowManager

Returns the global window manager, if set.

Signals

optionsChanged

This signal is emitted whenever the application options have been changed.

Attributes

HigDialogTitleIsTitleCase

HigMenuTextIsTitleCase

UseCrsOfFirstLayerAdded

UsePresetCrs

class qgis.gui.QgsGui[source]

Bases: QObject

HigDialogTitleIsTitleCase = 2
class HigFlag

Bases: int

class HigFlags
class HigFlags(f: QgsGui.HigFlags | QgsGui.HigFlag)
class HigFlags(a0: QgsGui.HigFlags)

Bases: object

HigMenuTextIsTitleCase = 1
class ProjectCrsBehavior

Bases: int

UseCrsOfFirstLayerAdded = 1
UsePresetCrs = 2
static advancedDigitizingToolsRegistry() QgsAdvancedDigitizingToolsRegistry | None[source]

Returns the global advanced digitizing tools registry, used for registering advanced digitizing tools.

Added in version 3.40.

Return type:

Optional[QgsAdvancedDigitizingToolsRegistry]

static annotationItemGuiRegistry() QgsAnnotationItemGuiRegistry | None[source]

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

Added in version 3.22.

Return type:

Optional[QgsAnnotationItemGuiRegistry]

static codeEditorColorSchemeRegistry() QgsCodeEditorColorSchemeRegistry | None[source]

Returns the global code editor color scheme registry, used for registering the color schemes for QgsCodeEditor widgets.

Added in version 3.16.

Return type:

Optional[QgsCodeEditorColorSchemeRegistry]

static dataItemGuiProviderRegistry() QgsDataItemGuiProviderRegistry | None[source]

Returns the global data item GUI provider registry, used for tracking providers which affect the browser GUI.

Added in version 3.6.

Return type:

Optional[QgsDataItemGuiProviderRegistry]

static editorWidgetRegistry() QgsEditorWidgetRegistry | None[source]

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

Return type:

Optional[QgsEditorWidgetRegistry]

static enableAutoGeometryRestore(widget: QWidget | None, key: str | None = '')[source]

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 (Optional[QWidget])

  • key (Optional[str] = '')

static findScreenAt(point: QPoint) QScreen | None[source]

Returns the screen at the given global point (pixel).

Added in version 3.10.

Parameters:

point (QPoint)

Return type:

Optional[QScreen]

static higFlags() QgsGui.HigFlags[source]

Returns the platform’s HIG flags.

Added in version 3.4.

Return type:

QgsGui.HigFlags

static historyProviderRegistry() QgsHistoryProviderRegistry | None[source]

Returns the global history provider registry, used for tracking history providers.

Added in version 3.24.

Return type:

Optional[QgsHistoryProviderRegistry]

static inputControllerManager() QgsInputControllerManager | None[source]

Returns the global input controller manager.

Added in version 3.32.

Return type:

Optional[QgsInputControllerManager]

static instance() QgsGui | None[source]

Returns a pointer to the singleton instance.

Return type:

Optional[QgsGui]

static layerTreeEmbeddedWidgetRegistry() QgsLayerTreeEmbeddedWidgetRegistry | None[source]

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

Return type:

Optional[QgsLayerTreeEmbeddedWidgetRegistry]

static layoutItemGuiRegistry() QgsLayoutItemGuiRegistry | None[source]

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

Return type:

Optional[QgsLayoutItemGuiRegistry]

static mapLayerActionRegistry() QgsMapLayerActionRegistry | None[source]

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

Return type:

Optional[QgsMapLayerActionRegistry]

static numericFormatGuiRegistry() QgsNumericFormatGuiRegistry | None[source]

Returns the global numeric format gui registry, used for registering the GUI widgets associated with QgsNumericFormats.

Added in version 3.12.

Return type:

Optional[QgsNumericFormatGuiRegistry]

signal optionsChanged[source]

This signal is emitted whenever the application options have been changed.

This signal is a “blanket” signal, and will be emitted whenever the options dialog has been accepted regardless of whether or not individual settings are changed. It is designed as a “last resort” fallback only, allowing widgets to respond to possible settings changes.

Added in version 3.16.

static processingFavoriteAlgorithmManager() QgsProcessingFavoriteAlgorithmManager | None[source]

Returns the global Processing favorite algorithm manager, used for tracking favorite Processing algorithms.

Added in version 3.40.

Return type:

Optional[QgsProcessingFavoriteAlgorithmManager]

static processingGuiRegistry() QgsProcessingGuiRegistry | None[source]

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

Added in version 3.2.

Return type:

Optional[QgsProcessingGuiRegistry]

static processingRecentAlgorithmLog() QgsProcessingRecentAlgorithmLog | None[source]

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

Added in version 3.4.

Return type:

Optional[QgsProcessingRecentAlgorithmLog]

static projectStorageGuiRegistry() QgsProjectStorageGuiRegistry | None[source]

Returns the global GUI-related project storage registry

Added in version 3.10.

Return type:

Optional[QgsProjectStorageGuiRegistry]

static providerGuiRegistry() QgsProviderGuiRegistry | None[source]

Returns the registry of GUI-related components of data providers

Added in version 3.10.

Return type:

Optional[QgsProviderGuiRegistry]

static relationWidgetRegistry() QgsRelationWidgetRegistry | None[source]

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

Added in version 3.18.

Return type:

Optional[QgsRelationWidgetRegistry]

static sampleColor(point: QPoint) QColor[source]

Samples the color on screen at the specified global point (pixel).

Added in version 3.10.

Parameters:

point (QPoint)

Return type:

QColor

static sensorGuiRegistry() QgsSensorGuiRegistry | None[source]

Returns the registry of GUI-related components for sensors

Added in version 3.32.

Return type:

Optional[QgsSensorGuiRegistry]

static setWindowManager(manager: QgsWindowManagerInterface | None)[source]

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

See also

windowManager()

Added in version 3.4.

Parameters:

manager (Optional[QgsWindowManagerInterface])

static settingsEditorWidgetRegistry() QgsSettingsEditorWidgetRegistry | None[source]

Returns the registry of settings editors.

Added in version 3.32.

Return type:

Optional[QgsSettingsEditorWidgetRegistry]

static settingsRegistryGui() QgsSettingsRegistryGui | None[source]

Returns the gui’s settings registry, used for managing gui settings.

Added in version 3.22.

Return type:

Optional[QgsSettingsRegistryGui]

static shortcutsManager() QgsShortcutsManager | None[source]

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

Return type:

Optional[QgsShortcutsManager]

static sourceSelectProviderRegistry() QgsSourceSelectProviderRegistry | None[source]

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

Return type:

Optional[QgsSourceSelectProviderRegistry]

static sourceWidgetProviderRegistry() QgsProviderSourceWidgetProviderRegistry | None[source]

Returns the registry of provider source widget providers.

Added in version 3.18.

Return type:

Optional[QgsProviderSourceWidgetProviderRegistry]

static subsetStringEditorProviderRegistry() QgsSubsetStringEditorProviderRegistry | None[source]

Returns the registry of subset string editors of data providers

Added in version 3.18.

Return type:

Optional[QgsSubsetStringEditorProviderRegistry]

static windowManager() QgsWindowManagerInterface | None[source]

Returns the global window manager, if set.

Added in version 3.4.

Return type:

Optional[QgsWindowManagerInterface]