1/************************************************************************ 2 * This file has been generated automatically from * 3 * * 4 * src/core/qgsapplication.h * 5 * * 6 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 7 ************************************************************************/ 8 9 10 11 12 13class QgsApplication : QApplication 14{ 15%Docstring 16Extends QApplication to provide access to QGIS specific resources such 17as theme paths, database paths etc. 18 19This is a subclass of QApplication and should be instantiated in place of 20QApplication. Most methods are static in keeping with the design of QApplication. 21 22This class hides platform-specific path information and provides 23a portable way of referencing specific files and directories. 24Ideally, hard-coded paths should appear only here and not in other modules 25so that platform-conditional code is minimized and paths are easier 26to change due to centralization. 27%End 28 29%TypeHeaderCode 30#include "qgsapplication.h" 31%End 32%TypeCode 33 // Convert a Python argv list to a conventional C argc count and argv array. 34 static char **qtgui_ArgvToC( PyObject *argvlist, int &argc ) 35 { 36 char **argv; 37 38 argc = PyList_GET_SIZE( argvlist ); 39 40 // Allocate space for two copies of the argument pointers, plus the 41 // terminating NULL. 42 if ( ( argv = ( char ** )sipMalloc( 2 * ( argc + 1 ) * sizeof( char * ) ) ) == NULL ) 43 return NULL; 44 45 // Convert the list. 46 for ( int a = 0; a < argc; ++a ) 47 { 48 char *arg; 49 // Get the argument and allocate memory for it. 50 if ( ( arg = PyBytes_AsString( PyList_GET_ITEM( argvlist, a ) ) ) == NULL || 51 ( argv[a] = ( char * )sipMalloc( strlen( arg ) + 1 ) ) == NULL ) 52 return NULL; 53 // Copy the argument and save a pointer to it. 54 strcpy( argv[a], arg ); 55 argv[a + argc + 1] = argv[a]; 56 } 57 58 argv[argc + argc + 1] = argv[argc] = NULL; 59 60 return argv; 61 } 62 63 // Remove arguments from the Python argv list that have been removed from the 64 // C argv array. 65 static void qtgui_UpdatePyArgv( PyObject *argvlist, int argc, char **argv ) 66 { 67 for ( int a = 0, na = 0; a < argc; ++a ) 68 { 69 // See if it was removed. 70 if ( argv[na] == argv[a + argc + 1] ) 71 ++na; 72 else 73 PyList_SetSlice( argvlist, na, na + 1, NULL ); 74 } 75 } 76%End 77 public: 78 79 enum StyleSheetType 80 { 81 Qt, 82 WebBrowser, 83 }; 84 85 static const char *QGIS_ORGANIZATION_NAME; 86 static const char *QGIS_ORGANIZATION_DOMAIN; 87 static const char *QGIS_APPLICATION_NAME; 88 QgsApplication( SIP_PYLIST argv, bool GUIenabled, QString profileFolder = QString(), QString platformName = "desktop" ) / PostHook = __pyQtQAppHook__ / [( int &argc, char **argv, bool GUIenabled, const QString &profileFolder = QString(), const QString &platformName = "desktop" )]; 89%MethodCode 90 // The Python interface is a list of argument strings that is modified. 91 92 int argc; 93 char **argv; 94 95 // Convert the list. 96 if ( ( argv = qtgui_ArgvToC( a0, argc ) ) == NULL ) 97 sipIsErr = 1; 98 else 99 { 100 // Create it now the arguments are right. 101 static int nargc = argc; 102 103 sipCpp = new sipQgsApplication( nargc, argv, a1, *a2, *a3 ); 104 105 // Now modify the original list. 106 qtgui_UpdatePyArgv( a0, argc, argv ); 107 } 108%End 109 110 ~QgsApplication(); 111 112 static QgsApplication *instance(); 113%Docstring 114Returns the singleton instance of the QgsApplication. 115 116.. versionadded:: 3.0 117%End 118 119 120 virtual bool event( QEvent *event ); 121 122%Docstring 123Watch for QFileOpenEvent. 124%End 125 126 virtual bool notify( QObject *receiver, QEvent *event ); 127 128%Docstring 129Catch exceptions when sending event to receiver. 130%End 131 132 static void setFileOpenEventReceiver( QObject *receiver ); 133%Docstring 134Sets the FileOpen event receiver 135%End 136 137 static void setThemeName( const QString &themeName ); 138%Docstring 139Set the active theme to the specified theme. 140The theme name should be a single word e.g. 'default','classic'. 141The theme search path usually will be pkgDataPath + "/themes/" + themName + "/" 142but plugin writers etc can use :py:func:`~QgsApplication.themeName` as a basis for searching 143for resources in their own datastores e.g. a Qt4 resource bundle. 144 145.. note:: 146 147 A basic test will be carried out to ensure the theme search path 148 based on the supplied theme name exists. If it does not the theme name will 149 be reverted to 'default'. 150%End 151 152 static QString resolvePkgPath(); 153%Docstring 154Calculate the application pkg path 155 156:return: the resolved pkg path 157%End 158 159 static QString themeName(); 160%Docstring 161Set the active theme to the specified theme. 162The theme name should be a single word e.g. 'default','classic'. 163The theme search path usually will be pkgDataPath + "/themes/" + themName + "/" 164but plugin writers etc can use this method as a basis for searching 165for resources in their own datastores e.g. a Qt4 resource bundle. 166%End 167 168 static void setUITheme( const QString &themeName ); 169%Docstring 170Set the current UI theme used to style the interface. Use :py:func:`~QgsApplication.uiThemes` to 171find valid themes to use. Variables found in variables.qss will be added to the stylesheet 172on load. 173 174:param themeName: The name of the theme. 175 176.. note:: 177 178 using an invalid theme name will reset to default 179%End 180 181 static QHash<QString, QString> uiThemes(); 182%Docstring 183All themes found in ~/.qgis3/themes folder. 184The path is to the root folder for the theme 185 186:return: A hash of theme name and theme path. Valid theme folders contain style.qss 187 188.. note:: 189 190 Valid theme folders must contain a style.qss file. 191%End 192 193 static QString authorsFilePath(); 194%Docstring 195Returns the path to the authors file. 196%End 197 198 static QString contributorsFilePath(); 199%Docstring 200Returns the path to the contributors file. 201Contributors are people who have submitted patches 202but don't have commit access. 203%End 204 205 static QString developersMapFilePath(); 206%Docstring 207Returns the path to the developers map file. 208The developers map was created by using leaflet framework, 209it shows the contributors.json file. 210 211.. versionadded:: 2.7 212%End 213 214 static QString sponsorsFilePath(); 215%Docstring 216Returns the path to the sponsors file. 217%End 218 219 static QString donorsFilePath(); 220%Docstring 221Returns the path to the donors file. 222%End 223 224 static QString serverResourcesPath(); 225%Docstring 226Returns the path to the server resources directory. 227%End 228 229 static QString translatorsFilePath(); 230%Docstring 231Returns the path to the sponsors file. 232%End 233 234 static QString licenceFilePath(); 235%Docstring 236Returns the path to the licence file. 237%End 238 239 static QString i18nPath(); 240%Docstring 241Returns the path to the translation directory. 242%End 243 244 static QString metadataPath(); 245%Docstring 246Returns the path to the metadata directory. 247 248.. versionadded:: 3.0 249%End 250 251 static QString qgisMasterDatabaseFilePath(); 252%Docstring 253Returns the path to the master qgis.db file. 254%End 255 256 static QString qgisSettingsDirPath(); 257%Docstring 258Returns the path to the settings directory in user's home dir 259%End 260 261 static QString qgisUserDatabaseFilePath(); 262%Docstring 263Returns the path to the user qgis.db file. 264%End 265 266 static QString qgisAuthDatabaseFilePath(); 267%Docstring 268Returns the path to the user authentication database file: qgis-auth.db. 269%End 270 271 static QString splashPath(); 272%Docstring 273Returns the path to the splash screen image directory. 274%End 275 276 static QString iconsPath(); 277%Docstring 278Returns the path to the icons image directory. 279%End 280 281 static QString srsDatabaseFilePath(); 282%Docstring 283Returns the path to the srs.db file. 284%End 285 286 static QStringList svgPaths(); 287%Docstring 288Returns the paths to svg directories. 289%End 290 291 static QStringList layoutTemplatePaths(); 292%Docstring 293Returns the paths to layout template directories. 294 295.. versionadded:: 3.0 296%End 297 298 static QMap<QString, QString> systemEnvVars(); 299%Docstring 300Returns the system environment variables passed to application. 301%End 302 303 static QString prefixPath(); 304%Docstring 305Returns the path to the application prefix directory. 306%End 307 308 static QString pluginPath(); 309%Docstring 310Returns the path to the application plugin directory. 311%End 312 313 static QString pkgDataPath(); 314%Docstring 315Returns the common root path of all application data directories. 316%End 317 318 static QString activeThemePath(); 319%Docstring 320Returns the path to the currently active theme directory. 321%End 322 323 static QString defaultThemePath(); 324%Docstring 325Returns the path to the default theme directory. 326%End 327 328 static QString iconPath( const QString &iconFile ); 329%Docstring 330Returns path to the desired icon file. 331First it tries to use the active theme path, then default theme path 332%End 333 334 static QIcon getThemeIcon( const QString &name ); 335%Docstring 336Helper to get a theme icon. It will fall back to the 337default theme if the active theme does not have the required icon. 338%End 339 340 enum Cursor 341 { 342 ZoomIn, 343 ZoomOut, 344 Identify, 345 CrossHair, 346 CapturePoint, 347 Select, 348 Sampler, 349 }; 350 351 static QCursor getThemeCursor( Cursor cursor ); 352%Docstring 353Helper to get a theme cursor. It will fall back to the 354default theme if the active theme does not have the required icon. 355Cursors are automatically scaled to look like a 16px cursor on 96dpi 356screens. 357%End 358 359 static QPixmap getThemePixmap( const QString &name, const QColor &foreColor = QColor(), const QColor &backColor = QColor(), int size = 16 ); 360%Docstring 361Helper to get a theme icon as a pixmap. It will fall back to the 362default theme if the active theme does not have the required icon. 363 364If ``foreColor`` or ``backColor`` are specified, then these colors will 365be used for parametrized colors in SVG files wherever available. If 366colors are specified then the ``size`` argument also must be set. 367%End 368 369 static QString userStylePath(); 370%Docstring 371Returns the path to user's style. 372%End 373 374 static QRegExp shortNameRegExp(); 375%Docstring 376Returns the short name regular expression for line edit validator 377%End 378 379 static QString userLoginName(); 380%Docstring 381Returns the user's operating system login account name. 382 383.. seealso:: :py:func:`userFullName` 384 385.. versionadded:: 2.14 386%End 387 388 static QString userFullName(); 389%Docstring 390Returns the user's operating system login account full display name. 391 392.. seealso:: :py:func:`userLoginName` 393 394.. versionadded:: 2.14 395%End 396 397 static QString osName(); 398%Docstring 399Returns a string name of the operating system QGIS is running on. 400 401.. seealso:: :py:func:`platform` 402 403.. versionadded:: 2.14 404%End 405 406 static QString platform(); 407%Docstring 408Returns the QGIS platform name, e.g., "desktop" or "server". 409 410.. seealso:: :py:func:`osName` 411 412.. versionadded:: 2.14 413%End 414 415 static QString locale(); 416%Docstring 417Returns the QGIS locale. 418 419.. versionadded:: 3.0 420%End 421 422 static QString userThemesFolder(); 423%Docstring 424Returns the path to user's themes folder 425%End 426 427 static QString defaultStylePath(); 428%Docstring 429Returns the path to default style (works as a starting point). 430%End 431 432 static QString defaultThemesFolder(); 433%Docstring 434Returns the path to default themes folder from install (works as a starting point). 435%End 436 437 static QString libraryPath(); 438%Docstring 439Returns the path containing qgis_core, qgis_gui, qgispython (and other) libraries 440%End 441 442 static QString libexecPath(); 443%Docstring 444Returns the path with utility executables (help viewer, crssync, ...) 445%End 446 447 static QString qmlImportPath(); 448%Docstring 449Returns the path where QML components are installed for QGIS Quick library. Returns 450empty string when QGIS is built without Quick support 451 452.. versionadded:: 3.2 453%End 454 455 static void setPrefixPath( const QString &prefixPath, bool useDefaultPaths = false ); 456%Docstring 457Alters prefix path - used by 3rd party apps 458%End 459 460 static void setPluginPath( const QString &pluginPath ); 461%Docstring 462Alters plugin path - used by 3rd party apps 463%End 464 465 static void setPkgDataPath( const QString &pkgDataPath ); 466%Docstring 467Alters pkg data path - used by 3rd party apps 468%End 469 470 static void setDefaultSvgPaths( const QStringList &pathList ); 471%Docstring 472Alters default svg paths - used by 3rd party apps. 473%End 474 475 static void setAuthDatabaseDirPath( const QString &authDbDirPath ); 476%Docstring 477Alters authentication data base directory path - used by 3rd party apps 478%End 479 480 static void initQgis(); 481%Docstring 482loads providers 483%End 484 485 static bool createDatabase( QString *errorMessage = 0 ); 486%Docstring 487initialize qgis.db 488%End 489 490 static bool createThemeFolder(); 491%Docstring 492Create the users theme folder 493%End 494 495 static void exitQgis(); 496%Docstring 497deletes provider registry and map layer registry 498%End 499 500 static QString appIconPath(); 501%Docstring 502Gets application icon 503%End 504 505 enum endian_t 506 { 507 XDR, 508 NDR 509 }; 510 511 static endian_t endian(); 512%Docstring 513Returns whether this machine uses big or little endian 514%End 515 516 static QString reportStyleSheet( QgsApplication::StyleSheetType styleSheetType = QgsApplication::StyleSheetType::Qt ); 517%Docstring 518Returns a css style sheet for reports, the ``styleSheetType`` argument 519determines what type of stylesheet is supported by the widget. 520 521Typically you will use this method by doing: 522QString myStyle = :py:func:`QgsApplication.reportStyleSheet()`; 523textBrowserReport->:py:func:`~QgsApplication.document`->setDefaultStyleSheet(myStyle); 524if you are using a QgsWebView you will need to manually inject 525the CSS into a head -> script tag instead. 526 527:return: the stylesheet CSS rules. 528 529.. note:: 530 531 if styleSheetType equals StyleSheetType.Qt you can use the special Qt extensions too, 532 for example the gradient fills for backgrounds. 533%End 534 535 static QString showSettings(); 536%Docstring 537Convenience function to get a summary of the paths used in this 538application instance useful for debugging mainly. 539%End 540 541 static void registerOgrDrivers(); 542%Docstring 543Register OGR drivers ensuring this only happens once. 544This is a workaround for an issue with older gdal versions that 545caused duplicate driver name entries to appear in the list 546of registered drivers when QgsApplication.registerOgrDrivers was called multiple 547times. 548%End 549 550 static QString absolutePathToRelativePath( const QString &apath, const QString &targetPath ); 551%Docstring 552Converts absolute path to path relative to target 553%End 554 static QString relativePathToAbsolutePath( const QString &rpath, const QString &targetPath ); 555%Docstring 556Converts path relative to target to an absolute path 557%End 558 559 static bool isRunningFromBuildDir(); 560%Docstring 561Indicates whether running from build directory (not installed) 562%End 563 static QString buildSourcePath(); 564%Docstring 565Returns path to the source directory. Valid only when running from build directory 566%End 567 static QString buildOutputPath(); 568%Docstring 569Returns path to the build output directory. Valid only when running from build directory 570%End 571 572 static void skipGdalDriver( const QString &driver ); 573%Docstring 574Sets the GDAL_SKIP environment variable to include the specified driver 575and then calls GDALDriverManager.AutoSkipDrivers() to unregister it. The 576driver name should be the short format of the Gdal driver name e.g. GTIFF. 577%End 578 579 static void restoreGdalDriver( const QString &driver ); 580%Docstring 581Sets the GDAL_SKIP environment variable to exclude the specified driver 582and then calls GDALDriverManager.AutoSkipDrivers() to unregister it. The 583driver name should be the short format of the Gdal driver name e.g. GTIFF. 584%End 585 586 static QStringList skippedGdalDrivers(); 587%Docstring 588Returns the list of gdal drivers that should be skipped (based on 589GDAL_SKIP environment variable) 590%End 591 592 static void applyGdalSkippedDrivers(); 593%Docstring 594Apply the skipped drivers list to gdal 595 596.. seealso:: :py:func:`skipGdalDriver` 597 598.. seealso:: :py:func:`restoreGdalDriver` 599 600.. seealso:: :py:func:`skippedGdalDrivers` 601%End 602 603 static void registerGdalDriversFromSettings(); 604%Docstring 605Register gdal drivers, excluding the ones mentioned in "gdal/skipList" setting. 606 607.. versionadded:: 3.10 608%End 609 610 static QStringList deferredSkippedGdalDrivers(); 611%Docstring 612Returns the list of gdal drivers that have been disabled in the current session, 613and thus, for safety, should not be disabled right now, but at the 614next application restart. 615 616.. versionadded:: 3.10 617%End 618 619 static void setSkippedGdalDrivers( const QStringList &skippedGdalDrivers, 620 const QStringList &deferredSkippedGdalDrivers ); 621%Docstring 622Sets the list of gdal drivers that should be disabled (``skippedGdalDrivers``), 623but excludes for now the ones defines in ``deferredSkippedGdalDrivers``. 624This writes the "gdal/skipList" setting. 625 626.. versionadded:: 3.10 627%End 628 629 static int maxThreads(); 630%Docstring 631Gets maximum concurrent thread count 632 633.. versionadded:: 2.4 634%End 635 636 static void setMaxThreads( int maxThreads ); 637%Docstring 638Set maximum concurrent thread count 639 640.. note:: 641 642 must be between 1 and \#cores, -1 means use all available cores 643 644.. versionadded:: 2.4 645%End 646 647 static QgsTaskManager *taskManager(); 648%Docstring 649Returns the application's task manager, used for managing application 650wide background task handling. 651 652.. versionadded:: 3.0 653%End 654 655 static QgsColorSchemeRegistry *colorSchemeRegistry() /KeepReference/; 656%Docstring 657Returns the application's color scheme registry, used for managing color schemes. 658 659.. versionadded:: 3.0 660%End 661 662 static QgsPaintEffectRegistry *paintEffectRegistry() /KeepReference/; 663%Docstring 664Returns the application's paint effect registry, used for managing paint effects. 665 666.. versionadded:: 3.0 667%End 668 669 static QgsRendererRegistry *rendererRegistry() /KeepReference/; 670%Docstring 671Returns the application's renderer registry, used for managing vector layer renderers. 672 673.. versionadded:: 3.0 674%End 675 676 677 static QgsDataItemProviderRegistry *dataItemProviderRegistry() /KeepReference/; 678%Docstring 679Returns the application's data item provider registry, which keeps a list of data item 680providers that may add items to the browser tree. 681 682.. versionadded:: 3.0 683%End 684 685 static QgsSvgCache *svgCache(); 686%Docstring 687Returns the application's SVG cache, used for caching SVG images and handling parameter replacement 688within SVG files. 689 690.. seealso:: :py:func:`imageCache` 691 692.. versionadded:: 3.0 693%End 694 695 static QgsImageCache *imageCache(); 696%Docstring 697Returns the application's image cache, used for caching resampled versions of raster images. 698 699.. seealso:: :py:func:`svgCache` 700 701.. versionadded:: 3.6 702%End 703 704 static QgsSourceCache *sourceCache(); 705%Docstring 706Returns the application's source cache, used for caching embedded and remote source strings as local files 707 708.. versionadded:: 3.16 709%End 710 711 static QgsNetworkContentFetcherRegistry *networkContentFetcherRegistry() /KeepReference/; 712%Docstring 713Returns the application's network content registry used for fetching temporary files during QGIS session 714 715.. versionadded:: 3.2 716%End 717 718 static QgsValidityCheckRegistry *validityCheckRegistry() /KeepReference/; 719%Docstring 720Returns the application's validity check registry, used for managing validity checks. 721 722.. versionadded:: 3.6 723%End 724 725 static QgsSymbolLayerRegistry *symbolLayerRegistry() /KeepReference/; 726%Docstring 727Returns the application's symbol layer registry, used for managing symbol layers. 728 729.. versionadded:: 3.0 730%End 731 732 static QgsCalloutRegistry *calloutRegistry() /KeepReference/; 733%Docstring 734Returns the application's callout registry, used for managing callout types. 735 736.. versionadded:: 3.10 737%End 738 739 static QgsLayoutItemRegistry *layoutItemRegistry() /KeepReference/; 740%Docstring 741Returns the application's layout item registry, used for layout item types. 742 743.. versionadded:: 3.0 744%End 745 746 static QgsAnnotationItemRegistry *annotationItemRegistry() /KeepReference/; 747%Docstring 748Returns the application's annotation item registry, used for annotation item types. 749 750.. versionadded:: 3.16 751%End 752 753 static QgsGpsConnectionRegistry *gpsConnectionRegistry() /KeepReference/; 754%Docstring 755Returns the application's GPS connection registry, used for managing GPS connections. 756 757.. versionadded:: 3.0 758%End 759 760 static QgsPluginLayerRegistry *pluginLayerRegistry() /KeepReference/; 761%Docstring 762Returns the application's plugin layer registry, used for managing plugin layer types. 763 764.. versionadded:: 3.0 765%End 766 767 static QgsClassificationMethodRegistry *classificationMethodRegistry() /KeepReference/; 768%Docstring 769Returns the application's classification methods registry, used in graduated renderer 770 771.. versionadded:: 3.10 772%End 773 774 static QgsBookmarkManager *bookmarkManager(); 775%Docstring 776Returns the application's bookmark manager, used for storing installation-wide bookmarks. 777 778.. versionadded:: 3.10 779%End 780 781 static QgsStyleModel *defaultStyleModel(); 782%Docstring 783Returns a shared QgsStyleModel containing the default style library (see :py:func:`QgsStyle.defaultStyle()`). 784 785Using this shared model instead of creating a new QgsStyleModel improves performance. 786 787.. versionadded:: 3.10 788%End 789 790 static QgsMessageLog *messageLog(); 791%Docstring 792Returns the application's message log. 793 794.. versionadded:: 3.0 795%End 796 797 static QgsAuthManager *authManager(); 798%Docstring 799Returns the application's authentication manager instance 800 801.. note:: 802 803 this can be ``None`` if called before initQgis 804 805.. seealso:: :py:func:`initQgis` 806 807.. versionadded:: 3.0 808%End 809 810 static QgsProcessingRegistry *processingRegistry(); 811%Docstring 812Returns the application's processing registry, used for managing processing providers, 813algorithms, and various parameters and outputs. 814 815.. versionadded:: 3.0 816%End 817 818 static QgsPageSizeRegistry *pageSizeRegistry() /KeepReference/; 819%Docstring 820Returns the application's page size registry, used for managing layout page sizes. 821 822.. versionadded:: 3.0 823%End 824 825 826 static QgsActionScopeRegistry *actionScopeRegistry() /KeepReference/; 827%Docstring 828Returns the action scope registry. 829 830.. versionadded:: 3.0 831%End 832 833 static QgsConnectionRegistry *connectionRegistry(); 834%Docstring 835Returns the application's connection registry, used for managing saved data provider connections. 836 837.. versionadded:: 3.14 838%End 839 840 static QgsRuntimeProfiler *profiler(); 841%Docstring 842Returns the application runtime profiler. 843 844.. versionadded:: 3.0 845%End 846 847 static QgsNumericFormatRegistry *numericFormatRegistry() /KeepReference/; 848%Docstring 849Gets the registry of available numeric formats. 850 851.. versionadded:: 3.12 852%End 853 854 static QgsFieldFormatterRegistry *fieldFormatterRegistry() /KeepReference/; 855%Docstring 856Gets the registry of available field formatters. 857%End 858 859 static Qgs3DRendererRegistry *renderer3DRegistry() /KeepReference/; 860%Docstring 861Returns registry of available 3D renderers. 862 863.. versionadded:: 3.0 864%End 865 866 static Qgs3DSymbolRegistry *symbol3DRegistry() /KeepReference/; 867%Docstring 868Returns registry of available 3D symbols. 869 870.. versionadded:: 3.16 871%End 872 873 static QgsScaleBarRendererRegistry *scaleBarRendererRegistry() /KeepReference/; 874%Docstring 875Gets the registry of available scalebar renderers. 876 877.. versionadded:: 3.14 878%End 879 880 static QgsProjectStorageRegistry *projectStorageRegistry() /KeepReference/; 881%Docstring 882Returns registry of available project storage implementations. 883 884.. versionadded:: 3.2 885%End 886 887 static QgsLocalizedDataPathRegistry *localizedDataPathRegistry() /KeepReference/; 888%Docstring 889Returns the registry of data repositories 890These are used as paths for basemaps, logos, etc. which can be referenced 891differently across work stations. 892 893.. seealso:: :py:class:`QgsLocalizedDataPathRegistry` 894 895.. versionadded:: 3.14 896%End 897 898 static QString nullRepresentation(); 899%Docstring 900This string is used to represent the value `NULL` throughout QGIS. 901 902In general, when passing values around, prefer to use a null QVariant 903`QVariant( field.type() )` or `QVariant( QVariant.Int )`. This value 904should only be used in the final presentation step when showing values 905in a widget or sending it to a web browser. 906%End 907 908 static void setNullRepresentation( const QString &nullRepresentation ); 909%Docstring 910\copydoc :py:func:`~QgsApplication.nullRepresentation` 911%End 912 913 static QVariantMap customVariables(); 914%Docstring 915Custom expression variables for this application. 916This does not include generated variables (like system name, user name etc.) 917 918.. seealso:: :py:func:`QgsExpressionContextUtils.globalScope` 919 920.. versionadded:: 3.0 921%End 922 923 static void setCustomVariables( const QVariantMap &customVariables ); 924%Docstring 925Custom expression variables for this application. 926Do not include generated variables (like system name, user name etc.) 927 928.. seealso:: :py:func:`QgsExpressionContextUtils.globalScope` 929 930.. versionadded:: 3.0 931%End 932 933 static void setCustomVariable( const QString &name, const QVariant &value ); 934%Docstring 935Set a single custom expression variable. 936 937.. versionadded:: 3.0 938%End 939 940 static int scaleIconSize( int standardSize, bool applyDevicePixelRatio = false ); 941%Docstring 942Scales an icon size to compensate for display pixel density, making the icon 943size hi-dpi friendly, whilst still resulting in pixel-perfect sizes for low-dpi 944displays. 945 946``standardSize`` should be set to a standard icon size, e.g. 16, 24, 48, etc. 947 948.. versionadded:: 3.16 949%End 950 951 int maxConcurrentConnectionsPerPool() const; 952%Docstring 953The maximum number of concurrent connections per connections pool. 954 955.. note:: 956 957 QGIS may in some situations allocate more than this amount 958 of connections to avoid deadlocks. 959 960.. versionadded:: 3.4 961%End 962 963 static void setTranslation( const QString &translation ); 964%Docstring 965Set translation 966 967.. versionadded:: 3.4 968%End 969 970 void collectTranslatableObjects( QgsTranslationContext *translationContext ); 971%Docstring 972Emits the signal to collect all the strings of .qgs to be included in ts file 973 974.. versionadded:: 3.4 975%End 976 977%If (ANDROID) 978 //dummy method to workaround sip generation issue 979 bool x11EventFilter( XEvent *event ); 980%End 981 982 signals: 983 984 void customVariablesChanged(); 985%Docstring 986Emitted whenever a custom global variable changes. 987 988.. versionadded:: 3.0 989%End 990 991 992 void nullRepresentationChanged(); 993%Docstring 994\copydoc :py:func:`~QgsApplication.nullRepresentation` 995%End 996 997 void requestForTranslatableObjects( QgsTranslationContext *translationContext ); 998%Docstring 999Emitted when project strings which require translation are being collected for inclusion in a .ts file. 1000In order to register translatable strings, connect to this signal and register the strings within the specified ``translationContext``. 1001 1002.. versionadded:: 3.4 1003%End 1004 1005}; 1006 1007 1008/************************************************************************ 1009 * This file has been generated automatically from * 1010 * * 1011 * src/core/qgsapplication.h * 1012 * * 1013 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 1014 ************************************************************************/ 1015