QGIS API Documentation 3.39.0-Master (d85f3c2a281)
Loading...
Searching...
No Matches
qgsgui.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsgui.cpp
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
19#include <QScreen>
20#include <QMessageBox>
21
22#include "qgsgui.h"
30#include "qgscalloutsregistry.h"
32#ifdef Q_OS_MACX
33#include "qgsmacnative.h"
34#elif defined (Q_OS_WIN)
35#ifndef __MINGW32__
36#include "qgswinnative.h"
37#else
38#include "qgsnative.h"
39#endif
40#elif defined (Q_OS_LINUX)
41#include "qgslinuxnative.h"
42#else
43#include "qgsnative.h"
44#endif
46#include "qgsshortcutsmanager.h"
48#include "qgslogger.h"
52#include "qgssettings.h"
56#include "qgsmessagebar.h"
57#include "qgsmessagebaritem.h"
69#include "qgshistoryentry.h"
70
72
73
74#include <QPushButton>
75#include <QToolButton>
76
78{
79 static QgsGui *sInstance( new QgsGui() );
80 return sInstance;
81}
82
84{
85 return instance()->mNative;
86}
87
89{
90 return instance()->mSettingsRegistryGui;
91}
92
94{
95 return instance()->mEditorWidgetRegistry;
96}
97
99{
100 return instance()->mRelationEditorRegistry;
101}
102
104{
105 return instance()->mShapeMapToolRegistry;
106}
107
109{
110 return instance()->mSourceSelectProviderRegistry;
111}
112
114{
115 return instance()->mSubsetStringEditorProviderRegistry;
116}
117
119{
120 return instance()->mProviderSourceWidgetProviderRegistry;
121}
122
124{
125 return instance()->mShortcutsManager;
126}
127
129{
130 return instance()->mLayerTreeEmbeddedWidgetRegistry;
131}
132
134{
135 return instance()->mMapLayerActionRegistry;
136}
137
139{
140 return instance()->mLayoutItemGuiRegistry;
141}
142
144{
145 return instance()->mAnnotationItemGuiRegistry;
146}
147
149{
150 return instance()->mAdvancedDigitizingToolsRegistry;
151}
152
154{
155 return instance()->mProcessingGuiRegistry;
156}
157
159{
160 return instance()->mNumericFormatGuiRegistry;
161}
162
164{
165 return instance()->mCodeEditorColorSchemeRegistry;
166}
167
168QgsProcessingFavoriteAlgorithmManager *QgsGui::processingFavoriteAlgorithmManager()
169{
170 return instance()->mProcessingFavoriteAlgorithmManager;
171}
172
173QgsProcessingRecentAlgorithmLog *QgsGui::processingRecentAlgorithmLog()
174{
175 return instance()->mProcessingRecentAlgorithmLog;
176}
177
179{
180 return instance()->mDataItemGuiProviderRegistry;
181}
182
184{
185 return instance()->mProjectStorageGuiRegistry;
186}
187
189{
190 return instance()->mProviderGuiRegistry;
191}
192
194{
195 return instance()->mSensorGuiRegistry;
196}
197
199{
200 return instance()->mHistoryProviderRegistry;
201}
202
204{
205 return instance()->mSettingsEditorRegistry;
206}
207
208void QgsGui::enableAutoGeometryRestore( QWidget *widget, const QString &key )
209{
210 if ( widget->objectName().isEmpty() )
211 {
212 QgsDebugError( QStringLiteral( "WARNING: No object name set. Best for it to be set objectName when using QgsGui::enableAutoGeometryRestore" ) );
213 }
214 instance()->mWidgetStateHelper->registerWidget( widget, key );
215}
216
217QgsWindowManagerInterface *QgsGui::windowManager()
218{
219 return instance()->mWindowManager.get();
220}
221
223{
224 return instance()->mInputControllerManager;
225}
226
227void QgsGui::setWindowManager( QgsWindowManagerInterface *manager )
228{
229 instance()->mWindowManager.reset( manager );
230}
231
233{
234 if ( QgsApplication::settingsLocaleUserLocale->value().startsWith( QLatin1String( "en" ) ) )
235 {
237 }
238 else
239 {
240 return QgsGui::HigFlags();
241 }
242}
243
245{
246 delete mProcessingGuiRegistry;
247 delete mDataItemGuiProviderRegistry;
248 delete mProcessingFavoriteAlgorithmManager;
249 delete mProcessingRecentAlgorithmLog;
250 delete mLayoutItemGuiRegistry;
251 delete mAnnotationItemGuiRegistry;
252 delete mAdvancedDigitizingToolsRegistry;
253 delete mLayerTreeEmbeddedWidgetRegistry;
254 delete mEditorWidgetRegistry;
255 delete mMapLayerActionRegistry;
256 delete mSourceSelectProviderRegistry;
257 delete mHistoryProviderRegistry;
258 delete mShortcutsManager;
259 delete mNative;
260 delete mNumericFormatGuiRegistry;
261 delete mWidgetStateHelper;
262 delete mProjectStorageGuiRegistry;
263 delete mProviderGuiRegistry;
264 delete mCodeEditorColorSchemeRegistry;
265 delete mSubsetStringEditorProviderRegistry;
266 delete mProviderSourceWidgetProviderRegistry;
267 delete mShapeMapToolRegistry;
268 delete mRelationEditorRegistry;
269 delete mInputControllerManager;
270 delete mSettingsRegistryGui;
271 delete mSensorGuiRegistry;
272 delete mSettingsEditorRegistry;
273}
274
275QColor QgsGui::sampleColor( QPoint point )
276{
277 QScreen *screen = findScreenAt( point );
278 if ( ! screen )
279 {
280 return QColor();
281 }
282
283 const int x = point.x() - screen->geometry().left();
284 const int y = point.y() - screen->geometry().top();
285 const QPixmap snappedPixmap = screen->grabWindow( 0, x, y, 1, 1 );
286 const QImage snappedImage = snappedPixmap.toImage();
287 return snappedImage.pixel( 0, 0 );
288}
289
290QScreen *QgsGui::findScreenAt( QPoint point )
291{
292 const QList< QScreen * > screens = QGuiApplication::screens();
293 for ( QScreen *screen : screens )
294 {
295 if ( screen->geometry().contains( point ) )
296 {
297 return screen;
298 }
299 }
300 return nullptr;
301}
302
303QgsGui::QgsGui()
304{
305#ifdef Q_OS_MAC
306 QgsMacNative *macNative = new QgsMacNative();
307 macNative->setIconPath( QgsApplication::iconsPath() + QStringLiteral( "qgis-icon-macos.png" ) );
308 mNative = macNative;
309#elif defined (Q_OS_WIN)
310#ifndef __MINGW32__
311 mNative = new QgsWinNative();
312#else
313 mNative = new QgsNative();
314#endif
315#elif defined(Q_OS_LINUX)
316 mNative = new QgsLinuxNative();
317#else
318 mNative = new QgsNative();
319#endif
320
321 mSettingsRegistryGui = new QgsSettingsRegistryGui();
322
323 mSettingsEditorRegistry = new QgsSettingsEditorWidgetRegistry();
324
325 mCodeEditorColorSchemeRegistry = new QgsCodeEditorColorSchemeRegistry();
326
327 // provider gui registry initialize QgsProviderRegistry too
328 mSensorGuiRegistry = new QgsSensorGuiRegistry();
329 mSensorGuiRegistry->populate();
330
331 mHistoryProviderRegistry = new QgsHistoryProviderRegistry();
332 mHistoryProviderRegistry->addDefaultProviders();
333
334 mInputControllerManager = new QgsInputControllerManager();
335
336 mProviderGuiRegistry = new QgsProviderGuiRegistry( QgsApplication::pluginPath() );
337 mProjectStorageGuiRegistry = new QgsProjectStorageGuiRegistry();
338 mDataItemGuiProviderRegistry = new QgsDataItemGuiProviderRegistry();
339 mSourceSelectProviderRegistry = new QgsSourceSelectProviderRegistry();
340 mNumericFormatGuiRegistry = new QgsNumericFormatGuiRegistry();
341 mSubsetStringEditorProviderRegistry = new QgsSubsetStringEditorProviderRegistry();
342 mProviderSourceWidgetProviderRegistry = new QgsProviderSourceWidgetProviderRegistry();
343
344 mProjectStorageGuiRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry );
345 mDataItemGuiProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry );
346 mSourceSelectProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry );
347 mSourceSelectProviderRegistry->addProvider( new QgsLayerMetadataSourceSelectProvider() );
348 mSubsetStringEditorProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry );
349 mProviderSourceWidgetProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry );
350
351 mEditorWidgetRegistry = new QgsEditorWidgetRegistry();
352 mRelationEditorRegistry = new QgsRelationWidgetRegistry();
353 mShapeMapToolRegistry = new QgsMapToolShapeRegistry();
354 mShortcutsManager = new QgsShortcutsManager();
355 mLayerTreeEmbeddedWidgetRegistry = new QgsLayerTreeEmbeddedWidgetRegistry();
356 mMapLayerActionRegistry = new QgsMapLayerActionRegistry();
357 mLayoutItemGuiRegistry = new QgsLayoutItemGuiRegistry();
358
359 mAnnotationItemGuiRegistry = new QgsAnnotationItemGuiRegistry();
360 mAnnotationItemGuiRegistry->addDefaultItems();
361
362 mAdvancedDigitizingToolsRegistry = new QgsAdvancedDigitizingToolsRegistry();
363 mAdvancedDigitizingToolsRegistry->addDefaultTools();
364
365 mWidgetStateHelper = new QgsWidgetStateHelper();
366 mProcessingFavoriteAlgorithmManager = new QgsProcessingFavoriteAlgorithmManager();
367 mProcessingRecentAlgorithmLog = new QgsProcessingRecentAlgorithmLog();
368 mProcessingGuiRegistry = new QgsProcessingGuiRegistry();
369
370 qRegisterMetaType< QgsHistoryEntry >( "QgsHistoryEntry" );
371}
372
373bool QgsGui::pythonEmbeddedInProjectAllowed( void ( *lambda )(), QgsMessageBar *messageBar, Qgis::PythonEmbeddedType embeddedType )
374{
375 const Qgis::PythonEmbeddedMode pythonEmbeddedMode = QgsSettings().enumValue( QStringLiteral( "qgis/enablePythonEmbedded" ), Qgis::PythonEmbeddedMode::Ask );
376
377 switch ( pythonEmbeddedMode )
378 {
381 if ( embeddedType == Qgis::PythonEmbeddedType::Macro )
382 {
383 if ( lambda )
384 lambda();
385 }
386 // If this is the case, expression functions
387 // are loaded directly by the QGIS project.
388 return true;
391 if ( messageBar )
392 {
393 switch ( embeddedType )
394 {
396 messageBar->pushMessage( tr( "Python Macros" ),
397 tr( "Python macros are currently disabled and will not be run" ),
399 break;
401 messageBar->pushMessage( tr( "Python Expressions" ),
402 tr( "Python expressions from project are currently disabled and will not be loaded" ),
404 break;
405 }
406 }
407 return false;
409 if ( embeddedType == Qgis::PythonEmbeddedType::Macro )
410 {
411 if ( !lambda )
412 {
413 QMessageBox msgBox( QMessageBox::Information, tr( "Python Macros" ),
414 tr( "Python macros are currently disabled. Do you allow this macro to run?" ) );
415 QAbstractButton *stopSessionButton = msgBox.addButton( tr( "Disable for this Session" ), QMessageBox::DestructiveRole );
416 msgBox.addButton( tr( "No" ), QMessageBox::NoRole );
417 QAbstractButton *yesButton = msgBox.addButton( tr( "Yes" ), QMessageBox::YesRole );
418 msgBox.exec();
419
420 QAbstractButton *clicked = msgBox.clickedButton();
421 if ( clicked == stopSessionButton )
422 {
423 QgsSettings().setEnumValue( QStringLiteral( "qgis/enablePythonEmbedded" ), Qgis::PythonEmbeddedMode::NotForThisSession );
424 }
425 return clicked == yesButton;
426 }
427 else
428 {
429 // create the notification widget for macros
430 Q_ASSERT( messageBar );
431 if ( messageBar )
432 {
433 QToolButton *btnEnableMacros = new QToolButton();
434 btnEnableMacros->setText( tr( "Enable Macros" ) );
435 btnEnableMacros->setStyleSheet( QStringLiteral( "background-color: rgba(255, 255, 255, 0); color: black; text-decoration: underline;" ) );
436 btnEnableMacros->setCursor( Qt::PointingHandCursor );
437 btnEnableMacros->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
438
439 QgsMessageBarItem *macroMsg = new QgsMessageBarItem(
440 tr( "Security warning" ),
441 tr( "Python macros cannot currently be run." ),
442 btnEnableMacros,
444 0,
445 messageBar );
446
447 connect( btnEnableMacros, &QToolButton::clicked, messageBar, [ = ]()
448 {
449 lambda();
450 messageBar->popWidget( macroMsg );
451 } );
452
453 // display the macros notification widget
454 messageBar->pushItem( macroMsg );
455 }
456
457 return false;
458 }
459 }
460 else if ( embeddedType == Qgis::PythonEmbeddedType::ExpressionFunction )
461 {
462 // create the notification widget for expressions from project
463 Q_ASSERT( messageBar );
464 if ( messageBar )
465 {
466 QToolButton *btnEnableExpressionsFromProject = new QToolButton();
467 btnEnableExpressionsFromProject->setText( tr( "Enable python expressions from project" ) );
468 btnEnableExpressionsFromProject->setStyleSheet( QStringLiteral( "background-color: rgba(255, 255, 255, 0); color: black; text-decoration: underline;" ) );
469 btnEnableExpressionsFromProject->setCursor( Qt::PointingHandCursor );
470 btnEnableExpressionsFromProject->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Preferred );
471
472 QgsMessageBarItem *expressionFromProjectMsg = new QgsMessageBarItem(
473 tr( "Security warning" ),
474 tr( "Python expressions from project cannot currently be loaded." ),
475 btnEnableExpressionsFromProject,
477 0,
478 messageBar );
479
480 connect( btnEnableExpressionsFromProject, &QToolButton::clicked, messageBar, [ = ]()
481 {
483 messageBar->popWidget( expressionFromProjectMsg );
484 } );
485
486 // display the notification widget
487 messageBar->pushItem( expressionFromProjectMsg );
488 }
489
490 return false;
491 }
492 }
493 return false;
494}
495
497{
498 static std::once_flag initialized;
499 std::call_once( initialized, [ = ]( )
500 {
501
502 auto _initCalloutWidgetFunction = []( const QString & name, QgsCalloutWidgetFunc f )
503 {
505
506 QgsCalloutAbstractMetadata *abstractMetadata = registry->calloutMetadata( name );
507 if ( !abstractMetadata )
508 {
509 QgsDebugError( QStringLiteral( "Failed to find callout entry in registry: %1" ).arg( name ) );
510 }
511 QgsCalloutMetadata *metadata = dynamic_cast<QgsCalloutMetadata *>( abstractMetadata );
512 if ( !metadata )
513 {
514 QgsDebugError( QStringLiteral( "Failed to cast callout's metadata: " ) .arg( name ) );
515 }
516 else
517 {
518 metadata->setWidgetFunction( f );
519 }
520 };
521
522 _initCalloutWidgetFunction( QStringLiteral( "simple" ), QgsSimpleLineCalloutWidget::create );
523 _initCalloutWidgetFunction( QStringLiteral( "manhattan" ), QgsManhattanLineCalloutWidget::create );
524 _initCalloutWidgetFunction( QStringLiteral( "curved" ), QgsCurvedLineCalloutWidget::create );
525 _initCalloutWidgetFunction( QStringLiteral( "balloon" ), QgsBalloonCalloutWidget::create );
526 } );
527}
528
530void QgsGui::emitOptionsChanged()
531{
532 emit optionsChanged();
533}
@ Warning
Warning message.
Definition qgis.h:156
PythonEmbeddedMode
Authorisation to run Python Embedded in projects.
Definition qgis.h:403
@ Always
Python embedded is always run.
@ NotForThisSession
Python embedded will not be run for this session.
@ Never
Python embedded never run.
@ Ask
User is prompt before running.
@ SessionOnly
Only during this session.
PythonEmbeddedType
Type of Python Embedded in projects.
Definition qgis.h:417
Registry of available advanced digitizing tools.
void addDefaultTools()
Adds the default tools shipped in QGIS.
Registry of available annotation item GUI behavior.
void addDefaultItems()
Populates the registry with default items.
static QString pluginPath()
Returns the path to the application plugin directory.
static const QgsSettingsEntryString * settingsLocaleUserLocale
Settings entry locale user locale.
static QgsCalloutRegistry * calloutRegistry()
Returns the application's callout registry, used for managing callout types.
static QString iconsPath()
Returns the path to the icons image directory.
Stores metadata about one callout renderer class.
Convenience metadata class that uses static functions to create callouts and their widgets.
void setWidgetFunction(QgsCalloutWidgetFunc f)
Registry of available callout classes.
QgsCalloutAbstractMetadata * calloutMetadata(const QString &type) const
Returns the metadata for specified the specified callout type.
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...
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
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
static QgsMapToolShapeRegistry * mapToolShapeRegistry()
Returns the registry of shape map tools.
Definition qgsgui.cpp:103
static QgsEditorWidgetRegistry * editorWidgetRegistry()
Returns the global editor widget registry, used for managing all known edit widget factories.
Definition qgsgui.cpp:93
static QgsProviderSourceWidgetProviderRegistry * sourceWidgetProviderRegistry()
Returns the registry of provider source widget providers.
Definition qgsgui.cpp:118
static QgsProcessingGuiRegistry * processingGuiRegistry()
Returns the global processing gui registry, used for registering the GUI behavior of processing algor...
Definition qgsgui.cpp:153
static QgsShortcutsManager * shortcutsManager()
Returns the global shortcuts manager, used for managing a QAction and QShortcut sequences.
Definition qgsgui.cpp:123
static void setWindowManager(QgsWindowManagerInterface *manager)
Sets the global window manager.
Definition qgsgui.cpp:227
void optionsChanged()
This signal is emitted whenever the application options have been changed.
static QgsInputControllerManager * inputControllerManager()
Returns the global input controller manager.
Definition qgsgui.cpp:222
static QgsProcessingFavoriteAlgorithmManager * processingFavoriteAlgorithmManager()
Returns the global Processing favorite algorithm manager, used for tracking favorite Processing algor...
Definition qgsgui.cpp:168
static QgsLayerTreeEmbeddedWidgetRegistry * layerTreeEmbeddedWidgetRegistry()
Returns the global layer tree embedded widget registry, used for registering widgets that may be embe...
Definition qgsgui.cpp:128
static QScreen * findScreenAt(QPoint point)
Returns the screen at the given global point (pixel).
Definition qgsgui.cpp:290
static QgsAnnotationItemGuiRegistry * annotationItemGuiRegistry()
Returns the global annotation item GUI registry, used for registering the GUI behavior of annotation ...
Definition qgsgui.cpp:143
static QgsMapLayerActionRegistry * mapLayerActionRegistry()
Returns the global map layer action registry, used for registering map layer actions.
Definition qgsgui.cpp:133
static QgsGui * instance()
Returns a pointer to the singleton instance.
Definition qgsgui.cpp:77
static QgsProviderGuiRegistry * providerGuiRegistry()
Returns the registry of GUI-related components of data providers.
Definition qgsgui.cpp:188
static QgsRelationWidgetRegistry * relationWidgetRegistry()
Returns the global relation widget registry, used for managing all known relation widget factories.
Definition qgsgui.cpp:98
static QgsSensorGuiRegistry * sensorGuiRegistry()
Returns the registry of GUI-related components for sensors.
Definition qgsgui.cpp:193
static QgsAdvancedDigitizingToolsRegistry * advancedDigitizingToolsRegistry()
Returns the global advanced digitizing tools registry, used for registering advanced digitizing tools...
Definition qgsgui.cpp:148
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...
Definition qgsgui.cpp:208
static QgsHistoryProviderRegistry * historyProviderRegistry()
Returns the global history provider registry, used for tracking history providers.
Definition qgsgui.cpp:198
@ HigMenuTextIsTitleCase
Menu action texts should be title case.
Definition qgsgui.h:270
@ HigDialogTitleIsTitleCase
Dialog titles should be title case.
Definition qgsgui.h:271
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.
Definition qgsgui.cpp:373
static QgsNative * nativePlatformInterface()
Returns the global native interface, which offers abstraction to the host OS's underlying public inte...
Definition qgsgui.cpp:83
static QgsWindowManagerInterface * windowManager()
Returns the global window manager, if set.
Definition qgsgui.cpp:217
static QgsDataItemGuiProviderRegistry * dataItemGuiProviderRegistry()
Returns the global data item GUI provider registry, used for tracking providers which affect the brow...
Definition qgsgui.cpp:178
static QgsProcessingRecentAlgorithmLog * processingRecentAlgorithmLog()
Returns the global processing recent algorithm log, used for tracking recently used processing algori...
Definition qgsgui.cpp:173
QFlags< HigFlag > HigFlags
Definition qgsgui.h:273
static QgsSubsetStringEditorProviderRegistry * subsetStringEditorProviderRegistry()
Returns the registry of subset string editors of data providers.
Definition qgsgui.cpp:113
static QgsProjectStorageGuiRegistry * projectStorageGuiRegistry()
Returns the global GUI-related project storage registry.
Definition qgsgui.cpp:183
static QgsGui::HigFlags higFlags()
Returns the platform's HIG flags.
Definition qgsgui.cpp:232
static QgsLayoutItemGuiRegistry * layoutItemGuiRegistry()
Returns the global layout item GUI registry, used for registering the GUI behavior of layout items.
Definition qgsgui.cpp:138
static void initCalloutWidgets()
Initializes callout widgets.
Definition qgsgui.cpp:496
static QgsSettingsRegistryGui * settingsRegistryGui()
Returns the gui's settings registry, used for managing gui settings.
Definition qgsgui.cpp:88
static QgsSourceSelectProviderRegistry * sourceSelectProviderRegistry()
Returns the global source select provider registry, used for managing all known source select widget ...
Definition qgsgui.cpp:108
static QgsCodeEditorColorSchemeRegistry * codeEditorColorSchemeRegistry()
Returns the global code editor color scheme registry, used for registering the color schemes for QgsC...
Definition qgsgui.cpp:163
static QgsNumericFormatGuiRegistry * numericFormatGuiRegistry()
Returns the global numeric format gui registry, used for registering the GUI widgets associated with ...
Definition qgsgui.cpp:158
static QgsSettingsEditorWidgetRegistry * settingsEditorWidgetRegistry()
Returns the registry of settings editors.
Definition qgsgui.cpp:203
static QColor sampleColor(QPoint point)
Samples the color on screen at the specified global point (pixel).
Definition qgsgui.cpp:275
~QgsGui()
Definition qgsgui.cpp:244
The QgsHistoryProviderRegistry is a registry for objects which track user history (i....
void addDefaultProviders()
Adds the default history providers to the registry.
Manages input control devices.
Source select provider for layer metadata.
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.
Represents an item shown within a QgsMessageBar widget.
A bar for displaying non-blocking messages to the user.
bool popWidget(QgsMessageBarItem *item)
Remove the specified item from the bar, and display the next most recent one in the stack.
void pushMessage(const QString &text, Qgis::MessageLevel level=Qgis::MessageLevel::Info, int duration=-1)
A convenience method for pushing a message with the specified text to the bar.
void pushItem(QgsMessageBarItem *item)
Display a message item on the bar, after hiding the currently visible one and putting it in a stack.
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.
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
static QgsProject * instance()
Returns the QgsProject singleton instance.
bool loadFunctionsFromProject(bool force=false)
Loads python expression functions stored in the currrent project.
A registry / canonical manager of GUI parts of data providers.
This class keeps a list of provider source widget providers.
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
Keeps track of the registered relations widgets.
Registry of available sensor GUI behavior.
bool populate()
Populates the registry with standard sensor types.
This class manages editor widgets for settings.
QgsSettingsRegistryGui is used for settings introspection and collects all QgsSettingsEntry instances...
This class is a composition of two QSettings instances:
Definition qgssettings.h:64
void setEnumValue(const QString &key, const T &value, const Section section=NoSection)
Set the value of a setting based on an enum.
T enumValue(const QString &key, const T &defaultValue, const Section section=NoSection)
Returns the setting value for a setting based on an enum.
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...
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
void addProvider(QgsSourceSelectProvider *provider)
Add a provider implementation. Takes ownership of the object.
This class keeps a list of subset string editor providers.
void initializeFromProviderGuiRegistry(QgsProviderGuiRegistry *providerGuiRegistry)
Initializes the registry.
QgsWidgetStateHelper is a helper class to save and restore the geometry of QWidgets in the applicatio...
void registerWidget(QWidget *widget, const QString &key=QString())
Register a widget to have it geometry state automatically saved and restored.
QgsCalloutWidget *(* QgsCalloutWidgetFunc)(QgsMapLayer *)
#define QgsDebugError(str)
Definition qgslogger.h:38