QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
QgsGui Class Reference

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

#include <qgsgui.h>

Inheritance diagram for QgsGui:
Inheritance graph
[legend]

Public Types

enum  HigFlag { HigMenuTextIsTitleCase = 1 << 0 , HigDialogTitleIsTitleCase = 1 << 1 }
 HIG flags, which indicate the Human Interface Guidelines for the current platform. More...
 
typedef QFlags< HigFlagHigFlags
 
enum  ProjectCrsBehavior { UseCrsOfFirstLayerAdded = 1 , UsePresetCrs = 2 }
 Defines the behavior to use when setting the CRS for a newly created project. More...
 

Signals

void optionsChanged ()
 This signal is emitted whenever the application options have been changed.
 

Public Member Functions

 QgsGui (const QgsGui &other)=delete
 
 ~QgsGui ()
 
QgsGuioperator= (const QgsGui &other)=delete
 

Static Public Member Functions

static QgsAdvancedDigitizingToolsRegistryadvancedDigitizingToolsRegistry ()
 Returns the global advanced digitizing tools registry, used for registering advanced digitizing tools.
 
static QgsAnnotationItemGuiRegistryannotationItemGuiRegistry ()
 Returns the global annotation item GUI registry, used for registering the GUI behavior of annotation items.
 
static QgsCodeEditorColorSchemeRegistrycodeEditorColorSchemeRegistry ()
 Returns the global code editor color scheme registry, used for registering the color schemes for QgsCodeEditor widgets.
 
static QgsDataItemGuiProviderRegistrydataItemGuiProviderRegistry ()
 Returns the global data item GUI provider registry, used for tracking providers which affect the browser GUI.
 
static QgsEditorWidgetRegistryeditorWidgetRegistry ()
 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 QScreen * findScreenAt (QPoint point)
 Returns the screen at the given global point (pixel).
 
static bool hasWebEngine ()
 Checks whether QWebEngineView is available to display HTML content.
 
static QgsGui::HigFlags higFlags ()
 Returns the platform's HIG flags.
 
static QgsHistoryProviderRegistryhistoryProviderRegistry ()
 Returns the global history provider registry, used for tracking history providers.
 
static void initCalloutWidgets ()
 Initializes callout widgets.
 
static QgsInputControllerManagerinputControllerManager ()
 Returns the global input controller manager.
 
static QgsGuiinstance ()
 Returns a pointer to the singleton instance.
 
static QgsLayerTreeEmbeddedWidgetRegistrylayerTreeEmbeddedWidgetRegistry ()
 Returns the global layer tree embedded widget registry, used for registering widgets that may be embedded into layer tree view.
 
static QgsLayoutItemGuiRegistrylayoutItemGuiRegistry ()
 Returns the global layout item GUI registry, used for registering the GUI behavior of layout items.
 
static QgsMapLayerActionRegistrymapLayerActionRegistry ()
 Returns the global map layer action registry, used for registering map layer actions.
 
static QgsMapToolShapeRegistrymapToolShapeRegistry ()
 Returns the registry of shape map tools.
 
static QgsNative * nativePlatformInterface ()
 Returns the global native interface, which offers abstraction to the host OS's underlying public interfaces.
 
static QgsNumericFormatGuiRegistrynumericFormatGuiRegistry ()
 Returns the global numeric format gui registry, used for registering the GUI widgets associated with QgsNumericFormats.
 
static QgsProcessingFavoriteAlgorithmManager * processingFavoriteAlgorithmManager ()
 Returns the global Processing favorite algorithm manager, used for tracking favorite Processing algorithms.
 
static QgsProcessingGuiRegistryprocessingGuiRegistry ()
 Returns the global processing gui registry, used for registering the GUI behavior of processing algorithms.
 
static QgsProcessingRecentAlgorithmLog * processingRecentAlgorithmLog ()
 Returns the global processing recent algorithm log, used for tracking recently used processing algorithms.
 
static QgsProjectStorageGuiRegistryprojectStorageGuiRegistry ()
 Returns the global GUI-related project storage registry.
 
static QgsProviderGuiRegistryproviderGuiRegistry ()
 Returns the registry of GUI-related components of data providers.
 
