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