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