static bool pythonEmbeddedInProjectAllowed (void(*lambda)()=nullptr, QgsMessageBar *messageBar=nullptr, Qgis::PythonEmbeddedType embeddedType=Qgis::PythonEmbeddedType::Macro)
 Returns true if python embedded in a project is currently allowed to be loaded.
 
static QgsRelationWidgetRegistryrelationWidgetRegistry ()
 Returns the global relation widget registry, used for managing all known relation widget factories.
 
static QColor sampleColor (QPoint point)
 Samples the color on screen at the specified global point (pixel).
 
static QgsSensorGuiRegistrysensorGuiRegistry ()
 Returns the registry of GUI-related components for sensors.
 
static QgsSettingsEditorWidgetRegistrysettingsEditorWidgetRegistry ()
 Returns the registry of settings editors.
 
static QgsSettingsRegistryGuisettingsRegistryGui ()
 Returns the gui's settings registry, used for managing gui settings.
 
static void setWindowManager (QgsWindowManagerInterface *manager)
 Sets the global window manager.
 
static QgsShortcutsManagershortcutsManager ()
 Returns the global shortcuts manager, used for managing a QAction and QShortcut sequences.
 
static QgsSourceSelectProviderRegistrysourceSelectProviderRegistry ()
 Returns the global source select provider registry, used for managing all known source select widget factories.
 
static QgsProviderSourceWidgetProviderRegistrysourceWidgetProviderRegistry ()
 Returns the registry of provider source widget providers.
 
static QgsSubsetStringEditorProviderRegistrysubsetStringEditorProviderRegistry ()
 Returns the registry of subset string editors of data providers.
 
static QgsWindowManagerInterface * windowManager ()
 Returns the global window manager, if set.
 

Static Public Attributes

static QgsSettingsTreeNodesTtreeWidgetLastUsedValues = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "widget-last-used-values" ) )
 

Detailed Description

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

Definition at line 63 of file qgsgui.h.

Member Typedef Documentation

◆ HigFlags

typedef QFlags< HigFlag > QgsGui::HigFlags

Definition at line 272 of file qgsgui.h.

Member Enumeration Documentation

◆ HigFlag

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

Since
QGIS 3.4
Enumerator
HigMenuTextIsTitleCase 

Menu action texts should be title case.

HigDialogTitleIsTitleCase 

Dialog titles should be title case.

Definition at line 267 of file qgsgui.h.

◆ ProjectCrsBehavior

Defines the behavior to use when setting the CRS for a newly created project.

Enumerator
UseCrsOfFirstLayerAdded 

Set the project CRS to the CRS of the first layer added to a new project.

UsePresetCrs 

Always set new projects to use a preset default CRS.

Definition at line 73 of file qgsgui.h.

Constructor & Destructor Documentation

◆ QgsGui()

QgsGui::QgsGui ( const QgsGui other)
delete

◆ ~QgsGui()

QgsGui::~QgsGui ( )

Definition at line 246 of file qgsgui.cpp.

Member Function Documentation

◆ advancedDigitizingToolsRegistry()

QgsAdvancedDigitizingToolsRegistry * QgsGui::advancedDigitizingToolsRegistry ( )
static

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

Since
QGIS 3.40

Definition at line 150 of file qgsgui.cpp.

◆ annotationItemGuiRegistry()

QgsAnnotationItemGuiRegistry * QgsGui::annotationItemGuiRegistry ( )
static

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

Since
QGIS 3.22

Definition at line 145 of file qgsgui.cpp.

◆ codeEditorColorSchemeRegistry()

QgsCodeEditorColorSchemeRegistry * QgsGui::codeEditorColorSchemeRegistry ( )
static

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

Since
QGIS 3.16

Definition at line 165 of file qgsgui.cpp.

◆ dataItemGuiProviderRegistry()

QgsDataItemGuiProviderRegistry * QgsGui::dataItemGuiProviderRegistry ( )
static

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

Since
QGIS 3.6

Definition at line 180 of file qgsgui.cpp.

◆ editorWidgetRegistry()

QgsEditorWidgetRegistry * QgsGui::editorWidgetRegistry ( )
static

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

