QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
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_gui.h"
22#include "qgis_sip.h"
23#include <QWidget>
24#include <memory>
25
32class QgsNative;
37class QgsProcessingRecentAlgorithmLog;
38class QgsWindowManagerInterface;
44class QgsMessageBar;
53
60class GUI_EXPORT QgsGui : public QObject
61{
62 Q_OBJECT
63
64 public:
65
70 {
71 UseCrsOfFirstLayerAdded = 1,
72 UsePresetCrs = 2,
73 };
74 Q_ENUM( ProjectCrsBehavior )
75
76
77 QgsGui( const QgsGui &other ) = delete;
78
80 QgsGui &operator=( const QgsGui &other ) = delete;
81
85 static QgsGui *instance();
86
92 SIP_SKIP static QgsNative *nativePlatformInterface();
93
98 static QgsSettingsRegistryGui *settingsRegistryGui() SIP_KEEPREFERENCE;
99
103 static QgsEditorWidgetRegistry *editorWidgetRegistry() SIP_KEEPREFERENCE;
104
108 static QgsSourceSelectProviderRegistry *sourceSelectProviderRegistry() SIP_KEEPREFERENCE;
109
113 static QgsShortcutsManager *shortcutsManager();
114
118 static QgsLayerTreeEmbeddedWidgetRegistry *layerTreeEmbeddedWidgetRegistry() SIP_KEEPREFERENCE;
119
123 static QgsMapLayerActionRegistry *mapLayerActionRegistry() SIP_KEEPREFERENCE;
124
128 static QgsLayoutItemGuiRegistry *layoutItemGuiRegistry() SIP_KEEPREFERENCE;
129
135 static QgsAnnotationItemGuiRegistry *annotationItemGuiRegistry() SIP_KEEPREFERENCE;
136
141 static QgsProcessingGuiRegistry *processingGuiRegistry() SIP_KEEPREFERENCE;
142
147 static QgsNumericFormatGuiRegistry *numericFormatGuiRegistry() SIP_KEEPREFERENCE;
148
153 static QgsCodeEditorColorSchemeRegistry *codeEditorColorSchemeRegistry() SIP_KEEPREFERENCE;
154
159 static QgsProcessingRecentAlgorithmLog *processingRecentAlgorithmLog();
160
166 static QgsDataItemGuiProviderRegistry *dataItemGuiProviderRegistry() SIP_KEEPREFERENCE;
167
172 static QgsProjectStorageGuiRegistry *projectStorageGuiRegistry() SIP_KEEPREFERENCE;
173
178 static QgsProviderGuiRegistry *providerGuiRegistry() SIP_KEEPREFERENCE;
179
184 static QgsSensorGuiRegistry *sensorGuiRegistry() SIP_KEEPREFERENCE;
185
190 static QgsSubsetStringEditorProviderRegistry *subsetStringEditorProviderRegistry() SIP_KEEPREFERENCE;
191
196 static QgsProviderSourceWidgetProviderRegistry *sourceWidgetProviderRegistry() SIP_KEEPREFERENCE;
197
202 static QgsRelationWidgetRegistry *relationWidgetRegistry() SIP_KEEPREFERENCE;
203
209 static QgsMapToolShapeRegistry *mapToolShapeRegistry() SIP_SKIP;
210
215 static QgsHistoryProviderRegistry *historyProviderRegistry() SIP_KEEPREFERENCE;
216
221 static QgsSettingsEditorWidgetRegistry *settingsEditorWidgetRegistry() SIP_KEEPREFERENCE;
222
227 static void enableAutoGeometryRestore( QWidget *widget, const QString &key = QString() );
228
234 static QgsWindowManagerInterface *windowManager();
235
241 static void setWindowManager( QgsWindowManagerInterface *manager SIP_TRANSFER );
242
247 static QgsInputControllerManager *inputControllerManager() SIP_KEEPREFERENCE;
248
254 {
255 HigMenuTextIsTitleCase = 1 << 0,
256 HigDialogTitleIsTitleCase = 1 << 1
257 };
258 Q_DECLARE_FLAGS( HigFlags, HigFlag )
259
260
264 static QgsGui::HigFlags higFlags();
265
266 ~QgsGui();
267
273 static QColor sampleColor( QPoint point );
274
280 static QScreen *findScreenAt( QPoint point );
281
291 static bool pythonMacroAllowed( void ( *lambda )() = nullptr, QgsMessageBar *messageBar = nullptr ) SIP_SKIP;
292
294 void emitOptionsChanged() SIP_SKIP;
296
297 signals:
298
309 void optionsChanged();
310
311 private:
312
313 QgsGui();
314
315 QgsSettingsRegistryGui *mSettingsRegistryGui = nullptr;
316 QgsProviderGuiRegistry *mProviderGuiRegistry = nullptr;
317 QgsWidgetStateHelper *mWidgetStateHelper = nullptr;
318 QgsNative *mNative = nullptr;
319 QgsEditorWidgetRegistry *mEditorWidgetRegistry = nullptr;
320 QgsSourceSelectProviderRegistry *mSourceSelectProviderRegistry = nullptr;
321 QgsShortcutsManager *mShortcutsManager = nullptr;
322 QgsLayerTreeEmbeddedWidgetRegistry *mLayerTreeEmbeddedWidgetRegistry = nullptr;
323 QgsMapLayerActionRegistry *mMapLayerActionRegistry = nullptr;
324 QgsLayoutItemGuiRegistry *mLayoutItemGuiRegistry = nullptr;
325 QgsAnnotationItemGuiRegistry *mAnnotationItemGuiRegistry = nullptr;
326 QgsProcessingGuiRegistry *mProcessingGuiRegistry = nullptr;
327 QgsProcessingRecentAlgorithmLog *mProcessingRecentAlgorithmLog = nullptr;
328 QgsNumericFormatGuiRegistry *mNumericFormatGuiRegistry = nullptr;
329 QgsDataItemGuiProviderRegistry *mDataItemGuiProviderRegistry = nullptr;
330 QgsCodeEditorColorSchemeRegistry *mCodeEditorColorSchemeRegistry = nullptr;
331 QgsProjectStorageGuiRegistry *mProjectStorageGuiRegistry = nullptr;
332 QgsSubsetStringEditorProviderRegistry *mSubsetStringEditorProviderRegistry = nullptr;
333 QgsProviderSourceWidgetProviderRegistry *mProviderSourceWidgetProviderRegistry = nullptr;
334 QgsRelationWidgetRegistry *mRelationEditorRegistry = nullptr;
335 QgsMapToolShapeRegistry *mShapeMapToolRegistry = nullptr;
336 QgsHistoryProviderRegistry *mHistoryProviderRegistry = nullptr;
337 QgsSensorGuiRegistry *mSensorGuiRegistry = nullptr;
338 QgsSettingsEditorWidgetRegistry *mSettingsEditorRegistry = nullptr;
339 QgsInputControllerManager *mInputControllerManager = nullptr;
340 std::unique_ptr< QgsWindowManagerInterface > mWindowManager;
341
342#ifdef SIP_RUN
343 QgsGui( const QgsGui &other );
344#endif
345
346};
347
348Q_DECLARE_OPERATORS_FOR_FLAGS( QgsGui::HigFlags )
349
350#endif // QGSGUI_H
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:61
HigFlag
HIG flags, which indicate the Human Interface Guidelines for the current platform.
Definition qgsgui.h:254
ProjectCrsBehavior
Defines the behavior to use when setting the CRS for a newly created project.
Definition qgsgui.h:70
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...
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_SKIP
Definition qgis_sip.h:126
#define SIP_TRANSFER
Definition qgis_sip.h:36
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsTextRendererUtils::CurvedTextFlags)