QGIS API Documentation 3.41.0-Master (092dc69654e)
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
69 static inline QgsSettingsTreeNode *sTtreeWidgetLastUsedValues = QgsSettingsTree::sTreeApp->createChildNode( QStringLiteral( "widget-last-used-values" ) ) SIP_SKIP;
70
75 {
76 UseCrsOfFirstLayerAdded = 1,
77 UsePresetCrs = 2,
78 };
79 Q_ENUM( ProjectCrsBehavior )
80
81 QgsGui( const QgsGui &other ) = delete;
82 QgsGui &operator=( const QgsGui &other ) = delete;
83
87 static QgsGui *instance();
88
94 SIP_SKIP static QgsNative *nativePlatformInterface();
95
100 static QgsSettingsRegistryGui *settingsRegistryGui() SIP_KEEPREFERENCE;
101
105 static QgsEditorWidgetRegistry *editorWidgetRegistry() SIP_KEEPREFERENCE;
106
110 static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry() SIP_KEEPREFERENCE;
111
115 static QgsShortcutsManager *shortcutsManager();
116
120 static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry() SIP_KEEPREFERENCE;
121
125 static QgsMapLayerActionRegistry *mapLayerActionRegistry() SIP_KEEPREFERENCE;
126
130 static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry() SIP_KEEPREFERENCE;
131
137 static QgsAnnotationItemGuiRegistry *annotationItemGuiRegistry() SIP_KEEPREFERENCE;
138
144 static QgsAdvancedDigitizingToolsRegistry *advancedDigitizingToolsRegistry() SIP_KEEPREFERENCE;
145
150 static QgsProcessingGuiRegistry *processingGuiRegistry() SIP_KEEPREFERENCE;
151
156 static QgsNumericFormatGuiRegistry *numericFormatGuiRegistry() SIP_KEEPREFERENCE;
157
162 static QgsCodeEditorColorSchemeRegistry *codeEditorColorSchemeRegistry() SIP_KEEPREFERENCE;
163
168 static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
169
174 static QgsProcessingFavoriteAlgorithmManager *processingFavoriteAlgorithmManager();
175
181 static QgsDataItemGuiProviderRegistry *dataItemGuiProviderRegistry() SIP_KEEPREFERENCE;
182
187 static QgsProjectStorageGuiRegistry *projectStorageGuiRegistry() SIP_KEEPREFERENCE;
188
193 static QgsProviderGuiRegistry *providerGuiRegistry() SIP_KEEPREFERENCE;
194
199 static QgsSensorGuiRegistry *sensorGuiRegistry() SIP_KEEPREFERENCE;
200
205 static QgsSubsetStringEditorProviderRegistry *subsetStringEditorProviderRegistry() SIP_KEEPREFERENCE;
206
211 static QgsProviderSourceWidgetProviderRegistry *sourceWidgetProviderRegistry() SIP_KEEPREFERENCE;
212
217 static QgsRelationWidgetRegistry *relationWidgetRegistry() SIP_KEEPREFERENCE;
218
224 static QgsMapToolShapeRegistry *mapToolShapeRegistry() SIP_SKIP;
225
230 static QgsHistoryProviderRegistry *historyProviderRegistry() SIP_KEEPREFERENCE;
231
236 static QgsSettingsEditorWidgetRegistry *settingsEditorWidgetRegistry() SIP_KEEPREFERENCE;
237
242 static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
243
249 static QgsWindowManagerInterface *windowManager();
250
256 static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
257
262 static QgsInputControllerManager *inputControllerManager() SIP_KEEPREFERENCE;
263
269 {
270 HigMenuTextIsTitleCase = 1 << 0,
271 HigDialogTitleIsTitleCase = 1 << 1
272 };
273 Q_DECLARE_FLAGS( HigFlags, HigFlag )
274
275
279 static QgsGui::HigFlags higFlags();
280
281 ~QgsGui();
282
288 static QColor sampleColor( QPoint point );
289
295 static QScreen *findScreenAt( QPoint point );
296
311 static bool pythonEmbeddedInProjectAllowed( void ( *lambda )() = nullptr, QgsMessageBar *messageBar = nullptr, Qgis::PythonEmbeddedType embeddedType = Qgis::PythonEmbeddedType::Macro ) SIP_SKIP;
312
319 static void initCalloutWidgets() SIP_SKIP;
320
322 void emitOptionsChanged() SIP_SKIP;
324
325 signals:
326
337 void optionsChanged();
338
339 private:
340
341 QgsGui();
342
343 QgsSettingsRegistryGui *mSettingsRegistryGui = nullptr;
344 QgsProviderGuiRegistry *mProviderGuiRegistry = nullptr;
345 QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
346 QgsNative *mNative = nullptr;
347 QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
348 QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
349 QgsShortcutsManager *mShortcutsManager = nullptr;
350 QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
351 QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
352 QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
353 QgsAnnotationItemGuiRegistry *mAnnotationItemGuiRegistry = nullptr;
354 QgsAdvancedDigitizingToolsRegistry *mAdvancedDigitizingToolsRegistry = nullptr;
355 QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
356 QgsProcessingFavoriteAlgorithmManager *mProcessingFavoriteAlgorithmManager = nullptr;
357 QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
358 QgsNumericFormatGuiRegistry *mNumericFormatGuiRegistry = nullptr;
359 QgsDataItemGuiProviderRegistry *mDataItemGuiProviderRegistry = nullptr;
360 QgsCodeEditorColorSchemeRegistry *mCodeEditorColorSchemeRegistry = nullptr;
361 QgsProjectStorageGuiRegistry *mProjectStorageGuiRegistry = nullptr;
362 QgsSubsetStringEditorProviderRegistry *mSubsetStringEditorProviderRegistry = nullptr;
363 QgsProviderSourceWidgetProviderRegistry *mProviderSourceWidgetProviderRegistry = nullptr;
364 QgsRelationWidgetRegistry *mRelationEditorRegistry = nullptr;
365 QgsMapToolShapeRegistry *mShapeMapToolRegistry = nullptr;
366 QgsHistoryProviderRegistry *mHistoryProviderRegistry = nullptr;
367 QgsSensorGuiRegistry *mSensorGuiRegistry = nullptr;
368 QgsSettingsEditorWidgetRegistry *mSettingsEditorRegistry = nullptr;
369 QgsInputControllerManager *mInputControllerManager = nullptr;
370 std::unique_ptr< QgsWindowManagerInterface > mWindowManager;
371
372#ifdef SIP_RUN
373 QgsGui( const QgsGui &other );
374#endif
375
376};
377
379
380#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:269
QFlags< HigFlag > HigFlags
Definition qgsgui.h:273
ProjectCrsBehavior
Defines the behavior to use when setting the CRS for a newly created project.
Definition qgsgui.h:75
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)