Definition at line 95 of file qgsgui.cpp.

◆ enableAutoGeometryRestore()

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

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.

Definition at line 210 of file qgsgui.cpp.

◆ findScreenAt()

QScreen * QgsGui::findScreenAt ( QPoint  point)
static

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

Since
QGIS 3.10

Definition at line 292 of file qgsgui.cpp.

◆ hasWebEngine()

bool QgsGui::hasWebEngine ( )
static

Checks whether QWebEngineView is available to display HTML content.

Since
QGIS 3.42

Definition at line 524 of file qgsgui.cpp.

◆ higFlags()

QgsGui::HigFlags QgsGui::higFlags ( )
static

Returns the platform's HIG flags.

Since
QGIS 3.4

Definition at line 234 of file qgsgui.cpp.

◆ historyProviderRegistry()

QgsHistoryProviderRegistry * QgsGui::historyProviderRegistry ( )
static

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

Since
QGIS 3.24

Definition at line 200 of file qgsgui.cpp.

◆ initCalloutWidgets()

void QgsGui::initCalloutWidgets ( )
static

Initializes callout widgets.

Note
Not available in Python bindings
Since
QGIS 3.40

Definition at line 494 of file qgsgui.cpp.

◆ inputControllerManager()

QgsInputControllerManager * QgsGui::inputControllerManager ( )
static

Returns the global input controller manager.

Since
QGIS 3.32

Definition at line 224 of file qgsgui.cpp.

◆ instance()

QgsGui * QgsGui::instance ( )
static

Returns a pointer to the singleton instance.

Definition at line 79 of file qgsgui.cpp.

◆ layerTreeEmbeddedWidgetRegistry()

QgsLayerTreeEmbeddedWidgetRegistry * QgsGui::layerTreeEmbeddedWidgetRegistry ( )
static

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

Definition at line 130 of file qgsgui.cpp.

◆ layoutItemGuiRegistry()

QgsLayoutItemGuiRegistry * QgsGui::layoutItemGuiRegistry ( )
static

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

Definition at line 140 of file qgsgui.cpp.

◆ mapLayerActionRegistry()

QgsMapLayerActionRegistry * QgsGui::mapLayerActionRegistry ( )
static

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

Definition at line 135 of file qgsgui.cpp.

◆ mapToolShapeRegistry()

QgsMapToolShapeRegistry * QgsGui::mapToolShapeRegistry ( )
static

Returns the registry of shape map tools.

Note
Not available in Python bindings
Since
QGIS 3.26

Definition at line 105 of file qgsgui.cpp.

◆ nativePlatformInterface()

QgsNative * QgsGui::nativePlatformInterface ( )
static

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

Note
Not available in Python bindings

Definition at line 85 of file qgsgui.cpp.

◆ numericFormatGuiRegistry()

QgsNumericFormatGuiRegistry * QgsGui::numericFormatGuiRegistry ( )
static

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

Since
QGIS 3.12

Definition at line 160 of file qgsgui.cpp.

◆ operator=()

QgsGui & QgsGui::operator= ( const QgsGui other)
delete

◆ optionsChanged

void QgsGui::optionsChanged ( )
signal

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.

Since
QGIS 3.16

◆ processingFavoriteAlgorithmManager()

QgsProcessingFavoriteAlgorithmManager * QgsGui::processingFavoriteAlgorithmManager ( )
static

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

Since
QGIS 3.40

Definition at line 170 of file qgsgui.cpp.

◆ processingGuiRegistry()

QgsProcessingGuiRegistry * QgsGui::processingGuiRegistry ( )
static

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

Since
QGIS 3.2

Definition at line 155 of file qgsgui.cpp.

◆ processingRecentAlgorithmLog()

QgsProcessingRecentAlgorithmLog * QgsGui::processingRecentAlgorithmLog ( )
static

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

Since
QGIS 3.4

Definition at line 175 of file qgsgui.cpp.

◆ projectStorageGuiRegistry()

QgsProjectStorageGuiRegistry * QgsGui::projectStorageGuiRegistry ( )
static

Returns the global GUI-related project storage registry.

Since
QGIS 3.10

Definition at line 185 of file qgsgui.cpp.

