QgsGui class

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

Public types

enum HigFlag { HigMenuTextIsTitleCase = 1 << 0, HigDialogTitleIsTitleCase = 1 << 1 }
HIG flags, which indicate the Human Interface Guidelines for the current platform.

Public static functions

static auto dataItemGuiProviderRegistry() -> QgsDataItemGuiProviderRegistry*
Returns the global data item GUI provider registry, used for tracking providers which affect the browser GUI.
static auto editorWidgetRegistry() -> QgsEditorWidgetRegistry*
Returns the global editor widget registry, used for managing all known edit widget factories.
static void enableAutoGeometryRestore(QWidget* widget, const QString& key = QString())
Register the widget to allow its position to be automatically saved and restored when open and closed.
static auto higFlags() -> QgsGui::HigFlags
Returns the platform's HIG flags.
static auto instance() -> QgsGui*
Returns a pointer to the singleton instance.
static auto layerTreeEmbeddedWidgetRegistry() -> QgsLayerTreeEmbeddedWidgetRegistry*
Returns the global layer tree embedded widget registry, used for registering widgets that may be embedded into layer tree view.
static auto layoutItemGuiRegistry() -> QgsLayoutItemGuiRegistry*
Returns the global layout item GUI registry, used for registering the GUI behavior of layout items.
static auto mapLayerActionRegistry() -> QgsMapLayerActionRegistry*
Returns the global map layer action registry, used for registering map layer actions.
static auto nativePlatformInterface() -> QgsNative*
Returns the global native interface, which offers abstraction to the host OS's underlying public interfaces.
static auto processingGuiRegistry() -> QgsProcessingGuiRegistry*
Returns the global processing gui registry, used for registering the GUI behavior of processing algorithms.
static auto processingRecentAlgorithmLog() -> QgsProcessingRecentAlgorithmLog*
Returns the global processing recent algorithm log, used for tracking recently used processing algorithms.
static void setWindowManager(QgsWindowManagerInterface* manager)
Sets the global window manager.
static auto shortcutsManager() -> QgsShortcutsManager*
Returns the global shortcuts manager, used for managing a QAction and QShortcut sequences.
static auto sourceSelectProviderRegistry() -> QgsSourceSelectProviderRegistry*
Returns the global source select provider registry, used for managing all known source select widget factories.
static auto windowManager() -> QgsWindowManagerInterface*
Returns the global window manager, if set.

Constructors, destructors, conversion operators

QgsGui(const QgsGui& other) deleted
QgsGui cannot be copied.

Public functions

auto operator=(const QgsGui& other) -> QgsGui& deleted
QgsGui cannot be copied.

Enum documentation

enum QgsGui::HigFlag

HIG flags, which indicate the Human Interface Guidelines for the current platform.

Enumerators
HigMenuTextIsTitleCase

Menu action texts should be title case.

HigDialogTitleIsTitleCase

Dialog titles should be title case.

Function documentation

static QgsDataItemGuiProviderRegistry* QgsGui::dataItemGuiProviderRegistry()

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

static void QgsGui::enableAutoGeometryRestore(QWidget* widget, const QString& key = QString())

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.

static QgsGui::HigFlags QgsGui::higFlags()

Returns the platform's HIG flags.

static QgsNative* QgsGui::nativePlatformInterface()

Returns the global native interface, which offers abstraction to the host OS's underlying public interfaces.

static QgsProcessingGuiRegistry* QgsGui::processingGuiRegistry()

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

static QgsProcessingRecentAlgorithmLog* QgsGui::processingRecentAlgorithmLog()

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

static void QgsGui::setWindowManager(QgsWindowManagerInterface* manager)

Sets the global window manager.

Ownership is transferred to the QgsGui instance.

static QgsWindowManagerInterface* QgsGui::windowManager()

Returns the global window manager, if set.