QGIS API Documentation 4.3.0-Master (dc0ce6e99ce)
Loading...
Searching...
No Matches
qgsproject.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsproject.h
3
4 Implements persistent project state.
5
6 -------------------
7 begin : July 23, 2004
8 copyright : (C) 2004 by Mark Coletti
9 email : mcoletti at gmail.com
10 ***************************************************************************/
11
12/***************************************************************************
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 ***************************************************************************/
20
21#ifndef QGSPROJECT_H
22#define QGSPROJECT_H
23
24#include <memory>
25
26#include "qgis.h"
27#include "qgis_core.h"
28#include "qgis_sip.h"
29#include "qgsabstractsensor.h"
30#include "qgsarchive.h"
31#include "qgscolorscheme.h"
37#include "qgsmaplayerstore.h"
40#include "qgsprojectmetadata.h"
41#include "qgsprojectproperty.h"
43#include "qgsprojectversion.h"
45#include "qgsreadwritecontext.h"
46#include "qgsrelationmanager.h"
47#include "qgssettings.h"
48#include "qgssnappingconfig.h"
51
52#include <QFileInfo>
53#include <QHash>
54#include <QList>
55#include <QObject>
56#include <QPair>
57#include <QString>
58#include <QStringList>
59#include <QTranslator>
60
61using namespace Qt::StringLiterals;
62
63class QFileInfo;
64class QDomDocument;
65class QDomElement;
66class QDomNode;
67
70class QgsMapLayer;
71class QgsPathResolver;
74class QgsTolerance;
76class QgsVectorLayer;
80class QgsLayerTree;
83class QgsMapLayer;
99
112
114{
115 Q_OBJECT
117 Q_PROPERTY( QString title READ title WRITE setTitle NOTIFY titleChanged )
118 Q_PROPERTY( QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged )
119 Q_PROPERTY( QString homePath READ homePath WRITE setPresetHomePath NOTIFY homePathChanged )
120 Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs NOTIFY crsChanged )
122 Q_PROPERTY( QString ellipsoid READ ellipsoid WRITE setEllipsoid NOTIFY ellipsoidChanged )
132 Q_PROPERTY( Qgis::DistanceUnit distanceUnits READ distanceUnits WRITE setDistanceUnits NOTIFY distanceUnitsChanged )
133 Q_PROPERTY( Qgis::AreaUnit areaUnits READ areaUnits WRITE setAreaUnits NOTIFY areaUnitsChanged )
135 Q_PROPERTY( Qgis::TransactionMode transactionMode READ transactionMode WRITE setTransactionMode NOTIFY transactionModeChanged )
136 Q_PROPERTY( Qgis::ScaleCalculationMethod scaleMethod READ scaleMethod WRITE setScaleMethod NOTIFY scaleMethodChanged )
137
138 public:
142
143 // *INDENT-OFF*
144
154 {
155 NoProperty = 0,
156 AllProperties = 1,
157 WMSOnlineResource = 2,
158 };
159 // *INDENT-ON*
160
162 static QgsProject *instance() SIP_DISALLOWNONE;
163
172 static void setInstance( QgsProject *project );
173
182 explicit QgsProject( QObject *parent SIP_TRANSFERTHIS = nullptr, Qgis::ProjectCapabilities capabilities = Qgis::ProjectCapability::ProjectStyles );
183
184 ~QgsProject() override;
185
194 void setTitle( const QString &title );
195
202 QString title() const;
203
210 Qgis::ProjectCapabilities capabilities() const { return mCapabilities; }
211
220 Qgis::ProjectFlags flags() const { return mFlags; }
221
230 void setFlags( Qgis::ProjectFlags flags );
231
240 void setFlag( Qgis::ProjectFlag flag, bool enabled = true );
241
249 QString saveUser() const;
250
258 QString saveUserFullName() const;
259
265 QDateTime lastSaveDateTime() const;
266
272 QgsProjectVersion lastSaveVersion() const;
273
277 bool isDirty() const;
278
285 void setFileName( const QString &name );
286
293 QString fileName() const;
294
306 void setOriginalPath( const QString &path );
307
319 QString originalPath() const;
320
331 Q_DECL_DEPRECATED QFileInfo fileInfo() const SIP_DEPRECATED;
332
339 QgsProjectStorage *projectStorage() const;
340
345 QDateTime lastModified() const;
346
352 QString absoluteFilePath() const;
353
359 QString absolutePath() const;
360
365 QString baseName() const;
366
373 Qgis::FilePathType filePathStorage() const;
374
381 void setFilePathStorage( Qgis::FilePathType type );
382
396
415 QgsCoordinateReferenceSystem crs3D() const;
416
431 void setCrs( const QgsCoordinateReferenceSystem &crs, bool adjustEllipsoid = false );
432
440 QString ellipsoid() const;
441
449 void setEllipsoid( const QString &ellipsoid );
450
469 QgsCoordinateReferenceSystem verticalCrs() const;
470
490 bool setVerticalCrs( const QgsCoordinateReferenceSystem &crs, QString *errorMessage SIP_OUT = nullptr );
491
500 QgsCoordinateTransformContext transformContext() const;
501
510 void setTransformContext( const QgsCoordinateTransformContext &context );
511
516 void clear();
517
524 bool read( const QString &filename, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
525
534 bool read( Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
535
545 bool readLayer( const QDomNode &layerNode );
546
554 bool write( const QString &filename );
555
561 bool write();
562
574 bool writeEntry( const QString &scope, const QString &key, bool value ) SIP_PYNAME( writeEntryBool );
575
587 bool writeEntry( const QString &scope, const QString &key, double value ) SIP_PYNAME( writeEntryDouble );
588
599 bool writeEntry( const QString &scope, const QString &key, int value );
600
611 bool writeEntry( const QString &scope, const QString &key, const QString &value );
612
623 bool writeEntry( const QString &scope, const QString &key, const QStringList &value );
624
635 QStringList readListEntry( const QString &scope, const QString &key, const QStringList &def = QStringList(), bool *ok SIP_OUT = nullptr ) const;
636
647 QString readEntry( const QString &scope, const QString &key, const QString &def = QString(), bool *ok SIP_OUT = nullptr ) const;
648
659 int readNumEntry( const QString &scope, const QString &key, int def = 0, bool *ok SIP_OUT = nullptr ) const;
660
671 double readDoubleEntry( const QString &scope, const QString &key, double def = 0, bool *ok SIP_OUT = nullptr ) const;
672
683 bool readBoolEntry( const QString &scope, const QString &key, bool def = false, bool *ok SIP_OUT = nullptr ) const;
684
688 bool removeEntry( const QString &scope, const QString &key );
689
698 QStringList entryList( const QString &scope, const QString &key ) const;
699
708 QStringList subkeyList( const QString &scope, const QString &key ) const;
709
710 // TODO Now slightly broken since re-factoring. Won't print out top-level key
711 // and redundantly prints sub-keys.
712
716 void dumpProperties() const;
717
722 QgsPathResolver pathResolver() const;
723
729 QString writePath( const QString &filename ) const;
730
734 QString readPath( const QString &filename ) const;
735
737 QString error() const;
738
743 void setBadLayerHandler( QgsProjectBadLayerHandler *handler SIP_TRANSFER );
744
750 QString layerIsEmbedded( const QString &id ) const;
751
760 bool createEmbeddedLayer( const QString &layerId, const QString &projectFilePath, QList<QDomNode> &brokenNodes, bool saveFlag = true, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() )
761 SIP_SKIP;
762
769 std::unique_ptr< QgsLayerTreeGroup > createEmbeddedGroup(
770 const QString &groupName, const QString &projectFilePath, const QStringList &invisibleLayers, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags()
771 );
772
774 void setTopologicalEditing( bool enabled );
775
777 bool topologicalEditing() const;
778
784 Qgis::DistanceUnit distanceUnits() const { return mDistanceUnits; }
785
791 void setDistanceUnits( Qgis::DistanceUnit unit );
792
797 Qgis::AreaUnit areaUnits() const { return mAreaUnits; }
798
804 void setAreaUnits( Qgis::AreaUnit unit );
805
813 Qgis::ScaleCalculationMethod scaleMethod() const { return mScaleMethod; }
814
822 void setScaleMethod( Qgis::ScaleCalculationMethod method );
823
836 QString homePath() const;
837
850 QString presetHomePath() const;
851
855 QgsRelationManager *relationManager() const SIP_DISALLOWNONE;
856
862 const QgsLayoutManager *layoutManager() const SIP_SKIP;
863
868 QgsLayoutManager *layoutManager() SIP_DISALLOWNONE;
869
876 const QgsElevationProfileManager *elevationProfileManager() const SIP_SKIP;
877
883 QgsElevationProfileManager *elevationProfileManager() SIP_DISALLOWNONE;
884
891 const QgsSelectiveMaskingSourceSetManager *selectiveMaskingSourceSetManager() const SIP_SKIP;
892
898 QgsSelectiveMaskingSourceSetManager *selectiveMaskingSourceSetManager() SIP_DISALLOWNONE;
899
906 const QgsMapViewsManager *viewsManager() const SIP_SKIP;
907
913 QgsMapViewsManager *viewsManager() SIP_DISALLOWNONE;
914
921 const QgsBookmarkManager *bookmarkManager() const SIP_SKIP;
922
928 QgsBookmarkManager *bookmarkManager() SIP_DISALLOWNONE;
929
936 const QgsSensorManager *sensorManager() const SIP_SKIP;
937
943 QgsSensorManager *sensorManager() SIP_DISALLOWNONE;
944
952 const QgsProjectViewSettings *viewSettings() const SIP_SKIP;
953
961
969 const QgsProjectStyleSettings *styleSettings() const SIP_SKIP;
970
978
986 const QgsProjectTimeSettings *timeSettings() const SIP_SKIP;
987
995
1002 const QgsProjectElevationProperties *elevationProperties() const SIP_SKIP;
1003
1009 QgsProjectElevationProperties *elevationProperties() SIP_DISALLOWNONE;
1010
1017 const QgsProjectDisplaySettings *displaySettings() const SIP_SKIP;
1018
1025
1033
1040
1045
1049 QgsLayerTreeRegistryBridge *layerTreeRegistryBridge() const SIP_DISALLOWNONE { return mLayerTreeRegistryBridge.get(); }
1050
1056
1061
1066
1071 Q_DECL_DEPRECATED void setNonIdentifiableLayers( const QList<QgsMapLayer *> &layers );
1072
1077 Q_DECL_DEPRECATED void setNonIdentifiableLayers( const QStringList &layerIds );
1078
1083 Q_DECL_DEPRECATED QStringList nonIdentifiableLayers() const;
1084
1092 Q_DECL_DEPRECATED bool autoTransaction() const SIP_DEPRECATED;
1093
1103 Q_DECL_DEPRECATED void setAutoTransaction( bool autoTransaction ) SIP_DEPRECATED;
1104
1111 Qgis::TransactionMode transactionMode() const;
1112
1122 bool setTransactionMode( Qgis::TransactionMode transactionMode );
1123
1131 QMap< QPair< QString, QString>, QgsTransactionGroup *> transactionGroups() SIP_SKIP;
1132
1140 QgsTransactionGroup *transactionGroup( const QString &providerKey, const QString &connString );
1141
1148
1154 Q_DECL_DEPRECATED bool evaluateDefaultValues() const SIP_DEPRECATED;
1155
1161 Q_DECL_DEPRECATED void setEvaluateDefaultValues( bool evaluateDefaultValues ) SIP_DEPRECATED;
1162
1165
1171
1177
1184 void setAvoidIntersectionsLayers( const QList<QgsVectorLayer *> &layers );
1185
1191 void setAvoidIntersectionsMode( const Qgis::AvoidIntersectionsMode mode );
1192
1198 Qgis::AvoidIntersectionsMode avoidIntersectionsMode() const { return mAvoidIntersectionsMode; }
1199
1205 QVariantMap customVariables() const;
1206
1211 void setCustomVariables( const QVariantMap &customVariables );
1212
1216 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
1217
1221 const QgsLabelingEngineSettings &labelingEngineSettings() const;
1222
1223 //
1224 // Functionality from QgsMapLayerRegistry
1225 //
1226
1230 QgsMapLayerStore *layerStore() SIP_DISALLOWNONE;
1231
1235 SIP_SKIP const QgsMapLayerStore *layerStore() const;
1236
1238 int count() const;
1239
1241 int validCount() const;
1242
1250 Q_INVOKABLE QgsMapLayer *mapLayer( const QString &layerId ) const;
1251
1252#ifndef SIP_RUN
1253
1269 template<class T> T mapLayer( const QString &layerId ) const { return qobject_cast<T>( mapLayer( layerId ) ); }
1270#endif
1271
1279 Q_INVOKABLE QList<QgsMapLayer *> mapLayersByName( const QString &layerName ) const;
1280
1290 QList<QgsMapLayer *> mapLayersByShortName( const QString &shortName ) const;
1291
1292
1301 QMap<QString, QgsMapLayer *> mapLayers( const bool validOnly = false ) const;
1302
1306 bool isZipped() const;
1307
1308#ifndef SIP_RUN
1309
1320 template<typename T> QVector<T> layers() const { return mLayerStore->layers<T>(); }
1321
1333 template<typename T> QVector<T> mapLayersByShortName( const QString &shortName ) const
1334 {
1335 QVector<T> layers;
1336 const auto constMapLayers { mLayerStore->layers<T>() };
1337 for ( const auto l : constMapLayers )
1338 {
1339 if ( !l->serverProperties()->shortName().isEmpty() )
1340 {
1341 if ( l->serverProperties()->shortName() == shortName )
1342 layers << l;
1343 }
1344 else if ( l->name() == shortName )
1345 {
1346 layers << l;
1347 }
1348 }
1349 return layers;
1350 }
1351
1352#endif
1353
1378 QList<QgsMapLayer *> addMapLayers( const QList<QgsMapLayer *> &mapLayers SIP_TRANSFER, bool addToLegend = true, bool takeOwnership SIP_PYARGREMOVE = true );
1379
1407 QgsMapLayer *addMapLayer( QgsMapLayer *mapLayer SIP_TRANSFER, bool addToLegend = true, bool takeOwnership SIP_PYARGREMOVE = true );
1408
1409#ifndef SIP_RUN
1423 void removeMapLayers( const QStringList &layerIds );
1424
1425 //TODO QGIS 5.0 - add PyName alias to avoid list type conversion error
1426
1440 void removeMapLayers( const QList<QgsMapLayer *> &layers );
1441#else
1442 // clang-format off
1443
1457 void removeMapLayers( SIP_PYOBJECT layers SIP_TYPEHINT( Union[List[QgsVectorLayer], List[str]] ) );
1458 % MethodCode
1459 if ( !PyList_Check( a0 ) )
1460 {
1461 sipIsErr = 1;
1462 PyErr_SetString( PyExc_TypeError, "Expected a list of layers or layers IDs" );
1463 }
1464 else if ( PyList_GET_SIZE( a0 ) )
1465 {
1466 PyObject *firstLayerPyObj = PyList_GetItem( a0, 0 );
1467 if ( firstLayerPyObj )
1468 {
1469 int state;
1470 if ( sipCanConvertToType( firstLayerPyObj, sipType_QgsMapLayer, SIP_NOT_NONE ) )
1471 {
1472 const sipTypeDef *qlist_type = sipFindType( "QList<QgsMapLayer *>" );
1473 QList<QgsMapLayer *> *layersList = reinterpret_cast<QList<QgsMapLayer *> *>( sipConvertToType( a0, qlist_type, 0, SIP_NOT_NONE, &state, &sipIsErr ) );
1474 if ( !sipIsErr )
1475 {
1476 sipCpp->removeMapLayers( *layersList );
1477 }
1478 sipReleaseType( layersList, qlist_type, state );
1479 }
1480 else if ( sipCanConvertToType( firstLayerPyObj, sipType_QString, SIP_NOT_NONE ) )
1481 {
1482 QStringList *layersId = reinterpret_cast<QStringList *>( sipConvertToType( a0, sipType_QStringList, 0, SIP_NOT_NONE, &state, &sipIsErr ) );
1483 if ( !sipIsErr )
1484 {
1485 sipCpp->removeMapLayers( *layersId );
1486 }
1487 sipReleaseType( layersId, sipType_QStringList, state );
1488 }
1489 else
1490 {
1491 sipIsErr = 1;
1492 PyErr_SetString( PyExc_TypeError, "Expected a list of layers or layers IDs" );
1493 }
1494 }
1495 }
1496 % End
1497// clang-format on
1498#endif
1499
1513 void removeMapLayer( const QString &layerId );
1514
1528 void removeMapLayer( QgsMapLayer *layer );
1529
1536 QgsMapLayer *takeMapLayer( QgsMapLayer *layer ) SIP_TRANSFERBACK;
1537
1549 QgsAnnotationLayer *mainAnnotationLayer() SIP_DISALLOWNONE;
1550
1561 void removeAllMapLayers();
1562
1568 void reloadAllLayers();
1569
1574 QgsCoordinateReferenceSystem defaultCrsForNewLayers() const;
1575
1587 Q_DECL_DEPRECATED void setTrustLayerMetadata( bool trust ) SIP_DEPRECATED;
1588
1599 Q_DECL_DEPRECATED bool trustLayerMetadata() const SIP_DEPRECATED;
1600
1605 const QgsAuxiliaryStorage *auxiliaryStorage() const SIP_SKIP;
1606
1611 QgsAuxiliaryStorage *auxiliaryStorage() SIP_DISALLOWNONE;
1612
1621 QString createAttachedFile( const QString &nameTemplate );
1622
1629 QStringList attachedFiles() const;
1630
1638 bool removeAttachedFile( const QString &path );
1639
1648 QString attachmentIdentifier( const QString &attachedFile ) const;
1649
1656 QString resolveAttachmentIdentifier( const QString &identifier ) const;
1657
1664 const QgsProjectMetadata &metadata() const;
1665
1672 void setMetadata( const QgsProjectMetadata &metadata );
1673
1682 Q_DECL_DEPRECATED QSet<QgsMapLayer *> requiredLayers() const;
1683
1692 Q_DECL_DEPRECATED void setRequiredLayers( const QSet<QgsMapLayer *> &layers );
1693
1700 void setProjectColors( const QgsNamedColorList &colors );
1701
1708 void setBackgroundColor( const QColor &color );
1709
1716 QColor backgroundColor() const;
1717
1724 void setSelectionColor( const QColor &color );
1725
1732 QColor selectionColor() const;
1733
1745 Q_DECL_DEPRECATED void setMapScales( const QVector<double> &scales ) SIP_DEPRECATED;
1746
1758 Q_DECL_DEPRECATED QVector<double> mapScales() const SIP_DEPRECATED;
1759
1768 Q_DECL_DEPRECATED void setUseProjectScales( bool enabled ) SIP_DEPRECATED;
1769
1778 Q_DECL_DEPRECATED bool useProjectScales() const SIP_DEPRECATED;
1779
1784 void generateTsFile( const QString &locale );
1785
1786 QString translate( const QString &context, const QString &sourceText, const char *disambiguation = nullptr, int n = -1 ) const override;
1787
1797 bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
1798
1808 bool accept( QgsObjectEntityVisitorInterface *visitor, const QgsObjectVisitorContext &context ) const;
1809
1815 QgsElevationShadingRenderer elevationShadingRenderer() const;
1816
1822 void setElevationShadingRenderer( const QgsElevationShadingRenderer &elevationShadingRenderer );
1823
1832 bool loadFunctionsFromProject( bool force = false ) SIP_SKIP;
1833
1841 void cleanFunctionsFromProject() SIP_SKIP;
1842
1843#ifdef SIP_RUN
1844 // clang-format off
1845 SIP_PYOBJECT __repr__();
1846 % MethodCode
1847 QString str = u"<QgsProject: '%1'%2>"_s.arg( sipCpp->fileName(),
1848 sipCpp == QgsProject::instance() ? u" (singleton instance)"_s : QString() ); // skip-keyword-check
1849 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
1850 % End
1851// clang-format on
1852#endif
1853
1854 signals :
1855
1863 void cleared();
1864
1872
1876 void readProject( const QDomDocument &document );
1877
1881 void readProjectWithContext( const QDomDocument &document, QgsReadWriteContext &context );
1882
1886 void writeProject( QDomDocument &document );
1887
1896 void readMapLayer( QgsMapLayer *mapLayer, const QDomElement &layerNode );
1897
1906 void writeMapLayer( QgsMapLayer *mapLayer, QDomElement &layerElem, QDomDocument &doc );
1907
1912
1918 Q_DECL_DEPRECATED void oldProjectVersionWarning( const QString &warning ) SIP_DEPRECATED;
1919
1930 void readVersionMismatchOccurred( const QString &fileVersion );
1931
1937 void layerLoaded( int i, int n );
1938
1940 void loadingLayer( const QString &layerName );
1941
1948 void loadingLayerMessageReceived( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
1949
1954 Q_DECL_DEPRECATED void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );
1955
1961
1964
1972
1977
1984
1989
1999
2011
2028
2035 void ellipsoidChanged( const QString &ellipsoid );
2036
2044
2052
2061
2068
2072 void missingDatumTransforms( const QStringList &missingTransforms );
2073
2079
2086
2092
2098
2110
2115
2123
2131
2139
2147
2148 //
2149 // signals from QgsMapLayerRegistry
2150 //
2151
2159 void layersWillBeRemoved( const QStringList &layerIds );
2160
2168 void layersWillBeRemoved( const QList<QgsMapLayer *> &layers );
2169
2179 void layerWillBeRemoved( const QString &layerId );
2180
2191
2198 void layersRemoved( const QStringList &layerIds );
2199
2208 void layerRemoved( const QString &layerId );
2209
2210 //TODO QGIS 5.0 - rename to past tense
2211
2219
2230 void layersAdded( const QList<QgsMapLayer *> &layers );
2231
2239
2251 void legendLayersAdded( const QList<QgsMapLayer *> &layers );
2252
2261 void layersAddedWithoutLegend( const QList<QgsMapLayer *> &layers );
2262
2270 void isDirtyChanged( bool dirty );
2271
2279 void dirtySet();
2280
2289 Q_DECL_DEPRECATED void mapScalesChanged() SIP_DEPRECATED;
2290
2297
2298 public slots:
2299
2305
2306 // TODO QGIS 5.0 - rename b to dirty
2307
2314 void setDirty( bool b = true );
2315
2324 void setPresetHomePath( const QString &path );
2325
2335 void registerTranslatableContainers( QgsTranslationContext *translationContext, QgsAttributeEditorContainer *parent, const QString &layerId );
2336
2343 void registerTranslatableObjects( QgsTranslationContext *translationContext );
2344
2351 void setDataDefinedServerProperties( const QgsPropertyCollection &properties );
2352
2360
2377 bool startEditing( QgsVectorLayer *vectorLayer = nullptr );
2378
2408 bool commitChanges( QStringList &commitErrors SIP_OUT, bool stopEditing = true, QgsVectorLayer *vectorLayer = nullptr );
2409
2426 bool rollBack( QStringList &rollbackErrors SIP_OUT, bool stopEditing = true, QgsVectorLayer *vectorLayer = nullptr );
2427
2428 private slots:
2429 void onMapLayersAdded( const QList<QgsMapLayer *> &layers );
2430 void onMapLayersRemoved( const QList<QgsMapLayer *> &layers );
2431 void cleanTransactionGroups( bool force = false );
2432 void updateTransactionGroups();
2433
2434 private:
2435 static QgsProject *sProject;
2436
2437
2446 bool _getMapLayers( const QDomDocument &doc, QList<QDomNode> &brokenNodes, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
2447
2452 void setError( const QString &errorMessage ) SIP_SKIP;
2453
2458 void clearError() SIP_SKIP;
2459
2469 bool addLayer( const QDomElement &layerElem, QList<QDomNode> &brokenNodes, QgsReadWriteContext &context, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags(), QgsDataProvider *provider = nullptr )
2470 SIP_SKIP;
2471
2475 void removeAuxiliaryLayer( const QgsMapLayer *ml );
2476
2482 void initializeEmbeddedSubtree( const QString &projectFilePath, QgsLayerTreeGroup *group, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() ) SIP_SKIP;
2483
2488 bool loadEmbeddedNodes( QgsLayerTreeGroup *group, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() ) SIP_SKIP;
2489
2491 bool readProjectFile( const QString &filename, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
2492
2494 bool writeProjectFile( const QString &filename );
2495
2497 bool unzip( const QString &filename, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
2498
2500 bool zip( const QString &filename );
2501
2503 bool saveAuxiliaryStorage( const QString &filename = QString() );
2504
2506 void loadProjectFlags( const QDomDocument *doc );
2507
2509 static QgsPropertiesDefinition &dataDefinedServerPropertyDefinitions();
2510
2512 void preloadProviders(
2513 const QVector<QDomNode> &asynchronusLayerNodes, const QgsReadWriteContext &context, QMap<QString, QgsDataProvider *> &loadedProviders, QgsMapLayer::ReadFlags layerReadFlags, int totalProviderCount
2514 );
2515
2520 void releaseHandlesToProjectArchive();
2521
2522 bool rebuildCrs3D( QString *error = nullptr );
2523
2524 Qgis::ProjectCapabilities mCapabilities;
2525
2526 std::unique_ptr< QgsMapLayerStore > mLayerStore;
2527
2528 QString mErrorMessage;
2529
2530 std::unique_ptr<QgsProjectBadLayerHandler> mBadLayerHandler;
2531
2537 QHash< QString, QPair< QString, bool> > mEmbeddedLayers;
2538
2539 QgsSnappingConfig mSnappingConfig;
2540 Qgis::AvoidIntersectionsMode mAvoidIntersectionsMode = Qgis::AvoidIntersectionsMode::AllowIntersections;
2541
2542 std::unique_ptr<QgsRelationManager> mRelationManager;
2543
2544 std::unique_ptr<QgsAnnotationManager> mAnnotationManager;
2545 std::unique_ptr<QgsLayoutManager> mLayoutManager;
2546 std::unique_ptr<QgsElevationProfileManager> mElevationProfileManager;
2547 std::unique_ptr<QgsSelectiveMaskingSourceSetManager> mSelectiveMaskingSourceSetManager;
2548 std::unique_ptr<QgsMapViewsManager> m3DViewsManager;
2549
2550 QgsBookmarkManager *mBookmarkManager = nullptr;
2551
2552 QgsSensorManager *mSensorManager = nullptr;
2553
2554 QgsProjectViewSettings *mViewSettings = nullptr;
2555
2556 QgsProjectStyleSettings *mStyleSettings = nullptr;
2557
2558 QgsProjectTimeSettings *mTimeSettings = nullptr;
2559
2560 QgsProjectElevationProperties *mElevationProperties = nullptr;
2561
2562 QgsProjectDisplaySettings *mDisplaySettings = nullptr;
2563
2564 QgsProjectGpsSettings *mGpsSettings = nullptr;
2565
2566 std::unique_ptr<QgsLayerTree> mRootGroup;
2567
2568 std::unique_ptr<QgsLayerTreeRegistryBridge> mLayerTreeRegistryBridge;
2569
2570 QgsAnnotationLayer *mMainAnnotationLayer = nullptr;
2571
2573 QMap< QPair< QString, QString>, QgsTransactionGroup *> mTransactionGroups;
2574
2575 QgsVectorLayerEditBufferGroup mEditBufferGroup;
2576
2577 std::unique_ptr<QgsMapThemeCollection> mMapThemeCollection;
2578
2579 std::unique_ptr<QgsLabelingEngineSettings> mLabelingEngineSettings;
2580
2581 QVariantMap mCustomVariables;
2582
2583 std::unique_ptr<QgsArchive> mArchive;
2584
2585 std::unique_ptr<QgsAuxiliaryStorage> mAuxiliaryStorage;
2586
2587 QFile mFile; // current physical project file
2588
2589 QString mOriginalPath;
2590
2591 QString mSaveUser; // last saved user.
2592 QString mSaveUserFull; // last saved user full name.
2593 QDateTime mSaveDateTime;
2594 QgsProjectVersion mSaveVersion;
2595
2600 QString mHomePath;
2601 mutable QString mCachedHomePath;
2602
2603 QColor mBackgroundColor;
2604 QColor mSelectionColor;
2605
2606 Qgis::DistanceUnit mDistanceUnits = Qgis::DistanceUnit::Meters;
2607 Qgis::AreaUnit mAreaUnits = Qgis::AreaUnit::SquareMeters;
2608 Qgis::ScaleCalculationMethod mScaleMethod = Qgis::ScaleCalculationMethod::HorizontalMiddle;
2609
2610 mutable QgsProjectPropertyKey mProperties; // property hierarchy, TODO: this shouldn't be mutable
2611 Qgis::TransactionMode mTransactionMode = Qgis::TransactionMode::Disabled; // transaction grouped editing
2612
2613 Qgis::ProjectFlags mFlags;
2615 QgsCoordinateReferenceSystem mVerticalCrs;
2617
2618 bool mDirty = false; // project has been modified since it has been read or saved
2619 int mDirtyBlockCount = 0;
2620
2621 QgsPropertyCollection mDataDefinedServerProperties;
2622
2623 QgsCoordinateTransformContext mTransformContext;
2624
2625 QgsProjectMetadata mMetadata;
2626
2627 std::unique_ptr< QTranslator > mTranslator;
2628
2629 bool mIsBeingDeleted = false;
2630
2631 QgsSettings mSettings;
2632
2633 mutable std::unique_ptr< QgsExpressionContextScope > mProjectScope;
2634
2635 bool mBlockChangeSignalsDuringClear = false;
2636 bool mBlockEllipsoidChangedSignal = false;
2637 int mBlockSnappingUpdates = 0;
2638
2639 QgsElevationShadingRenderer mElevationShadingRenderer;
2640
2641 friend class QgsApplication;
2642
2644
2645 // Required to avoid creating a new project in it's destructor
2647
2648 // Required by QGIS Server for switching the current project instance
2649 friend class QgsServer;
2650
2651 friend class TestQgsProject;
2652
2653 Q_DISABLE_COPY( QgsProject )
2654};
2655
2677class CORE_EXPORT QgsProjectDirtyBlocker
2678{
2679 public:
2686 : mProject( project )
2687 {
2688 mProject->mDirtyBlockCount++;
2689 }
2690
2693
2694 ~QgsProjectDirtyBlocker() { mProject->mDirtyBlockCount--; }
2695
2696 private:
2697 QgsProject *mProject = nullptr;
2698
2699#ifdef SIP_RUN
2701#endif
2702};
2703
2709CORE_EXPORT QgsProjectVersion getVersion( QDomDocument const &doc ) SIP_SKIP;
2710
2711
2713#ifndef SIP_RUN
2714class GetNamedProjectColor : public QgsScopedExpressionFunction
2715{
2716 public:
2717 GetNamedProjectColor( const QgsProject *project );
2718
2723 GetNamedProjectColor( const QHash< QString, QColor > &colors );
2724
2725 QVariant func( const QVariantList &values, const QgsExpressionContext *, QgsExpression *, const QgsExpressionNodeFunction * ) override;
2726 QgsScopedExpressionFunction *clone() const override;
2727
2728 private:
2729 QHash< QString, QColor > mColors;
2730};
2731
2732class GetNamedProjectColorObject : public QgsScopedExpressionFunction
2733{
2734 public:
2735 GetNamedProjectColorObject( const QgsProject *project );
2736
2741 GetNamedProjectColorObject( const QHash< QString, QColor > &colors );
2742
2743 QVariant func( const QVariantList &values, const QgsExpressionContext *, QgsExpression *, const QgsExpressionNodeFunction * ) override;
2744 QgsScopedExpressionFunction *clone() const override;
2745
2746 private:
2747 QHash< QString, QColor > mColors;
2748};
2749
2750
2751class GetSensorData : public QgsScopedExpressionFunction
2752{
2753 public:
2754 GetSensorData( const QMap<QString, QgsAbstractSensor::SensorData> &sensorData = QMap<QString, QgsAbstractSensor::SensorData>() );
2755 QVariant func( const QVariantList &values, const QgsExpressionContext *, QgsExpression *, const QgsExpressionNodeFunction * ) override;
2756 QgsScopedExpressionFunction *clone() const override;
2757
2758 private:
2759 QMap<QString, QgsAbstractSensor::SensorData> mSensorData;
2760};
2761#endif
2763
2764#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:62
DistanceUnit
Units of distance.
Definition qgis.h:5512
AreaUnit
Units of area.
Definition qgis.h:5589
ProjectFlag
Flags which control the behavior of QgsProjects.
Definition qgis.h:4322
ScaleCalculationMethod
Scale calculation logic.
Definition qgis.h:5789
QFlags< ProjectFlag > ProjectFlags
Definition qgis.h:4330
Represents a map layer containing a set of georeferenced annotations, e.g.
Manages storage of a set of QgsAnnotation annotation objects.
Manages zip/unzip operations for an archive.
Definition qgsarchive.h:36
A container for attribute editors, used to group them visually in the attribute form if it is set to ...
Providing some utility methods to manage auxiliary storage.
Manages storage of a set of bookmarks.
Represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Abstract base class for spatial data provider implementations.
Manages storage of a set of elevation profiles.
Renders elevation shading on an image with different methods (eye dome lighting, hillshading,...
Abstract interface for generating an expression context.
Abstract interface for generating an expression context scope.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Stores global configuration for labeling engine.
Layer tree group node serves as a container for layers and further groups.
Listens to layer changes from a QgsProject and applies changes to a QgsLayerTree.
Namespace with helper functions for layer tree operations.
Manages storage of a set of layouts.
A storage object for map layers, in which the layers are owned by the store and have their lifetime b...
Base class for all map layer types.
Definition qgsmaplayer.h:83
Container class that allows storage of map themes consisting of visible map layers and layer styles.
Manages storage of a set of views.
An interface for classes which can visit various object entity (e.g.
A QgsObjectEntityVisitorInterface context object.
Resolves relative paths into absolute paths and vice versa.
Interface for classes that handle missing layer files when reading project files.
Temporarily blocks QgsProject "dirtying" for the lifetime of the object.
QgsProjectDirtyBlocker & operator=(const QgsProjectDirtyBlocker &other)=delete
QgsProjectDirtyBlocker(QgsProject *project)
Constructor for QgsProjectDirtyBlocker.
QgsProjectDirtyBlocker(const QgsProjectDirtyBlocker &other)=delete
Contains settings and properties relating to how a QgsProject should display values such as map coord...
Contains elevation properties for a QgsProject.
Contains settings and properties relating to how a QgsProject should interact with a GPS device.
A structured metadata store for a project.
Project property key node.
Abstract interface for project storage - to be implemented by various backends and registered in QgsP...
Contains settings and properties relating to how a QgsProject should handle styling.
Contains temporal settings and properties for the project, this may be used when animating maps or sh...
An interface for objects which can translate project strings.
Describes the version of a project.
Contains settings and properties relating to how a QgsProject should be displayed inside map canvas,...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114
QgsRelationManager * relationManager
Definition qgsproject.h:125
QgsProject(QObject *parent=nullptr, Qgis::ProjectCapabilities capabilities=Qgis::ProjectCapability::ProjectStyles)
Create a new QgsProject.
Q_DECL_DEPRECATED void oldProjectVersionWarning(const QString &warning)
Emitted when an old project file is read.
Q_DECL_DEPRECATED bool evaluateDefaultValues() const
Should default values be evaluated on provider side when requested and not when committed.
Qgis::DistanceUnit distanceUnits
Definition qgsproject.h:132
void layersAddedWithoutLegend(const QList< QgsMapLayer * > &layers)
Emitted when layers were added to the registry without adding to the legend.
void layersRemoved(const QStringList &layerIds)
Emitted after one or more layers were removed from the registry.
QString error() const
Returns error message from previous read/write.
void readProjectWithContext(const QDomDocument &document, QgsReadWriteContext &context)
Emitted when a project is being read.
Q_DECL_DEPRECATED void setNonIdentifiableLayers(const QList< QgsMapLayer * > &layers)
Set a list of layers which should not be taken into account on map identification.
Qgis::ProjectFlags flags() const
Returns the project's flags, which dictate the behavior of the project.
Definition qgsproject.h:220
void setBackgroundColor(const QColor &color)
Sets the default background color used by default map canvases.
void setCrs(const QgsCoordinateReferenceSystem &crs, bool adjustEllipsoid=false)
Sets the project's native coordinate reference system.
QColor selectionColor
Definition qgsproject.h:130
bool commitChanges(QStringList &commitErrors, bool stopEditing=true, QgsVectorLayer *vectorLayer=nullptr)
Attempts to commit to the underlying data provider any buffered changes made since the last to call t...
void mapThemeCollectionChanged()
Emitted when the map theme collection changes.
static QgsProject * instance()
Returns the QgsProject singleton instance.
Q_DECL_DEPRECATED void mapScalesChanged()
Emitted when the list of custom project map scales changes.
void readVersionMismatchOccurred(const QString &fileVersion)
Emitted when a project is read and the version of QGIS used to save the project differs from the curr...
QString ellipsoid
Definition qgsproject.h:122
void fileNameChanged()
Emitted when the file name of the project changes.
friend class QgsProviderRegistry
void titleChanged()
Emitted when the title of the project changes.
Q_INVOKABLE QgsMapLayer * mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layer ID.
QString title
Definition qgsproject.h:117
void writeMapLayer(QgsMapLayer *mapLayer, QDomElement &layerElem, QDomDocument &doc)
Emitted when a layer is being saved.
void setSnappingConfig(const QgsSnappingConfig &snappingConfig)
The snapping configuration for this project.
void areaUnitsChanged()
Emitted when the default area units changes.
QgsPropertyCollection dataDefinedServerProperties() const
Returns the data defined properties used for overrides in user defined server parameters.
Q_DECL_DEPRECATED void nonIdentifiableLayersChanged(QStringList nonIdentifiableLayers)
Emitted when the list of layer which are excluded from map identification changes.
void layersWillBeRemoved(const QStringList &layerIds)
Emitted when one or more layers are about to be removed from the registry.
void setScaleMethod(Qgis::ScaleCalculationMethod method)
Sets the method to use for map scale calculations for the project.
QgsVectorLayerEditBufferGroup * editBufferGroup()
Returns the edit buffer group.
void setSelectionColor(const QColor &color)
Sets the color used to highlight selected features.
bool rollBack(QStringList &rollbackErrors, bool stopEditing=true, QgsVectorLayer *vectorLayer=nullptr)
Stops a current editing operation on vectorLayer and discards any uncommitted edits.
void snappingConfigChanged(const QgsSnappingConfig &config)
Emitted whenever the configuration for snapping has changed.
Q_DECL_DEPRECATED void setEvaluateDefaultValues(bool evaluateDefaultValues)
Defines if default values should be evaluated on provider side when requested and not when committed.
void layerWasAdded(QgsMapLayer *layer)
Emitted when a layer was added to the registry.
Qgis::AreaUnit areaUnits
Definition qgsproject.h:133
void crsChanged()
Emitted when the crs() of the project has changed.
Qgis::AreaUnit areaUnits() const
Convenience function to query default area measurement units for project.
Definition qgsproject.h:797
QgsSnappingConfig snappingConfig
Definition qgsproject.h:124
const QgsProjectGpsSettings * gpsSettings() const
Returns the project's GPS settings, which contains settings and properties relating to how a QgsProje...
void setFileName(const QString &name)
Sets the file name associated with the project.
void avoidIntersectionsLayersChanged()
Emitted whenever avoidIntersectionsLayers has changed.
void setDataDefinedServerProperties(const QgsPropertyCollection &properties)
Sets the data defined properties used for overrides in user defined server parameters to properties.
void registerTranslatableObjects(QgsTranslationContext *translationContext)
Registers the objects that require translation into the translationContext.
void layerWillBeRemoved(const QString &layerId)
Emitted when a layer is about to be removed from the registry.
void distanceUnitsChanged()
Emitted when the default distance units changes.
friend class QgsServer
void readMapLayer(QgsMapLayer *mapLayer, const QDomElement &layerNode)
Emitted after the basic initialization of a layer from the project file is done.
Q_DECL_DEPRECATED void setAutoTransaction(bool autoTransaction)
Transactional editing means that on supported datasources (postgres databases) the edit state of all ...
DataDefinedServerProperty
Data defined properties.
Definition qgsproject.h:154
bool startEditing(QgsVectorLayer *vectorLayer=nullptr)
Makes the layer editable.
void aboutToBeCleared()
Emitted when the project is about to be cleared.
void cleared()
Emitted when the project is cleared (and additionally when an open project is cleared just before a n...
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
void metadataChanged()
Emitted when the project's metadata is changed.
QgsLayerTreeRegistryBridge * layerTreeRegistryBridge() const
Returns pointer to the helper class that synchronizes map layer registry with layer tree.
void crs3DChanged()
Emitted when the crs3D() of the project has changed.
void scaleMethodChanged()
Emitted when the project's scale method is changed.
friend class QgsApplication
QList< QgsVectorLayer * > avoidIntersectionsLayers
Definition qgsproject.h:127
QgsExpressionContextScope * createExpressionContextScope() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
void ellipsoidChanged(const QString &ellipsoid)
Emitted when the project ellipsoid is changed.
QgsMapThemeCollection * mapThemeCollection
Definition qgsproject.h:123
Qgis::TransactionMode transactionMode
Definition qgsproject.h:135
QgsAnnotationManager * annotationManager()
Returns pointer to the project's annotation manager.
QgsProjectDisplaySettings * displaySettings
Definition qgsproject.h:134
QgsProjectMetadata metadata
Definition qgsproject.h:128
void projectColorsChanged()
Emitted whenever the project's color scheme has been changed.
QVector< T > layers() const
Returns a list of registered map layers with a specified layer type.
bool setTransactionMode(Qgis::TransactionMode transactionMode)
Set transaction mode.
QgsCoordinateTransformContext transformContext
Definition qgsproject.h:121
void transactionModeChanged()
Emitted when the transaction mode has changed.
void labelingEngineSettingsChanged()
Emitted when global configuration of the labeling engine changes.
void customVariablesChanged()
Emitted whenever the expression variables stored in the project have been changed.
QgsLayerTree * layerTreeRoot() const
Returns pointer to the root (invisible) node of the project's layer tree.
void elevationShadingRendererChanged()
Emitted when the map shading renderer changes.
QString fileName
Definition qgsproject.h:118
Q_DECL_DEPRECATED bool autoTransaction() const
Transactional editing means that on supported datasources (postgres databases) the edit state of all ...
void setMetadata(const QgsProjectMetadata &metadata)
Sets the project's metadata store.
T mapLayer(const QString &layerId) const
Retrieve a pointer to a registered layer by layerId converted to type T.
QgsMapThemeCollection * mapThemeCollection()
Returns pointer to the project's map theme collection.
void missingDatumTransforms(const QStringList &missingTransforms)
Emitted when datum transforms stored in the project are not available locally.
QgsTransactionGroup * transactionGroup(const QString &providerKey, const QString &connString)
Returns the matching transaction group from a provider key and connection string.
QgsCoordinateReferenceSystem crs
Definition qgsproject.h:120
QStringList nonIdentifiableLayers
Definition qgsproject.h:116
void setAvoidIntersectionsMode(const Qgis::AvoidIntersectionsMode mode)
Sets the avoid intersections mode.
void layerWillBeRemoved(QgsMapLayer *layer)
Emitted when a layer is about to be removed from the registry.
void transactionGroupsChanged()
Emitted whenever a new transaction group has been created or a transaction group has been removed.
void loadingLayerMessageReceived(const QString &layerName, const QList< QgsReadWriteContext::ReadWriteMessage > &messages)
Emitted when loading layers has produced some messages.
QVector< T > mapLayersByShortName(const QString &shortName) const
Retrieves a list of matching registered layers by layer shortName with a specified layer type,...
Qgis::ScaleCalculationMethod scaleMethod() const
Returns the method to use for map scale calculations for the project.
Definition qgsproject.h:813
void setAreaUnits(Qgis::AreaUnit unit)
Sets the default area measurement units for the project.
void setTitle(const QString &title)
Sets the project's title.
QMap< QPair< QString, QString >, QgsTransactionGroup * > transactionGroups()
Map of transaction groups.
static const QgsSettingsEntryBool * settingsAnonymizeSavedProjects
Definition qgsproject.h:140
Qgis::ProjectCapabilities capabilities() const
Returns the project's capabilities, which dictate optional functionality which can be selectively ena...
Definition qgsproject.h:210
void projectSaved()
Emitted when the project file has been written and closed.
void layersWillBeRemoved(const QList< QgsMapLayer * > &layers)
Emitted when one or more layers are about to be removed from the registry.
void setEllipsoid(const QString &ellipsoid)
Sets the project's ellipsoid from a proj string representation, e.g., "WGS84".
void readProject(const QDomDocument &document)
Emitted when a project is being read.
void setTransformContext(const QgsCoordinateTransformContext &context)
Sets the project's coordinate transform context, which stores various information regarding which dat...
QColor backgroundColor
Definition qgsproject.h:129
void layerLoaded(int i, int n)
Emitted when a layer from a projects was read.
static const QgsSettingsEntryBool * settingsAnonymizeNewProjects
Definition qgsproject.h:139
void selectionColorChanged()
Emitted whenever the project's selection color has been changed.
bool topologicalEditing
Definition qgsproject.h:131
void removeAll()
Emitted when all layers are removed, before layersWillBeRemoved() and layerWillBeRemoved() signals ar...
void setDirty(bool b=true)
Flag the project as dirty (modified).
void backgroundColorChanged()
Emitted whenever the project's canvas background color has been changed.
void registerTranslatableContainers(QgsTranslationContext *translationContext, QgsAttributeEditorContainer *parent, const QString &layerId)
Registers the containers that require translation into the translationContext.
Qgis::ScaleCalculationMethod scaleMethod
Definition qgsproject.h:136
void transformContextChanged()
Emitted when the project transformContext() is changed.
void setTopologicalEditing(bool enabled)
Convenience function to set topological editing.
Qgis::AvoidIntersectionsMode avoidIntersectionsMode
Definition qgsproject.h:126
void legendLayersAdded(const QList< QgsMapLayer * > &layers)
Emitted when layers were added to the registry and the legend.
void setAvoidIntersectionsLayers(const QList< QgsVectorLayer * > &layers)
Sets the list of layers with which intersections should be avoided.
void layerRemoved(const QString &layerId)
Emitted after a layer was removed from the registry.
friend class TestQgsProject
void homePathChanged()
Emitted when the home path of the project changes.
void dirtySet()
Emitted when setDirty(true) is called.
friend class QgsProjectDirtyBlocker
void writeProject(QDomDocument &document)
Emitted when the project is being written.
void layersAdded(const QList< QgsMapLayer * > &layers)
Emitted when one or more layers were added to the registry.
QString homePath
Definition qgsproject.h:119
void isDirtyChanged(bool dirty)
Emitted when the project dirty status changes.
void setDistanceUnits(Qgis::DistanceUnit unit)
Sets the default distance measurement units for the project.
void setPresetHomePath(const QString &path)
Sets the project's home path.
void verticalCrsChanged()
Emitted when the verticalCrs() of the project has changed.
void topologicalEditingChanged()
Emitted when the topological editing flag has changed.
static const QgsSettingsEntryBool * settingsDefaultProjectPathsRelative
Definition qgsproject.h:141
void avoidIntersectionsModeChanged()
Emitted whenever the avoid intersections mode has changed.
void loadingLayer(const QString &layerName)
Emitted when a layer is loaded.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A container for the context for various read/write operations on objects.
Manages a set of relations between layers.
Manages storage of a set of selective masking source sets.
Manages sensors.
A boolean settings entry.
Stores settings for use within QGIS.
Definition qgssettings.h:68
Stores configuration of snapping settings for the project.
Provides calculations for tolerance values in map units.
Represents a transaction group.
Used for the collecting of strings from projects for translation and creation of ts files.
The edit buffer group manages a group of edit buffers.
Represents a vector layer which manages a vector based dataset.
QList< QPair< QColor, QString > > QgsNamedColorList
List of colors paired with a friendly display name identifying the color.
#define SIP_TYPEHINT(type)
Definition qgis_sip.h:242
#define SIP_DEPRECATED
Definition qgis_sip.h:113
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_DISALLOWNONE
Definition qgis_sip.h:133
#define SIP_SKIP
Definition qgis_sip.h:138
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition qgis_sip.h:270
#define SIP_PYNAME(name)
Definition qgis_sip.h:88
#define SIP_PYARGREMOVE
Definition qgis_sip.h:163
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_OUT
Definition qgis_sip.h:57
#define SIP_TRANSFERBACK
Definition qgis_sip.h:47
QgsProjectVersion getVersion(const QDomDocument &doc)
Returns the version string found in the given DOM document.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.