QGIS API Documentation 3.43.0-Master (b60ef06885e)
qgsgui.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgui.h
3 --------
4 begin : May 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSGUI_H
19#define QGSGUI_H
20
21#include "qgis.h"
22#include "qgis_gui.h"
23#include "qgssettingstree.h"
24#include "qgis_sip.h"
25#include <QWidget>
26#include <memory>
27
34class QgsNative;
40class QgsProcessingFavoriteAlgorithmManager;
41class QgsProcessingRecentAlgorithmLog;
42class QgsWindowManagerInterface;
48class QgsMessageBar;
58
64class GUI_EXPORT QgsGui : public QObject
65{
66 Q_OBJECT
67
68 public:
69 static inline QgsSettingsTreeNode *sTtreeWidgetGeometry = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "widget-geometry" ) ) SIP_SKIP;
70 static inline QgsSettingsTreeNode *sTtreeWidgetLastUsedValues = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "widget-last-used-values" ) ) SIP_SKIP;
71
76 {
77 UseCrsOfFirstLayerAdded = 1,
78 UsePresetCrs = 2,
79 };
80 Q_ENUM( ProjectCrsBehavior )
81
82 QgsGui( const QgsGui &other ) = delete;
83 QgsGui &operator=( const QgsGui &other ) = delete;
84
88 static QgsGui *instance();
89
95 SIP_SKIP static QgsNative *nativePlatformInterface();
96
101 static QgsSettingsRegistryGui *settingsRegistryGui() SIP_KEEPREFERENCE;
102
106 static QgsEditorWidgetRegistry *editorWidgetRegistry() SIP_KEEPREFERENCE;
107
111 static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry() SIP_KEEPREFERENCE;
112
116 static QgsShortcutsManager *shortcutsManager();
117
121 static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry() SIP_KEEPREFERENCE;
122
126 static QgsMapLayerActionRegistry *mapLayerActionRegistry() SIP_KEEPREFERENCE;
127
131 static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry() SIP_KEEPREFERENCE;
132
138 static QgsAnnotationItemGuiRegistry *annotationItemGuiRegistry() SIP_KEEPREFERENCE;
139
145 static QgsAdvancedDigitizingToolsRegistry *advancedDigitizingToolsRegistry() SIP_KEEPREFERENCE;
146
151 static QgsProcessingGuiRegistry *processingGuiRegistry() SIP_KEEPREFERENCE;
152
157 static QgsNumericFormatGuiRegistry *numericFormatGuiRegistry() SIP_KEEPREFERENCE;
158
163 static QgsCodeEditorColorSchemeRegistry *codeEditorColorSchemeRegistry() SIP_KEEPREFERENCE;
164
169 static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
170
175 static QgsProcessingFavoriteAlgorithmManager *processingFavoriteAlgorithmManager();
176
182 static QgsDataItemGuiProviderRegistry *dataItemGuiProviderRegistry() SIP_KEEPREFERENCE;
183
188 static QgsProjectStorageGuiRegistry *projectStorageGuiRegistry() SIP_KEEPREFERENCE;
189
194 static QgsProviderGuiRegistry *providerGuiRegistry() SIP_KEEPREFERENCE;
195
200 static QgsSensorGuiRegistry *sensorGuiRegistry() SIP_KEEPREFERENCE;
201
206 static QgsSubsetStringEditorProviderRegistry *subsetStringEditorProviderRegistry() SIP_KEEPREFERENCE;
207
212 static QgsProviderSourceWidgetProviderRegistry *sourceWidgetProviderRegistry() SIP_KEEPREFERENCE;
213
218 static QgsRelationWidgetRegistry *relationWidgetRegistry() SIP_KEEPREFERENCE;
219
225 static QgsMapToolShapeRegistry *mapToolShapeRegistry() SIP_SKIP;
226
231 static QgsHistoryProviderRegistry *historyProviderRegistry() SIP_KEEPREFERENCE;
232
237 static QgsSettingsEditorWidgetRegistry *settingsEditorWidgetRegistry() SIP_KEEPREFERENCE;
238
243 static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
244
250 static QgsWindowManagerInterface *windowManager();
251
257 static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
258
263 static QgsInputControllerManager *inputControllerManager() SIP_KEEPREFERENCE;
264
269 static QgsStoredQueryManager *storedQueryManager() SIP_KEEPREFERENCE;
270
276 {
277 HigMenuTextIsTitleCase = 1 << 0,
278 HigDialogTitleIsTitleCase = 1 << 1
279 };
280 Q_DECLARE_FLAGS( HigFlags, HigFlag )
281
282
286 static QgsGui::HigFlags higFlags();
287
288 ~QgsGui();
289
295 static QColor sampleColor( QPoint point );
296
302 static QScreen *findScreenAt( QPoint point );
303
318 static bool pythonEmbeddedInProjectAllowed( void ( *lambda )() = nullptr, QgsMessageBar *messageBar = nullptr, Qgis::PythonEmbeddedType embeddedType = Qgis::PythonEmbeddedType::Macro ) SIP_SKIP;
319
326 static void initCalloutWidgets() SIP_SKIP;
327
333 static bool hasWebEngine();
334
336 void emitOptionsChanged() SIP_SKIP;
338
339 signals:
340
351 void optionsChanged();
352
353 private:
354 QgsGui();
355
356 QgsSettingsRegistryGui *mSettingsRegistryGui = nullptr;
357 QgsProviderGuiRegistry *mProviderGuiRegistry = nullptr;
358 QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
359 QgsNative *mNative = nullptr;
360 QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
361 QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
362 QgsShortcutsManager *mShortcutsManager = nullptr;
363 QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
364 QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
365 QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
366 QgsAnnotationItemGuiRegistry *mAnnotationItemGuiRegistry = nullptr;
367 QgsAdvancedDigitizingToolsRegistry *mAdvancedDigitizingToolsRegistry = nullptr;
368 QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
369 QgsProcessingFavoriteAlgorithmManager *mProcessingFavoriteAlgorithmManager = nullptr;
370 QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
371 QgsNumericFormatGuiRegistry *mNumericFormatGuiRegistry = nullptr;
372 QgsDataItemGuiProviderRegistry *mDataItemGuiProviderRegistry = nullptr;
373 QgsCodeEditorColorSchemeRegistry *mCodeEditorColorSchemeRegistry = nullptr;
374 QgsProjectStorageGuiRegistry *mProjectStorageGuiRegistry = nullptr;
375 QgsSubsetStringEditorProviderRegistry *mSubsetStringEditorProviderRegistry = nullptr;
376 QgsProviderSourceWidgetProviderRegistry *mProviderSourceWidgetProviderRegistry = nullptr;
377 QgsRelationWidgetRegistry *mRelationEditorRegistry = nullptr;
378 QgsMapToolShapeRegistry *mShapeMapToolRegistry = nullptr;
379 QgsHistoryProviderRegistry *mHistoryProviderRegistry = nullptr;
380 QgsSensorGuiRegistry *mSensorGuiRegistry = nullptr;
381 QgsSettingsEditorWidgetRegistry *mSettingsEditorRegistry = nullptr;
382 QgsInputControllerManager *mInputControllerManager = nullptr;
383 QgsStoredQueryManager *mStoredQueryManager = nullptr;
384 std::unique_ptr<QgsWindowManagerInterface> mWindowManager;
385
386#ifdef SIP_RUN
387 QgsGui( const QgsGui &other );
388#endif
389};
390
392
393#endif // QGSGUI_H
PythonEmbeddedType
Type of Python Embedded in projects.
Definition qgis.h:417
Registry of available advanced digitizing tools.
Registry of available annotation item GUI behavior.
A registry of color schemes for use in QgsCodeEditor widgets.
A registry for data item GUI providers that may affect how QgsDataItems behave within the application...
A registry that manages all known edit widget factories.
A singleton class containing various registry and other global members related to GUI classes.
Definition qgsgui.h:65
HigFlag
HIG flags, which indicate the Human Interface Guidelines for the current platform.
Definition qgsgui.h:276
QFlags< HigFlag > HigFlags
Definition qgsgui.h:280
ProjectCrsBehavior
Defines the behavior to use when setting the CRS for a newly created project.
Definition qgsgui.h:76
A registry for objects which track user history (i.e.
Manages input control devices.
Registry of widgets that may be embedded into layer tree view.
Registry of available layout item GUI behavior.
A registry which tracks map layer actions.
Keeps track of the registered shape map tools.
A bar for displaying non-blocking messages to the user.
A registry for widgets which configure QgsNumericFormat objects.
A registry for widgets for use with the Processing framework.
A registry / canonical manager of GUI parts of project storage backends.
A registry / canonical manager of GUI parts of data providers.
A registry that keeps a list of provider source widget providers.
Keeps track of the registered relations widgets.
Registry of available sensor GUI behavior.
A registry that manages editor widgets for settings.
Used for settings introspection and collects all QgsSettingsEntry instances of GUI.
A tree node for the settings tree to help organizing and introspecting the tree.
QgsSettingsTreeNode * createChildNode(const QString &key)
Creates a normal tree node It will return the existing child node if it exists at the given key.
static QgsSettingsTreeNode * sTreeApp
Shortcuts manager is a class that contains a list of QActions and QShortcuts that have been registere...
A registry for QgsSourceSelectProvider source select providers.
A manager for stored SQL queries.
A registry for subset string editor providers.
A helper class to save and restore the geometry of QWidgets in the application.
#define SIP_KEEPREFERENCE
Definition qgis_sip.h:86
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:278
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_TRANSFER
Definition qgis_sip.h:36
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)