QGIS API Documentation 4.3.0-Master (f865f0c58a6)
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 "qgsgui.h"
20
24#include "qgscalloutsregistry.h"
30
31#include <QMessageBox>
32#include <QScreen>
33#include <QString>
34
35#include "moc_qgsgui.cpp"
36
37using namespace Qt::StringLiterals;
38
39#ifdef Q_OS_MACOS
40#include "qgsmacnative.h"
41#elif defined( Q_OS_WIN )
42#ifndef __MINGW32__
43#include "qgswinnative.h"
44#else
45#include "qgsnative.h"
46#endif
47#elif defined( Q_OS_LINUX )
48#include "qgslinuxnative.h"
49#else
50#include "qgsnative.h"
51#endif
53#include "qgsshortcutsmanager.h"
55#include "qgslogger.h"
59#include "qgssettings.h"
62#include "qgsproject.h"
65#include "qgsprojectutils.h"
66#include "qgsmessagebar.h"
67#include "qgsmessagebaritem.h"
79#include "qgshistoryentry.h"
80#include "qgsstacsourceselectprovider.h"
86#include "qgsplotregistry.h"
87#include "qgsplotwidget.h"
88#include "qgsguiutils.h"
89
90#include <QFileInfo>
91#include <QPushButton>
92#include <QToolButton>
93
95{
96 static QgsGui *sInstance( new QgsGui() );
97 return sInstance;
98}
99
101{
102 return instance()->mNative.get();
103}
104
106{
107 return instance()->mSettingsRegistryGui.get();
108}
109
111{
112 return instance()->mEditorWidgetRegistry.get();
113}
114
116{
117 return instance()->mRelationEditorRegistry.get();
118}
119
121{
122 return instance()->mShapeMapToolRegistry.get();
123}
124
126{
127 return instance()->mSourceSelectProviderRegistry.get();
128}
129
131{
132 return instance()->mSubsetStringEditorProviderRegistry.get();
133}
134
136{
137 return instance()->mProviderSourceWidgetProviderRegistry.get();
138}
139
141{
142 return instance()->mShortcutsManager.get();
143}
144
146{
147 return instance()->mLayerTreeEmbeddedWidgetRegistry.get();
148}
149
151{
152 return instance()->mMapLayerActionRegistry.get();
153}
154
156{
157 return instance()->mLayoutItemGuiRegistry.get();
158}
159
161{
162 return instance()->mAnnotationItemGuiRegistry.get();
163}
164
166{
167 return instance()->mAdvancedDigitizingToolsRegistry.get();
168}
169
171{
172 return instance()->mProcessingGuiRegistry.get();
173}
174
176{
177 return instance()->mNumericFormatGuiRegistry.get();
178}
179
181{
182 return instance()->mCodeEditorColorSchemeRegistry.get();
183}
184
185QgsProcessingFavoriteAlgorithmManager *QgsGui::processingFavoriteAlgorithmManager()
186{
187 return instance()->mProcessingFavoriteAlgorithmManager.get();
188}
189
190QgsProcessingRecentAlgorithmLog *QgsGui::processingRecentAlgorithmLog()
191{
192 return instance()->mProcessingRecentAlgorithmLog.get();
193}
194
196{
197 return instance()->mDataItemGuiProviderRegistry.get();
198}
199
201{
202 return instance()->mProjectStorageGuiRegistry.get();
203}
204
206{
207 return instance()->mProviderGuiRegistry.get();
208}
209
211{
212 return instance()->mSensorGuiRegistry.get();
213}
214
216{
217 return instance()->mHistoryProviderRegistry.get();
218}
219
221{
222 return instance()->mSettingsEditorRegistry.get();
223}
224
225void QgsGui::enableAutoGeometryRestore( QWidget *widget, const QString &key )
226{
227 if ( widget->objectName().isEmpty() )
228 {
229 QgsDebugError( u"WARNING: No object name set. Best for it to be set objectName when using QgsGui::enableAutoGeometryRestore"_s );
230 }
231 instance()->mWidgetStateHelper->registerWidget( widget, key );
232}
233
234QgsWindowManagerInterface *QgsGui::windowManager()
235{
236 return instance()->mWindowManager.get();
237}
238
240{
241 return instance()->mInputControllerManager.get();
242}
243
245{
246 return instance()->mStoredQueryManager.get();
247}
248
249void QgsGui::setWindowManager( QgsWindowManagerInterface *manager )
250{
251 instance()->mWindowManager.reset( manager );
252}
253
255{
256 if ( QgsApplication::settingsLocaleUserLocale->value().startsWith( "en"_L1 ) )
257 {
259 }
260 else
261 {
262 return QgsGui::HigFlags();
263 }
264}
265
267{
268 // we reset explicit registry because order matters
269 mProcessingGuiRegistry.reset();
270 mDataItemGuiProviderRegistry.reset();
271 mProcessingFavoriteAlgorithmManager.reset();
272 mProcessingRecentAlgorithmLog.reset();
273 mLayoutItemGuiRegistry.reset();
274 mAnnotationItemGuiRegistry.reset();
275 mAdvancedDigitizingToolsRegistry.reset();
276 mLayerTreeEmbeddedWidgetRegistry.reset();
277 mEditorWidgetRegistry.reset();
278 mMapLayerActionRegistry.reset();
279 mSourceSelectProviderRegistry.reset();
280 mHistoryProviderRegistry.reset();
281 mShortcutsManager.reset();
282 mNative.reset();
283 mNumericFormatGuiRegistry.reset();
284 mWidgetStateHelper.reset();
285 mProjectStorageGuiRegistry.reset();
286 mProviderGuiRegistry.reset();
287 mCodeEditorColorSchemeRegistry.reset();
288 mSubsetStringEditorProviderRegistry.reset();
289 mProviderSourceWidgetProviderRegistry.reset();
290 mShapeMapToolRegistry.reset();
291 mRelationEditorRegistry.reset();
292 mInputControllerManager.reset();
293 mSettingsRegistryGui.reset();
294 mSensorGuiRegistry.reset();
295 mStoredQueryManager.reset();
296 mSettingsEditorRegistry.reset();
297}
298
299QColor QgsGui::sampleColor( QPoint point )
300{
301 QScreen *screen = findScreenAt( point );
302 if ( !screen )
303 {
304 return QColor();
305 }
306
307 const int x = point.x() - screen->geometry().left();
308 const int y = point.y() - screen->geometry().top();
309 const QPixmap snappedPixmap = screen->grabWindow( 0, x, y, 1, 1 );
310 const QImage snappedImage = snappedPixmap.toImage();
311 return snappedImage.pixel( 0, 0 );
312}
313
314QScreen *QgsGui::findScreenAt( QPoint point )
315{
316 const QList<QScreen *> screens = QGuiApplication::screens();
317 for ( QScreen *screen : screens )
318 {
319 if ( screen->geometry().contains( point ) )
320 {
321 return screen;
322 }
323 }
324 return nullptr;
325}
326
328{
329#ifdef Q_OS_MAC
330 auto macNative = std::make_unique<QgsMacNative>();
331 macNative->setIconPath( QgsApplication::iconsPath() + u"qgis-icon-macos.png"_s );
332 mNative = std::move( macNative );
333#elif defined( Q_OS_WIN )
334#ifndef __MINGW32__
335 mNative = std::make_unique<QgsWinNative>();
336#else
337 mNative = std::make_unique<QgsNative>();
338#endif
339#elif defined( Q_OS_LINUX )
340 mNative = std::make_unique<QgsLinuxNative>();
341#else
342 mNative = std::make_unique<QgsNative>();
343#endif
344
345 mSettingsRegistryGui = std::make_unique<QgsSettingsRegistryGui>();
346
347 mSettingsEditorRegistry = std::make_unique<QgsSettingsEditorWidgetRegistry>();
348
349 mStoredQueryManager = std::make_unique<QgsStoredQueryManager>();
350 mCodeEditorColorSchemeRegistry = std::make_unique<QgsCodeEditorColorSchemeRegistry>();
351
352 // provider gui registry initialize QgsProviderRegistry too
353 mSensorGuiRegistry = std::make_unique<QgsSensorGuiRegistry>();
354 mSensorGuiRegistry->populate();
355
356 mHistoryProviderRegistry = std::make_unique<QgsHistoryProviderRegistry>();
357 mHistoryProviderRegistry->addDefaultProviders();
358
359 mInputControllerManager = std::make_unique<QgsInputControllerManager>();
360
361 mProviderGuiRegistry = std::make_unique<QgsProviderGuiRegistry>( QgsApplication::pluginPath() );
362 mProjectStorageGuiRegistry = std::make_unique<QgsProjectStorageGuiRegistry>();
363 mDataItemGuiProviderRegistry = std::make_unique<QgsDataItemGuiProviderRegistry>();
364 mSourceSelectProviderRegistry = std::make_unique<QgsSourceSelectProviderRegistry>();
365 mNumericFormatGuiRegistry = std::make_unique<QgsNumericFormatGuiRegistry>();
366 mSubsetStringEditorProviderRegistry = std::make_unique<QgsSubsetStringEditorProviderRegistry>();
367 mProviderSourceWidgetProviderRegistry = std::make_unique<QgsProviderSourceWidgetProviderRegistry>();
368
369 mProjectStorageGuiRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry.get() );
370 mDataItemGuiProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry.get() );
371 mSourceSelectProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry.get() );
372 mSourceSelectProviderRegistry->addProvider( new QgsLayerMetadataSourceSelectProvider() );
373 mSourceSelectProviderRegistry->addProvider( new QgsStacSourceSelectProvider() );
374 mSubsetStringEditorProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry.get() );
375 mProviderSourceWidgetProviderRegistry->initializeFromProviderGuiRegistry( mProviderGuiRegistry.get() );
376
377 mEditorWidgetRegistry = std::make_unique<QgsEditorWidgetRegistry>();
378 mRelationEditorRegistry = std::make_unique<QgsRelationWidgetRegistry>();
379 mShapeMapToolRegistry = std::make_unique<QgsMapToolShapeRegistry>();
380 mShortcutsManager = std::make_unique<QgsShortcutsManager>();
381 mLayerTreeEmbeddedWidgetRegistry = std::make_unique<QgsLayerTreeEmbeddedWidgetRegistry>();
382 mMapLayerActionRegistry = std::make_unique<QgsMapLayerActionRegistry>();
383 mLayoutItemGuiRegistry = std::make_unique<QgsLayoutItemGuiRegistry>();
384
385 mAnnotationItemGuiRegistry = std::make_unique<QgsAnnotationItemGuiRegistry>();
386 mAnnotationItemGuiRegistry->addDefaultItems();
387
388 mAdvancedDigitizingToolsRegistry = std::make_unique<QgsAdvancedDigitizingToolsRegistry>();
389 mAdvancedDigitizingToolsRegistry->addDefaultTools();
390
391 mWidgetStateHelper = std::make_unique<QgsWidgetStateHelper>();
392 mProcessingFavoriteAlgorithmManager = std::make_unique<QgsProcessingFavoriteAlgorithmManager>();
393 mProcessingRecentAlgorithmLog = std::make_unique<QgsProcessingRecentAlgorithmLog>();
394 mProcessingGuiRegistry = std::make_unique<QgsProcessingGuiRegistry>();
395
396 qRegisterMetaType<QgsHistoryEntry>( "QgsHistoryEntry" );
397}
398
400{
401 return QgsGui::instance()->mApplicationStyleSheet;
402}
403
404void QgsGui::setApplicationStyleSheet( const QString &styleSheet )
405{
406 if ( styleSheet == mApplicationStyleSheet )
407 return;
408
409 mApplicationStyleSheet = styleSheet;
410 emit applicationStyleSheetChanged( mApplicationStyleSheet );
411}
412
414{
417 if ( trustStatus == Qgis::ProjectTrustStatus::Undetermined && embeddedScriptMode == Qgis::EmbeddedScriptMode::Ask )
418 {
419 QgsProjectTrustDialog dialog( project );
420 dialog.exec();
421 trustStatus = QgsProjectUtils::checkUserTrust( project );
422 }
423
424 if ( messageBar )
425 {
426 if ( trustStatus == Qgis::ProjectTrustStatus::Trusted )
427 {
428 messageBar
429 ->pushMessage( tr( "Security warning" ), tr( "The loaded project contains embedded scripts which have been allowed execution." ), embeddedScriptMode == Qgis::EmbeddedScriptMode::Always ? Qgis::MessageLevel::Warning : Qgis::MessageLevel::Info );
430 }
431 else
432 {
433 messageBar
434 ->pushMessage( tr( "Security warning" ), tr( "The loaded project contains embedded scripts which have been denied execution." ), embeddedScriptMode == Qgis::EmbeddedScriptMode::Never ? Qgis::MessageLevel::Warning : Qgis::MessageLevel::Info );
435 }
436 }
437
438 return trustStatus == Qgis::ProjectTrustStatus::Trusted;
439}
440
442{
443 static std::once_flag initialized;
444 std::call_once( initialized, []() {
445 auto _initCalloutWidgetFunction = []( const QString &name, QgsCalloutWidgetFunc f ) {
447
448 QgsCalloutAbstractMetadata *abstractMetadata = registry->calloutMetadata( name );
449 if ( !abstractMetadata )
450 {
451 QgsDebugError( u"Failed to find callout entry in registry: %1"_s.arg( name ) );
452 }
453 QgsCalloutMetadata *metadata = dynamic_cast<QgsCalloutMetadata *>( abstractMetadata );
454 if ( !metadata )
455 {
456 QgsDebugError( u"Failed to cast callout's metadata: "_s.arg( name ) );
457 }
458 else
459 {
460 metadata->setWidgetFunction( f );
461 }
462 };
463
464 _initCalloutWidgetFunction( u"simple"_s, QgsSimpleLineCalloutWidget::create );
465 _initCalloutWidgetFunction( u"manhattan"_s, QgsManhattanLineCalloutWidget::create );
466 _initCalloutWidgetFunction( u"curved"_s, QgsCurvedLineCalloutWidget::create );
467 _initCalloutWidgetFunction( u"balloon"_s, QgsBalloonCalloutWidget::create );
468 } );
469}
470
472{
473 static std::once_flag initialized;
474 std::call_once( initialized, []() {
475 auto _initPlotWidgetFunction = []( const QString &name, QgsPlotWidgetCreateFunc f ) {
477
478 QgsPlotAbstractMetadata *abstractMetadata = registry->plotMetadata( name );
479 if ( !abstractMetadata )
480 {
481 QgsDebugError( u"Failed to find plot entry in registry: %1"_s.arg( name ) );
482 }
483 QgsPlotMetadata *metadata = dynamic_cast<QgsPlotMetadata *>( abstractMetadata );
484 if ( !metadata )
485 {
486 QgsDebugError( u"Failed to cast plot's metadata: "_s.arg( name ) );
487 }
488 else
489 {
490 metadata->setWidgetCreateFunction( std::move( f ) );
491 }
492 };
493
494 _initPlotWidgetFunction( u"bar"_s, QgsBarChartPlotWidget::create );
495 _initPlotWidgetFunction( u"line"_s, QgsLineChartPlotWidget::create );
496 _initPlotWidgetFunction( u"pie"_s, QgsPieChartPlotWidget::create );
497 } );
498}
499
501{
502#ifdef HAVE_WEBENGINE
503 return true;
504#else
505 return false;
506#endif
507}
508
510{
511 const QgsSettings s;
512 const int w = s.value( u"/qgis/toolbarIconSize"_s, 32 ).toInt();
513 QSize size( w, w );
514
515 switch ( iconType )
516 {
518 return size;
520 return QgsGuiUtils::panelIconSize( size );
521 }
523}
524
526void QgsGui::emitOptionsChanged()
527{
528 emit optionsChanged();
529}
ProjectTrustStatus
Project trust status.
Definition qgis.h:476
@ Trusted
The project has been determined by the user as trusted.
Definition qgis.h:478
@ Undetermined
The project trust has not yet been determined by the user.
Definition qgis.h:477
UserInterfaceIconType
Icon types for icons shown in the user interface.
Definition qgis.h:7083
@ MainWindowToolbar
Main window toolbar icons.
Definition qgis.h:7084
@ DockedToolbar
Toolbars for docked windows.
Definition qgis.h:7085
@ Warning
Warning message.
Definition qgis.h:162
@ Info
Information message.
Definition qgis.h:161
EmbeddedScriptMode
Authorisation to run script embedded in projects.
Definition qgis.h:448
@ Always
Embedded scripts are always run.
Definition qgis.h:452
@ Never
Embedded scripts never run.
Definition qgis.h:449
@ Ask
User is prompted before running scripts.
Definition qgis.h:450
Registry of available advanced digitizing tools.
Registry of available annotation item GUI behavior.
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.
static QgsPlotRegistry * plotRegistry()
Returns the application's plot registry, used for plot types.
static QgsPlotWidget * create(QWidget *parent)
Creates a new bar chart plot configuration widget.
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.
A registry for data item GUI providers that may affect how QgsDataItems behave within the application...
A registry that manages all known edit widget factories.
static QSize iconSize(Qgis::UserInterfaceIconType iconType=Qgis::UserInterfaceIconType::MainWindowToolbar)
Returns the desired size for user interface icons.
Definition qgsgui.cpp:509
static QgsMapToolShapeRegistry * mapToolShapeRegistry()
Returns the registry of shape map tools.
Definition qgsgui.cpp:120
static QgsEditorWidgetRegistry * editorWidgetRegistry()
Returns the global editor widget registry, used for managing all known edit widget factories.
Definition qgsgui.cpp:110
static QgsProviderSourceWidgetProviderRegistry * sourceWidgetProviderRegistry()
Returns the registry of provider source widget providers.
Definition qgsgui.cpp:135
static QgsProcessingGuiRegistry * processingGuiRegistry()
Returns the global processing gui registry, used for registering the GUI behavior of processing algor...
Definition qgsgui.cpp:170
static QgsShortcutsManager * shortcutsManager()
Returns the global shortcuts manager, used for managing a QAction and QShortcut sequences.
Definition qgsgui.cpp:140
static void setWindowManager(QgsWindowManagerInterface *manager)
Sets the global window manager.
Definition qgsgui.cpp:249
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:239
static QgsProcessingFavoriteAlgorithmManager * processingFavoriteAlgorithmManager()
Returns the global Processing favorite algorithm manager, used for tracking favorite Processing algor...
Definition qgsgui.cpp:185
static QgsLayerTreeEmbeddedWidgetRegistry * layerTreeEmbeddedWidgetRegistry()
Returns the global layer tree embedded widget registry, used for registering widgets that may be embe...
Definition qgsgui.cpp:145
void applicationStyleSheetChanged(const QString &styleSheet)
Emitted whenever the application style sheet is changed.
static QScreen * findScreenAt(QPoint point)
Returns the screen at the given global point (pixel).
Definition qgsgui.cpp:314
static QgsAnnotationItemGuiRegistry * annotationItemGuiRegistry()
Returns the global annotation item GUI registry, used for registering the GUI behavior of annotation ...
Definition qgsgui.cpp:160
static QString applicationStyleSheet()
Returns the application style sheet.
Definition qgsgui.cpp:399
static QgsMapLayerActionRegistry * mapLayerActionRegistry()
Returns the global map layer action registry, used for registering map layer actions.
Definition qgsgui.cpp:150
static QgsGui * instance()
Returns a pointer to the singleton instance.
Definition qgsgui.cpp:94
static QgsProviderGuiRegistry * providerGuiRegistry()
Returns the registry of GUI-related components of data providers.
Definition qgsgui.cpp:205
static QgsRelationWidgetRegistry * relationWidgetRegistry()
Returns the global relation widget registry, used for managing all known relation widget factories.
Definition qgsgui.cpp:115
static QgsSensorGuiRegistry * sensorGuiRegistry()
Returns the registry of GUI-related components for sensors.
Definition qgsgui.cpp:210
static QgsAdvancedDigitizingToolsRegistry * advancedDigitizingToolsRegistry()
Returns the global advanced digitizing tools registry, used for registering advanced digitizing tools...
Definition qgsgui.cpp:165
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:225
static QgsHistoryProviderRegistry * historyProviderRegistry()
Returns the global history provider registry, used for tracking history providers.
Definition qgsgui.cpp:215
static bool allowExecutionOfEmbeddedScripts(QgsProject *project, QgsMessageBar *messageBar=nullptr)
Returns true if python embedded in a project is currently allowed to be loaded.
Definition qgsgui.cpp:413
@ HigMenuTextIsTitleCase
Menu action texts should be title case.
Definition qgsgui.h:283
@ HigDialogTitleIsTitleCase
Dialog titles should be title case.
Definition qgsgui.h:284
static QgsStoredQueryManager * storedQueryManager()
Returns the global stored SQL query manager.
Definition qgsgui.cpp:244
static QgsNative * nativePlatformInterface()
Returns the global native interface, which offers abstraction to the host OS's underlying public inte...
Definition qgsgui.cpp:100
static bool hasWebEngine()
Checks whether QWebEngineView is available to display HTML content.
Definition qgsgui.cpp:500
QgsGui(const QgsGui &other)=delete
static QgsWindowManagerInterface * windowManager()
Returns the global window manager, if set.
Definition qgsgui.cpp:234
static QgsDataItemGuiProviderRegistry * dataItemGuiProviderRegistry()
Returns the global data item GUI provider registry, used for tracking providers which affect the brow...
Definition qgsgui.cpp:195
~QgsGui() override
Definition qgsgui.cpp:266
static QgsProcessingRecentAlgorithmLog * processingRecentAlgorithmLog()
Returns the global processing recent algorithm log, used for tracking recently used processing algori...
Definition qgsgui.cpp:190
QFlags< HigFlag > HigFlags
Definition qgsgui.h:286
static QgsSubsetStringEditorProviderRegistry * subsetStringEditorProviderRegistry()
Returns the registry of subset string editors of data providers.
Definition qgsgui.cpp:130
static QgsProjectStorageGuiRegistry * projectStorageGuiRegistry()
Returns the global GUI-related project storage registry.
Definition qgsgui.cpp:200
static QgsGui::HigFlags higFlags()
Returns the platform's HIG flags.
Definition qgsgui.cpp:254
static QgsLayoutItemGuiRegistry * layoutItemGuiRegistry()
Returns the global layout item GUI registry, used for registering the GUI behavior of layout items.
Definition qgsgui.cpp:155
void setApplicationStyleSheet(const QString &styleSheet)
Sets the application style sheet.
Definition qgsgui.cpp:404
static void initPlotWidgets()
Initializes plot widgets.
Definition qgsgui.cpp:471
static void initCalloutWidgets()
Initializes callout widgets.
Definition qgsgui.cpp:441
static QgsSettingsRegistryGui * settingsRegistryGui()
Returns the gui's settings registry, used for managing gui settings.
Definition qgsgui.cpp:105
static QgsSourceSelectProviderRegistry * sourceSelectProviderRegistry()
Returns the global source select provider registry, used for managing all known source select widget ...
Definition qgsgui.cpp:125
static QgsCodeEditorColorSchemeRegistry * codeEditorColorSchemeRegistry()
Returns the global code editor color scheme registry, used for registering the color schemes for QgsC...
Definition qgsgui.cpp:180
static QgsNumericFormatGuiRegistry * numericFormatGuiRegistry()
Returns the global numeric format gui registry, used for registering the GUI widgets associated with ...
Definition qgsgui.cpp:175
static QgsSettingsEditorWidgetRegistry * settingsEditorWidgetRegistry()
Returns the registry of settings editors.
Definition qgsgui.cpp:220
static QColor sampleColor(QPoint point)
Samples the color on screen at the specified global point (pixel).
Definition qgsgui.cpp:299
A registry for objects which track user history (i.e.
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.
static QgsPlotWidget * create(QWidget *parent)
Creates a new line chart plot configuration widget.
A registry which tracks map layer actions.
Keeps track of the registered shape map tools.
A bar for displaying non-blocking messages to the user.
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.
A registry for widgets which configure QgsNumericFormat objects.
static QgsPlotWidget * create(QWidget *parent)
Creates a new line chart plot configuration widget.
Stores metadata about a plot class.
Convenience metadata class that uses static functions to create plots.
void setWidgetCreateFunction(QgsPlotWidgetCreateFunc function)
Sets the classes' plot widget creation function.
Registry of available plot types.
QgsPlotAbstractMetadata * plotMetadata(const QString &type) const
Returns the metadata for the specified plot type.
A registry for widgets for use with the Processing framework.
A registry / canonical manager of GUI parts of project storage backends.
A dialog to handle granting of trust to projects containing embedded script.
static Qgis::ProjectTrustStatus checkUserTrust(QgsProject *project)
Returns the current trust status of the specified project.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114
A registry / canonical manager of GUI parts of data providers.
A registry that keeps a list of provider source widget providers.
Keeps track of the registered relations widgets.
Registry of available sensor GUI behavior.
A registry that manages editor widgets for settings.
static const QgsSettingsEntryEnumFlag< Qgis::EmbeddedScriptMode > * settingsCodeExecutionBehaviorUndeterminedProjects
Settings entry for behavior handling embedded scripts within projects.
Used for settings introspection and collects all QgsSettingsEntry instances of GUI.
Stores settings for use within QGIS.
Definition qgssettings.h:68
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
Shortcuts manager is a class that contains a list of QActions and QShortcuts that have been registere...
A registry for QgsSourceSelectProvider source select providers.
A manager for stored SQL queries.
A registry for subset string editor providers.
QSize panelIconSize(QSize size)
Returns dockable panel toolbar icon width based on the provided window toolbar width.
#define BUILTIN_UNREACHABLE
Definition qgis.h:8229
QgsCalloutWidget *(* QgsCalloutWidgetFunc)(QgsMapLayer *)
#define QgsDebugError(str)
Definition qgslogger.h:71
std::function< QgsPlotWidget *(QWidget *parent)> QgsPlotWidgetCreateFunc