QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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;
57
63class GUI_EXPORT QgsGui : public QObject
64{
65 Q_OBJECT
66
67 public:
68 static inline QgsSettingsTreeNode *sTtreeWidgetLastUsedValues = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "widget-last-used-values" ) ) SIP_SKIP;
69
74 {
75 UseCrsOfFirstLayerAdded = 1,
76 UsePresetCrs = 2,
77 };
78 Q_ENUM( ProjectCrsBehavior )
79
80 QgsGui( const QgsGui &other ) = delete;
81 QgsGui &operator=( const QgsGui &other ) = delete;
82
86 static QgsGui *instance();
87
93 SIP_SKIP static QgsNative *nativePlatformInterface();
94
99 static QgsSettingsRegistryGui *settingsRegistryGui() SIP_KEEPREFERENCE;
100
104 static QgsEditorWidgetRegistry *editorWidgetRegistry() SIP_KEEPREFERENCE;
105
109 static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry() SIP_KEEPREFERENCE;
110
114 static QgsShortcutsManager *shortcutsManager();
115
119 static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry() SIP_KEEPREFERENCE;
120
124 static QgsMapLayerActionRegistry *mapLayerActionRegistry() SIP_KEEPREFERENCE;
125
129 static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry() SIP_KEEPREFERENCE;
130
136 static QgsAnnotationItemGuiRegistry *annotationItemGuiRegistry() SIP_KEEPREFERENCE;
137
143 static QgsAdvancedDigitizingToolsRegistry *advancedDigitizingToolsRegistry() SIP_KEEPREFERENCE;
144
149 static QgsProcessingGuiRegistry *processingGuiRegistry() SIP_KEEPREFERENCE;
150
155 static QgsNumericFormatGuiRegistry *numericFormatGuiRegistry() SIP_KEEPREFERENCE;
156
161 static QgsCodeEditorColorSchemeRegistry *codeEditorColorSchemeRegistry() SIP_KEEPREFERENCE;
162
167 static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
168
173 static QgsProcessingFavoriteAlgorithmManager *processingFavoriteAlgorithmManager();
174
180 static QgsDataItemGuiProviderRegistry *dataItemGuiProviderRegistry() SIP_KEEPREFERENCE;
181
186 static QgsProjectStorageGuiRegistry *projectStorageGuiRegistry() SIP_KEEPREFERENCE;
187
192 static QgsProviderGuiRegistry *providerGuiRegistry() SIP_KEEPREFERENCE;
193
198 static QgsSensorGuiRegistry *sensorGuiRegistry() SIP_KEEPREFERENCE;
199
204 static QgsSubsetStringEditorProviderRegistry *subsetStringEditorProviderRegistry() SIP_KEEPREFERENCE;
205
210 static QgsProviderSourceWidgetProviderRegistry *sourceWidgetProviderRegistry() SIP_KEEPREFERENCE;
211
216 static QgsRelationWidgetRegistry *relationWidgetRegistry() SIP_KEEPREFERENCE;
217
223 static QgsMapToolShapeRegistry *mapToolShapeRegistry() SIP_SKIP;
224
229 static QgsHistoryProviderRegistry *historyProviderRegistry() SIP_KEEPREFERENCE;
230
235 static QgsSettingsEditorWidgetRegistry *settingsEditorWidgetRegistry() SIP_KEEPREFERENCE;
236
241 static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
242
248 static QgsWindowManagerInterface *windowManager();
249
255 static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
256
261 static QgsInputControllerManager *inputControllerManager() SIP_KEEPREFERENCE;
262
268 {
269 HigMenuTextIsTitleCase = 1 << 0,
270 HigDialogTitleIsTitleCase = 1 << 1
271 };
272 Q_DECLARE_FLAGS( HigFlags, HigFlag )
273
274
278 static QgsGui::HigFlags higFlags();
279
280 ~QgsGui();
281
287 static QColor sampleColor( QPoint point );
288
294 static QScreen *findScreenAt( QPoint point );
295
310 static bool pythonEmbeddedInProjectAllowed( void ( *lambda )() = nullptr, QgsMessageBar *messageBar = nullptr, Qgis::PythonEmbeddedType embeddedType = Qgis::PythonEmbeddedType::Macro ) SIP_SKIP;
311
318 static void initCalloutWidgets() SIP_SKIP;
319
325 static bool hasWebEngine();
326
328 void emitOptionsChanged() SIP_SKIP;
330
331 signals:
332
343 void optionsChanged();
344
345 private:
346 QgsGui();
347
348 QgsSettingsRegistryGui *mSettingsRegistryGui = nullptr;
349 QgsProviderGuiRegistry *mProviderGuiRegistry = nullptr;
350 QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
351 QgsNative *mNative = nullptr;
352 QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
353 QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
354 QgsShortcutsManager *mShortcutsManager = nullptr;
355 QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
356 QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
357 QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
358 QgsAnnotationItemGuiRegistry *mAnnotationItemGuiRegistry = nullptr;
359 QgsAdvancedDigitizingToolsRegistry *mAdvancedDigitizingToolsRegistry = nullptr;
360 QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
361 QgsProcessingFavoriteAlgorithmManager *mProcessingFavoriteAlgorithmManager = nullptr;
362 QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
363 QgsNumericFormatGuiRegistry *mNumericFormatGuiRegistry = nullptr;
364 QgsDataItemGuiProviderRegistry *mDataItemGuiProviderRegistry = nullptr;
365 QgsCodeEditorColorSchemeRegistry *mCodeEditorColorSchemeRegistry = nullptr;
366 QgsProjectStorageGuiRegistry *mProjectStorageGuiRegistry = nullptr;
367 QgsSubsetStringEditorProviderRegistry *mSubsetStringEditorProviderRegistry = nullptr;
368 QgsProviderSourceWidgetProviderRegistry *mProviderSourceWidgetProviderRegistry = nullptr;
369 QgsRelationWidgetRegistry *mRelationEditorRegistry = nullptr;
370 QgsMapToolShapeRegistry *mShapeMapToolRegistry = nullptr;
371 QgsHistoryProviderRegistry *mHistoryProviderRegistry = nullptr;
372 QgsSensorGuiRegistry *mSensorGuiRegistry = nullptr;
373 QgsSettingsEditorWidgetRegistry *mSettingsEditorRegistry = nullptr;
374 QgsInputControllerManager *mInputControllerManager = nullptr;
375 std::unique_ptr<QgsWindowManagerInterface> mWindowManager;
376
377#ifdef SIP_RUN
378 QgsGui( const QgsGui &other );
379#endif
380};
381
383
384#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.
This class keeps a list of data item GUI providers that may affect how QgsDataItems behave within the...
This class manages all known edit widget factories.
QgsGui is a singleton class containing various registry and other global members related to GUI class...
Definition qgsgui.h:64
HigFlag
HIG flags, which indicate the Human Interface Guidelines for the current platform.
Definition qgsgui.h:268
QFlags< HigFlag > HigFlags
Definition qgsgui.h:272
ProjectCrsBehavior
Defines the behavior to use when setting the CRS for a newly created project.
Definition qgsgui.h:74
The QgsHistoryProviderRegistry is a registry for objects which track user history (i....
Manages input control devices.
Registry of widgets that may be embedded into layer tree view.
Registry of available layout item GUI behavior.
This class tracks map layer actions.
Keeps track of the registered shape map tools.
A bar for displaying non-blocking messages to the user.
The QgsNumericFormatGuiRegistry is a home for widgets for configuring QgsNumericFormat objects.
The QgsProcessingGuiRegistry is a home for widgets for processing configuration widgets.
A registry / canonical manager of GUI parts of project storage backends.
A registry / canonical manager of GUI parts of data providers.
This class keeps a list of provider source widget providers.
Keeps track of the registered relations widgets.
Registry of available sensor GUI behavior.
This class manages editor widgets for settings.
QgsSettingsRegistryGui is used for settings introspection and collects all QgsSettingsEntry instances...
QgsSettingsTreeNode is a tree node for the settings tree to help organizing and introspecting the tre...
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...
This class keeps a list of source select providers that may add items to the QgsDataSourceManagerDial...
This class keeps a list of subset string editor providers.
QgsWidgetStateHelper is a helper class to save and restore the geometry of QWidgets in the applicatio...
#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)