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.

New in version 3.0:

Methods

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.

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.

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).

setWindowManager

Sets the global window manager.

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

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

Attributes

HigDialogTitleIsTitleCase

HigMenuTextIsTitleCase

UseCrsOfFirstLayerAdded

UsePresetCrs

HigDialogTitleIsTitleCase = 2
class HigFlag

Bases: int

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

Bases: sip.wrapper

HigMenuTextIsTitleCase = 1
class ProjectCrsBehavior

Bases: int

baseClass

alias of QgsGui

UseCrsOfFirstLayerAdded = 1
UsePresetCrs = 2
annotationItemGuiRegistry() QgsAnnotationItemGuiRegistry

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

New in version 3.22.

Return type:

QgsAnnotationItemGuiRegistry

codeEditorColorSchemeRegistry() QgsCodeEditorColorSchemeRegistry

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

New in version 3.16.

Return type:

QgsCodeEditorColorSchemeRegistry

dataItemGuiProviderRegistry() QgsDataItemGuiProviderRegistry

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

New in version 3.6.

Return type:

QgsDataItemGuiProviderRegistry

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 = '') –

findScreenAt(point: QPoint) QScreen

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

New in version 3.10.

Parameters:

point (QPoint) –

Return type:

QScreen

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

numericFormatGuiRegistry() QgsNumericFormatGuiRegistry

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

New in version 3.12.

Return type:

QgsNumericFormatGuiRegistry

optionsChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

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

projectStorageGuiRegistry() QgsProjectStorageGuiRegistry

Returns the global GUI-related project storage registry

New in version 3.10.

Return type:

QgsProjectStorageGuiRegistry

providerGuiRegistry() QgsProviderGuiRegistry

Returns the registry of GUI-related components of data providers

New in version 3.10.

Return type:

QgsProviderGuiRegistry

relationWidgetRegistry() QgsRelationWidgetRegistry

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

New in version 3.18.

Return type:

QgsRelationWidgetRegistry

sampleColor(point: QPoint) QColor

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

New in version 3.10.

Parameters:

point (QPoint) –

Return type:

QColor

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) –

settingsRegistryGui() QgsSettingsRegistryGui

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

New in version 3.22.

Return type:

QgsSettingsRegistryGui

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

sourceWidgetProviderRegistry() QgsProviderSourceWidgetProviderRegistry

Returns the registry of provider source widget providers.

New in version 3.18.

Return type:

QgsProviderSourceWidgetProviderRegistry

subsetStringEditorProviderRegistry() QgsSubsetStringEditorProviderRegistry

Returns the registry of subset string editors of data providers

New in version 3.18.

Return type:

QgsSubsetStringEditorProviderRegistry

windowManager() QgsWindowManagerInterface

Returns the global window manager, if set.

New in version 3.4.

Return type:

QgsWindowManagerInterface