◆ providerGuiRegistry()

QgsProviderGuiRegistry * QgsGui::providerGuiRegistry ( )
static

Returns the registry of GUI-related components of data providers.

Since
QGIS 3.10

Definition at line 190 of file qgsgui.cpp.

◆ pythonEmbeddedInProjectAllowed()

bool QgsGui::pythonEmbeddedInProjectAllowed ( void(*)()  lambda = nullptr,
QgsMessageBar messageBar = nullptr,
Qgis::PythonEmbeddedType  embeddedType = Qgis::PythonEmbeddedType::Macro 
)
static

Returns true if python embedded in a project is currently allowed to be loaded.

If the global option is to ask user, a modal dialog will be shown for macros or a button to enable Python expressions will be shown in a message bar.

Parameters
lambdaa pointer to a lambda method. If specified, the dialog is not modal, a message is shown with a button to enable macro. The lambda will be run either if macros are currently allowed or if the user accepts the message. The messageBar must be given in such case.
messageBarthe message bar must be provided if a lambda method is used.
embeddedTypeenum value to identify if macros or expression functions should be checked.
Note
Not available in Python bindings
Since
QGIS 3.40

Definition at line 376 of file qgsgui.cpp.

◆ relationWidgetRegistry()

QgsRelationWidgetRegistry * QgsGui::relationWidgetRegistry ( )
static

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

Since
QGIS 3.18

Definition at line 100 of file qgsgui.cpp.

◆ sampleColor()

QColor QgsGui::sampleColor ( QPoint  point)
static

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

Since
QGIS 3.10

Definition at line 277 of file qgsgui.cpp.

◆ sensorGuiRegistry()

QgsSensorGuiRegistry * QgsGui::sensorGuiRegistry ( )
static

Returns the registry of GUI-related components for sensors.

Since
QGIS 3.32

Definition at line 195 of file qgsgui.cpp.

◆ settingsEditorWidgetRegistry()

QgsSettingsEditorWidgetRegistry * QgsGui::settingsEditorWidgetRegistry ( )
static

Returns the registry of settings editors.

Since
QGIS 3.32

Definition at line 205 of file qgsgui.cpp.

◆ settingsRegistryGui()

QgsSettingsRegistryGui * QgsGui::settingsRegistryGui ( )
static

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

Since
QGIS 3.22

Definition at line 90 of file qgsgui.cpp.

◆ setWindowManager()

void QgsGui::setWindowManager ( QgsWindowManagerInterface *  manager)
static

Sets the global window manager.

Ownership is transferred to the QgsGui instance.

See also
windowManager()
Since
QGIS 3.4

Definition at line 229 of file qgsgui.cpp.

◆ shortcutsManager()

QgsShortcutsManager * QgsGui::shortcutsManager ( )
static

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

Definition at line 125 of file qgsgui.cpp.

◆ sourceSelectProviderRegistry()

QgsSourceSelectProviderRegistry * QgsGui::sourceSelectProviderRegistry ( )
static

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

Definition at line 110 of file qgsgui.cpp.

◆ sourceWidgetProviderRegistry()

QgsProviderSourceWidgetProviderRegistry * QgsGui::sourceWidgetProviderRegistry ( )
static

Returns the registry of provider source widget providers.

Since
QGIS 3.18

Definition at line 120 of file qgsgui.cpp.

◆ subsetStringEditorProviderRegistry()

QgsSubsetStringEditorProviderRegistry * QgsGui::subsetStringEditorProviderRegistry ( )
static

Returns the registry of subset string editors of data providers.

Since
QGIS 3.18

Definition at line 115 of file qgsgui.cpp.

◆ windowManager()

QgsWindowManagerInterface * QgsGui::windowManager ( )
static

Returns the global window manager, if set.

See also
setWindowManager()
Since
QGIS 3.4

Definition at line 219 of file qgsgui.cpp.

Member Data Documentation

◆ sTtreeWidgetLastUsedValues

QgsSettingsTreeNode* QgsGui::sTtreeWidgetLastUsedValues = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "widget-last-used-values" ) )
inlinestatic

Definition at line 68 of file qgsgui.h.


The documentation for this class was generated from the following files: