QGIS API Documentation 4.1.0-Master (60fea48833c)
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;
98
111
113{
114 Q_OBJECT
116 Q_PROPERTY( QString title READ title WRITE setTitle NOTIFY titleChanged )
117 Q_PROPERTY( QString fileName READ fileName WRITE setFileName NOTIFY fileNameChanged )
118 Q_PROPERTY( QString homePath READ homePath WRITE setPresetHomePath NOTIFY homePathChanged )
119 Q_PROPERTY( QgsCoordinateReferenceSystem crs READ crs WRITE setCrs NOTIFY crsChanged )
121 Q_PROPERTY( QString ellipsoid READ ellipsoid WRITE setEllipsoid NOTIFY ellipsoidChanged )
131 Q_PROPERTY( Qgis::DistanceUnit distanceUnits READ distanceUnits WRITE setDistanceUnits NOTIFY distanceUnitsChanged )
132 Q_PROPERTY( Qgis::AreaUnit areaUnits READ areaUnits WRITE setAreaUnits NOTIFY areaUnitsChanged )
134 Q_PROPERTY( Qgis::TransactionMode transactionMode READ transactionMode WRITE setTransactionMode NOTIFY transactionModeChanged )
135 Q_PROPERTY( Qgis::ScaleCalculationMethod scaleMethod READ scaleMethod WRITE setScaleMethod NOTIFY scaleMethodChanged )
136
137 public:
138 // *INDENT-OFF*
139
149 {
150 NoProperty = 0,
151 AllProperties = 1,
152 WMSOnlineResource = 2,
153 };
154 // *INDENT-ON*
155
157 static QgsProject *instance();
158
167 static void setInstance( QgsProject *project );
168
177 explicit QgsProject( QObject *parent SIP_TRANSFERTHIS = nullptr, Qgis::ProjectCapabilities capabilities = Qgis::ProjectCapability::ProjectStyles );
178
179 ~QgsProject() override;
180
189 void setTitle( const QString &title );
190
197 QString title() const;
198
205 Qgis::ProjectCapabilities capabilities() const { return mCapabilities; }
206
215 Qgis::ProjectFlags flags() const { return mFlags; }
216
225 void setFlags( Qgis::ProjectFlags flags );
226
235 void setFlag( Qgis::ProjectFlag flag, bool enabled = true );
236
244 QString saveUser() const;
245
253 QString saveUserFullName() const;
254
260 QDateTime lastSaveDateTime() const;
261
267 QgsProjectVersion lastSaveVersion() const;
268
272 bool isDirty() const;
273
280 void setFileName( const QString &name );
281
288 QString fileName() const;
289
301 void setOriginalPath( const QString &path );
302
314 QString originalPath() const;
315
326 Q_DECL_DEPRECATED QFileInfo fileInfo() const SIP_DEPRECATED;
327
334 QgsProjectStorage *projectStorage() const;
335
340 QDateTime lastModified() const;
341
347 QString absoluteFilePath() const;
348
354 QString absolutePath() const;
355
360 QString baseName() const;
361
368 Qgis::FilePathType filePathStorage() const;
369
376 void setFilePathStorage( Qgis::FilePathType type );
377
391
410 QgsCoordinateReferenceSystem crs3D() const;
411
426 void setCrs( const QgsCoordinateReferenceSystem &crs, bool adjustEllipsoid = false );
427
435 QString ellipsoid() const;
436
444 void setEllipsoid( const QString &ellipsoid );
445
464 QgsCoordinateReferenceSystem verticalCrs() const;
465
485 bool setVerticalCrs( const QgsCoordinateReferenceSystem &crs, QString *errorMessage SIP_OUT = nullptr );
486
495 QgsCoordinateTransformContext transformContext() const;
496
505 void setTransformContext( const QgsCoordinateTransformContext &context );
506
511 void clear();
512
519 bool read( const QString &filename, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
520
529 bool read( Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
530
540 bool readLayer( const QDomNode &layerNode );
541
549 bool write( const QString &filename );
550
556 bool write();
557
569 bool writeEntry( const QString &scope, const QString &key, bool value ) SIP_PYNAME( writeEntryBool );
570
582 bool writeEntry( const QString &scope, const QString &key, double value ) SIP_PYNAME( writeEntryDouble );
583
594 bool writeEntry( const QString &scope, const QString &key, int value );
595
606 bool writeEntry( const QString &scope, const QString &key, const QString &value );
607
618 bool writeEntry( const QString &scope, const QString &key, const QStringList &value );
619
630 QStringList readListEntry( const QString &scope, const QString &key, const QStringList &def = QStringList(), bool *ok SIP_OUT = nullptr ) const;
631
642 QString readEntry( const QString &scope, const QString &key, const QString &def = QString(), bool *ok SIP_OUT = nullptr ) const;
643
654 int readNumEntry( const QString &scope, const QString &key, int def = 0, bool *ok SIP_OUT = nullptr ) const;
655
666 double readDoubleEntry( const QString &scope, const QString &key, double def = 0, bool *ok SIP_OUT = nullptr ) const;
667
678 bool readBoolEntry( const QString &scope, const QString &key, bool def = false, bool *ok SIP_OUT = nullptr ) const;
679
683 bool removeEntry( const QString &scope, const QString &key );
684
693 QStringList entryList( const QString &scope, const QString &key ) const;
694
703 QStringList subkeyList( const QString &scope, const QString &key ) const;
704
705 // TODO Now slightly broken since re-factoring. Won't print out top-level key
706 // and redundantly prints sub-keys.
707
711 void dumpProperties() const;
712
717 QgsPathResolver pathResolver() const;
718
724 QString writePath( const QString &filename ) const;
725
729 QString readPath( const QString &filename ) const;
730
732 QString error() const;
733
738 void setBadLayerHandler( QgsProjectBadLayerHandler *handler SIP_TRANSFER );
739
745 QString layerIsEmbedded( const QString &id ) const;
746
755 bool createEmbeddedLayer( const QString &layerId, const QString &projectFilePath, QList<QDomNode> &brokenNodes, bool saveFlag = true, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() )
756 SIP_SKIP;
757
764 std::unique_ptr< QgsLayerTreeGroup > createEmbeddedGroup(
765 const QString &groupName, const QString &projectFilePath, const QStringList &invisibleLayers, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags()
766 );
767
769 void setTopologicalEditing( bool enabled );
770
772 bool topologicalEditing() const;
773
779 Qgis::DistanceUnit distanceUnits() const { return mDistanceUnits; }
780
786 void setDistanceUnits( Qgis::DistanceUnit unit );
787
792 Qgis::AreaUnit areaUnits() const { return mAreaUnits; }
793
799 void setAreaUnits( Qgis::AreaUnit unit );
800
808 Qgis::ScaleCalculationMethod scaleMethod() const { return mScaleMethod; }
809
817 void setScaleMethod( Qgis::ScaleCalculationMethod method );
818
831 QString homePath() const;
832
845 QString presetHomePath() const;
846
847 QgsRelationManager *relationManager() const;
848
854 const QgsLayoutManager *layoutManager() const SIP_SKIP;
855
860 QgsLayoutManager *layoutManager();
861
868 const QgsElevationProfileManager *elevationProfileManager() const SIP_SKIP;
869
875 QgsElevationProfileManager *elevationProfileManager();
876
883 const QgsSelectiveMaskingSourceSetManager *selectiveMaskingSourceSetManager() const SIP_SKIP;
884
890 QgsSelectiveMaskingSourceSetManager *selectiveMaskingSourceSetManager();
891
898 const QgsMapViewsManager *viewsManager() const SIP_SKIP;
899
905 QgsMapViewsManager *viewsManager();
906
913 const QgsBookmarkManager *bookmarkManager() const SIP_SKIP;
914
920 QgsBookmarkManager *bookmarkManager();
921
928 const QgsSensorManager *sensorManager() const SIP_SKIP;
929
935 QgsSensorManager *sensorManager();
936
944 const QgsProjectViewSettings *viewSettings() const SIP_SKIP;
945
952 QgsProjectViewSettings *viewSettings();
953
961 const QgsProjectStyleSettings *styleSettings() const SIP_SKIP;
962
969 QgsProjectStyleSettings *styleSettings();
970
978 const QgsProjectTimeSettings *timeSettings() const SIP_SKIP;
979
986 QgsProjectTimeSettings *timeSettings();
987
994 const QgsProjectElevationProperties *elevationProperties() const SIP_SKIP;
995
1001 QgsProjectElevationProperties *elevationProperties();
1002
1009 const QgsProjectDisplaySettings *displaySettings() const SIP_SKIP;
1010
1017
1025
1032
1036 QgsLayerTree *layerTreeRoot() const;
1037
1041 QgsLayerTreeRegistryBridge *layerTreeRegistryBridge() const { return mLayerTreeRegistryBridge.get(); }
1042
1048
1053
1058
1063 Q_DECL_DEPRECATED void setNonIdentifiableLayers( const QList<QgsMapLayer *> &layers );
1064
1069 Q_DECL_DEPRECATED void setNonIdentifiableLayers( const QStringList &layerIds );
1070
1075 Q_DECL_DEPRECATED QStringList nonIdentifiableLayers() const;
1076
1084 Q_DECL_DEPRECATED bool autoTransaction() const SIP_DEPRECATED;
1085
1095 Q_DECL_DEPRECATED void setAutoTransaction( bool autoTransaction ) SIP_DEPRECATED;
1096
1103 Qgis::TransactionMode transactionMode() const;
1104
1114 bool setTransactionMode( Qgis::TransactionMode transactionMode );
1115
1123 QMap< QPair< QString, QString>, QgsTransactionGroup *> transactionGroups() SIP_SKIP;
1124
1132 QgsTransactionGroup *transactionGroup( const QString &providerKey, const QString &connString );
1133
1140
1146 Q_DECL_DEPRECATED bool evaluateDefaultValues() const SIP_DEPRECATED;
1147
1153 Q_DECL_DEPRECATED void setEvaluateDefaultValues( bool evaluateDefaultValues ) SIP_DEPRECATED;
1154
1157
1163
1169
1176 void setAvoidIntersectionsLayers( const QList<QgsVectorLayer *> &layers );
1177
1183 void setAvoidIntersectionsMode( const Qgis::AvoidIntersectionsMode mode );
1184
1190 Qgis::AvoidIntersectionsMode avoidIntersectionsMode() const { return mAvoidIntersectionsMode; }
1191
1197 QVariantMap customVariables() const;
1198
1203 void setCustomVariables( const QVariantMap &customVariables );
1204
1208 void setLabelingEngineSettings( const QgsLabelingEngineSettings &settings );
1209
1213 const QgsLabelingEngineSettings &labelingEngineSettings() const;
1214
1215 //
1216 // Functionality from QgsMapLayerRegistry
1217 //
1218
1222 QgsMapLayerStore *layerStore();
1223
1227 SIP_SKIP const QgsMapLayerStore *layerStore() const;
1228
1230 int count() const;
1231
1233 int validCount() const;
1234
1242 Q_INVOKABLE QgsMapLayer *mapLayer( const QString &layerId ) const;
1243
1244#ifndef SIP_RUN
1245
1261 template<class T> T mapLayer( const QString &layerId ) const { return qobject_cast<T>( mapLayer( layerId ) ); }
1262#endif
1263
1271 Q_INVOKABLE QList<QgsMapLayer *> mapLayersByName( const QString &layerName ) const;
1272
1282 QList<QgsMapLayer *> mapLayersByShortName( const QString &shortName ) const;
1283
1284
1293 QMap<QString, QgsMapLayer *> mapLayers( const bool validOnly = false ) const;
1294
1298 bool isZipped() const;
1299
1300#ifndef SIP_RUN
1301
1312 template<typename T> QVector<T> layers() const { return mLayerStore->layers<T>(); }
1313
1325 template<typename T> QVector<T> mapLayersByShortName( const QString &shortName ) const
1326 {
1327 QVector<T> layers;
1328 const auto constMapLayers { mLayerStore->layers<T>() };
1329 for ( const auto l : constMapLayers )
1330 {
1331 if ( !l->serverProperties()->shortName().isEmpty() )
1332 {
1333 if ( l->serverProperties()->shortName() == shortName )
1334 layers << l;
1335 }
1336 else if ( l->name() == shortName )
1337 {
1338 layers << l;
1339 }
1340 }
1341 return layers;
1342 }
1343
1344#endif
1345
1370 QList<QgsMapLayer *> addMapLayers( const QList<QgsMapLayer *> &mapLayers SIP_TRANSFER, bool addToLegend = true, bool takeOwnership SIP_PYARGREMOVE = true );
1371
1399 QgsMapLayer *addMapLayer( QgsMapLayer *mapLayer SIP_TRANSFER, bool addToLegend = true, bool takeOwnership SIP_PYARGREMOVE = true );
1400
1401#ifndef SIP_RUN
1415 void removeMapLayers( const QStringList &layerIds );
1416
1417 //TODO QGIS 5.0 - add PyName alias to avoid list type conversion error
1418
1432 void removeMapLayers( const QList<QgsMapLayer *> &layers );
1433#else
1434 // clang-format off
1435
1449 void removeMapLayers( SIP_PYOBJECT layers SIP_TYPEHINT( Union[List[QgsVectorLayer], List[str]] ) );
1450 % MethodCode
1451 if ( !PyList_Check( a0 ) )
1452 {
1453 sipIsErr = 1;
1454 PyErr_SetString( PyExc_TypeError, "Expected a list of layers or layers IDs" );
1455 }
1456 else if ( PyList_GET_SIZE( a0 ) )
1457 {
1458 PyObject *firstLayerPyObj = PyList_GetItem( a0, 0 );
1459 if ( firstLayerPyObj )
1460 {
1461 int state;
1462 if ( sipCanConvertToType( firstLayerPyObj, sipType_QgsMapLayer, SIP_NOT_NONE ) )
1463 {
1464 const sipTypeDef *qlist_type = sipFindType( "QList<QgsMapLayer *>" );
1465 QList<QgsMapLayer *> *layersList = reinterpret_cast<QList<QgsMapLayer *> *>( sipConvertToType( a0, qlist_type, 0, SIP_NOT_NONE, &state, &sipIsErr ) );
1466 if ( !sipIsErr )
1467 {
1468 sipCpp->removeMapLayers( *layersList );
1469 }
1470 sipReleaseType( layersList, qlist_type, state );
1471 }
1472 else if ( sipCanConvertToType( firstLayerPyObj, sipType_QString, SIP_NOT_NONE ) )
1473 {
1474 QStringList *layersId = reinterpret_cast<QStringList *>( sipConvertToType( a0, sipType_QStringList, 0, SIP_NOT_NONE, &state, &sipIsErr ) );
1475 if ( !sipIsErr )
1476 {
1477 sipCpp->removeMapLayers( *layersId );
1478 }
1479 sipReleaseType( layersId, sipType_QStringList, state );
1480 }
1481 else
1482 {
1483 sipIsErr = 1;
1484 PyErr_SetString( PyExc_TypeError, "Expected a list of layers or layers IDs" );
1485 }
1486 }
1487 }
1488 % End
1489// clang-format on
1490#endif
1491
1505 void removeMapLayer( const QString &layerId );
1506
1520 void removeMapLayer( QgsMapLayer *layer );
1521
1528 QgsMapLayer *takeMapLayer( QgsMapLayer *layer ) SIP_TRANSFERBACK;
1529
1541 QgsAnnotationLayer *mainAnnotationLayer();
1542
1553 void removeAllMapLayers();
1554
1560 void reloadAllLayers();
1561
1566 QgsCoordinateReferenceSystem defaultCrsForNewLayers() const;
1567
1579 Q_DECL_DEPRECATED void setTrustLayerMetadata( bool trust ) SIP_DEPRECATED;
1580
1591 Q_DECL_DEPRECATED bool trustLayerMetadata() const SIP_DEPRECATED;
1592
1597 const QgsAuxiliaryStorage *auxiliaryStorage() const SIP_SKIP;
1598
1603 QgsAuxiliaryStorage *auxiliaryStorage();
1604
1613 QString createAttachedFile( const QString &nameTemplate );
1614
1621 QStringList attachedFiles() const;
1622
1630 bool removeAttachedFile( const QString &path );
1631
1640 QString attachmentIdentifier( const QString &attachedFile ) const;
1641
1648 QString resolveAttachmentIdentifier( const QString &identifier ) const;
1649
1656 const QgsProjectMetadata &metadata() const;
1657
1664 void setMetadata( const QgsProjectMetadata &metadata );
1665
1674 Q_DECL_DEPRECATED QSet<QgsMapLayer *> requiredLayers() const;
1675
1684 Q_DECL_DEPRECATED void setRequiredLayers( const QSet<QgsMapLayer *> &layers );
1685
1692 void setProjectColors( const QgsNamedColorList &colors );
1693
1700 void setBackgroundColor( const QColor &color );
1701
1708 QColor backgroundColor() const;
1709
1716 void setSelectionColor( const QColor &color );
1717
1724 QColor selectionColor() const;
1725
1737 Q_DECL_DEPRECATED void setMapScales( const QVector<double> &scales ) SIP_DEPRECATED;
1738
1750 Q_DECL_DEPRECATED QVector<double> mapScales() const SIP_DEPRECATED;
1751
1760 Q_DECL_DEPRECATED void setUseProjectScales( bool enabled ) SIP_DEPRECATED;
1761
1770 Q_DECL_DEPRECATED bool useProjectScales() const SIP_DEPRECATED;
1771
1776 void generateTsFile( const QString &locale );
1777
1778 QString translate( const QString &context, const QString &sourceText, const char *disambiguation = nullptr, int n = -1 ) const override;
1779
1789 bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
1790
1800 bool accept( QgsObjectEntityVisitorInterface *visitor, const QgsObjectVisitorContext &context ) const;
1801
1807 QgsElevationShadingRenderer elevationShadingRenderer() const;
1808
1814 void setElevationShadingRenderer( const QgsElevationShadingRenderer &elevationShadingRenderer );
1815
1824 bool loadFunctionsFromProject( bool force = false ) SIP_SKIP;
1825
1833 void cleanFunctionsFromProject() SIP_SKIP;
1834
1835#ifdef SIP_RUN
1836 // clang-format off
1837 SIP_PYOBJECT __repr__();
1838 % MethodCode
1839 QString str = u"<QgsProject: '%1'%2>"_s.arg( sipCpp->fileName(),
1840 sipCpp == QgsProject::instance() ? u" (singleton instance)"_s : QString() ); // skip-keyword-check
1841 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
1842 % End
1843// clang-format on
1844#endif
1845
1846 signals :
1847
1855 void cleared();
1856
1864
1868 void readProject( const QDomDocument &document );
1869
1873 void readProjectWithContext( const QDomDocument &document, QgsReadWriteContext &context );
1874
1878 void writeProject( QDomDocument &document );
1879
1888 void readMapLayer( QgsMapLayer *mapLayer, const QDomElement &layerNode );
1889
1898 void writeMapLayer( QgsMapLayer *mapLayer, QDomElement &layerElem, QDomDocument &doc );
1899
1904
1910 Q_DECL_DEPRECATED void oldProjectVersionWarning( const QString &warning ) SIP_DEPRECATED;
1911
1922 void readVersionMismatchOccurred( const QString &fileVersion );
1923
1929 void layerLoaded( int i, int n );
1930
1932 void loadingLayer( const QString &layerName );
1933
1940 void loadingLayerMessageReceived( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
1941
1946 Q_DECL_DEPRECATED void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );
1947
1953
1956
1964
1969
1976
1981
1991
2003
2020
2027 void ellipsoidChanged( const QString &ellipsoid );
2028
2036
2044
2053
2060
2064 void missingDatumTransforms( const QStringList &missingTransforms );
2065
2071
2078
2084
2090
2102
2107
2115
2123
2131
2139
2140 //
2141 // signals from QgsMapLayerRegistry
2142 //
2143
2151 void layersWillBeRemoved( const QStringList &layerIds );
2152
2160 void layersWillBeRemoved( const QList<QgsMapLayer *> &layers );
2161
2171 void layerWillBeRemoved( const QString &layerId );
2172
2183
2190 void layersRemoved( const QStringList &layerIds );
2191
2200 void layerRemoved( const QString &layerId );
2201
2202 //TODO QGIS 5.0 - rename to past tense
2203
2211
2222 void layersAdded( const QList<QgsMapLayer *> &layers );
2223
2231
2243 void legendLayersAdded( const QList<QgsMapLayer *> &layers );
2244
2253 void layersAddedWithoutLegend( const QList<QgsMapLayer *> &layers );
2254
2262 void isDirtyChanged( bool dirty );
2263
2271 void dirtySet();
2272
2281 Q_DECL_DEPRECATED void mapScalesChanged() SIP_DEPRECATED;
2282
2289
2290 public slots:
2291
2297
2298 // TODO QGIS 5.0 - rename b to dirty
2299
2306 void setDirty( bool b = true );
2307
2316 void setPresetHomePath( const QString &path );
2317
2327 void registerTranslatableContainers( QgsTranslationContext *translationContext, QgsAttributeEditorContainer *parent, const QString &layerId );
2328
2335 void registerTranslatableObjects( QgsTranslationContext *translationContext );
2336
2343 void setDataDefinedServerProperties( const QgsPropertyCollection &properties );
2344
2352
2369 bool startEditing( QgsVectorLayer *vectorLayer = nullptr );
2370
2400 bool commitChanges( QStringList &commitErrors SIP_OUT, bool stopEditing = true, QgsVectorLayer *vectorLayer = nullptr );
2401
2418 bool rollBack( QStringList &rollbackErrors SIP_OUT, bool stopEditing = true, QgsVectorLayer *vectorLayer = nullptr );
2419
2420 private slots:
2421 void onMapLayersAdded( const QList<QgsMapLayer *> &layers );
2422 void onMapLayersRemoved( const QList<QgsMapLayer *> &layers );
2423 void cleanTransactionGroups( bool force = false );
2424 void updateTransactionGroups();
2425
2426 private:
2427 static QgsProject *sProject;
2428
2429
2438 bool _getMapLayers( const QDomDocument &doc, QList<QDomNode> &brokenNodes, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
2439
2444 void setError( const QString &errorMessage ) SIP_SKIP;
2445
2450 void clearError() SIP_SKIP;
2451
2461 bool addLayer( const QDomElement &layerElem, QList<QDomNode> &brokenNodes, QgsReadWriteContext &context, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags(), QgsDataProvider *provider = nullptr )
2462 SIP_SKIP;
2463
2467 void removeAuxiliaryLayer( const QgsMapLayer *ml );
2468
2474 void initializeEmbeddedSubtree( const QString &projectFilePath, QgsLayerTreeGroup *group, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() ) SIP_SKIP;
2475
2480 bool loadEmbeddedNodes( QgsLayerTreeGroup *group, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() ) SIP_SKIP;
2481
2483 bool readProjectFile( const QString &filename, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
2484
2486 bool writeProjectFile( const QString &filename );
2487
2489 bool unzip( const QString &filename, Qgis::ProjectReadFlags flags = Qgis::ProjectReadFlags() );
2490
2492 bool zip( const QString &filename );
2493
2495 bool saveAuxiliaryStorage( const QString &filename = QString() );
2496
2498 void loadProjectFlags( const QDomDocument *doc );
2499
2501 static QgsPropertiesDefinition &dataDefinedServerPropertyDefinitions();
2502
2504 void preloadProviders(
2505 const QVector<QDomNode> &asynchronusLayerNodes, const QgsReadWriteContext &context, QMap<QString, QgsDataProvider *> &loadedProviders, QgsMapLayer::ReadFlags layerReadFlags, int totalProviderCount
2506 );
2507
2512 void releaseHandlesToProjectArchive();
2513
2514 bool rebuildCrs3D( QString *error = nullptr );
2515
2516 Qgis::ProjectCapabilities mCapabilities;
2517
2518 std::unique_ptr< QgsMapLayerStore > mLayerStore;
2519
2520 QString mErrorMessage;
2521
2522 std::unique_ptr<QgsProjectBadLayerHandler> mBadLayerHandler;
2523
2529 QHash< QString, QPair< QString, bool> > mEmbeddedLayers;
2530
2531 QgsSnappingConfig mSnappingConfig;
2532 Qgis::AvoidIntersectionsMode mAvoidIntersectionsMode = Qgis::AvoidIntersectionsMode::AllowIntersections;
2533
2534 std::unique_ptr<QgsRelationManager> mRelationManager;
2535
2536 std::unique_ptr<QgsAnnotationManager> mAnnotationManager;
2537 std::unique_ptr<QgsLayoutManager> mLayoutManager;
2538 std::unique_ptr<QgsElevationProfileManager> mElevationProfileManager;
2539 std::unique_ptr<QgsSelectiveMaskingSourceSetManager> mSelectiveMaskingSourceSetManager;
2540 std::unique_ptr<QgsMapViewsManager> m3DViewsManager;
2541
2542 QgsBookmarkManager *mBookmarkManager = nullptr;
2543
2544 QgsSensorManager *mSensorManager = nullptr;
2545
2546 QgsProjectViewSettings *mViewSettings = nullptr;
2547
2548 QgsProjectStyleSettings *mStyleSettings = nullptr;
2549
2550 QgsProjectTimeSettings *mTimeSettings = nullptr;
2551
2552 QgsProjectElevationProperties *mElevationProperties = nullptr;
2553
2554 QgsProjectDisplaySettings *mDisplaySettings = nullptr;
2555
2556 QgsProjectGpsSettings *mGpsSettings = nullptr;
2557
2558 std::unique_ptr<QgsLayerTree> mRootGroup;
2559
2560 std::unique_ptr<QgsLayerTreeRegistryBridge> mLayerTreeRegistryBridge;
2561
2562 QgsAnnotationLayer *mMainAnnotationLayer = nullptr;
2563
2565 QMap< QPair< QString, QString>, QgsTransactionGroup *> mTransactionGroups;
2566
2567 QgsVectorLayerEditBufferGroup mEditBufferGroup;
2568
2569 std::unique_ptr<QgsMapThemeCollection> mMapThemeCollection;
2570
2571 std::unique_ptr<QgsLabelingEngineSettings> mLabelingEngineSettings;
2572
2573 QVariantMap mCustomVariables;
2574
2575 std::unique_ptr<QgsArchive> mArchive;
2576
2577 std::unique_ptr<QgsAuxiliaryStorage> mAuxiliaryStorage;
2578
2579 QFile mFile; // current physical project file
2580
2581 QString mOriginalPath;
2582
2583 QString mSaveUser; // last saved user.
2584 QString mSaveUserFull; // last saved user full name.
2585 QDateTime mSaveDateTime;
2586 QgsProjectVersion mSaveVersion;
2587
2592 QString mHomePath;
2593 mutable QString mCachedHomePath;
2594
2595 QColor mBackgroundColor;
2596 QColor mSelectionColor;
2597
2598 Qgis::DistanceUnit mDistanceUnits = Qgis::DistanceUnit::Meters;
2599 Qgis::AreaUnit mAreaUnits = Qgis::AreaUnit::SquareMeters;
2600 Qgis::ScaleCalculationMethod mScaleMethod = Qgis::ScaleCalculationMethod::HorizontalMiddle;
2601
2602 mutable QgsProjectPropertyKey mProperties; // property hierarchy, TODO: this shouldn't be mutable
2603 Qgis::TransactionMode mTransactionMode = Qgis::TransactionMode::Disabled; // transaction grouped editing
2604
2605 Qgis::ProjectFlags mFlags;
2607 QgsCoordinateReferenceSystem mVerticalCrs;
2609
2610 bool mDirty = false; // project has been modified since it has been read or saved
2611 int mDirtyBlockCount = 0;
2612
2613 QgsPropertyCollection mDataDefinedServerProperties;
2614
2615 QgsCoordinateTransformContext mTransformContext;
2616
2617 QgsProjectMetadata mMetadata;
2618
2619 std::unique_ptr< QTranslator > mTranslator;
2620
2621 bool mIsBeingDeleted = false;
2622
2623 QgsSettings mSettings;
2624
2625 mutable std::unique_ptr< QgsExpressionContextScope > mProjectScope;
2626
2627 bool mBlockChangeSignalsDuringClear = false;
2628 int mBlockSnappingUpdates = 0;
2629
2630 QgsElevationShadingRenderer mElevationShadingRenderer;
2631
2632 friend class QgsApplication;
2633
2635
2636 // Required to avoid creating a new project in it's destructor
2638
2639 // Required by QGIS Server for switching the current project instance
2640 friend class QgsServer;
2641
2642 friend class TestQgsProject;
2643
2644 Q_DISABLE_COPY( QgsProject )
2645};
2646
2668class CORE_EXPORT QgsProjectDirtyBlocker
2669{
2670 public:
2677 : mProject( project )
2678 {
2679 mProject->mDirtyBlockCount++;
2680 }
2681
2684
2685 ~QgsProjectDirtyBlocker() { mProject->mDirtyBlockCount--; }
2686
2687 private:
2688 QgsProject *mProject = nullptr;
2689
2690#ifdef SIP_RUN
2692#endif
2693};
2694
2700CORE_EXPORT QgsProjectVersion getVersion( QDomDocument const &doc ) SIP_SKIP;
2701
2702
2704#ifndef SIP_RUN
2705class GetNamedProjectColor : public QgsScopedExpressionFunction
2706{
2707 public:
2708 GetNamedProjectColor( const QgsProject *project );
2709
2714 GetNamedProjectColor( const QHash< QString, QColor > &colors );
2715
2716 QVariant func( const QVariantList &values, const QgsExpressionContext *, QgsExpression *, const QgsExpressionNodeFunction * ) override;
2717 QgsScopedExpressionFunction *clone() const override;
2718
2719 private:
2720 QHash< QString, QColor > mColors;
2721};
2722
2723class GetNamedProjectColorObject : public QgsScopedExpressionFunction
2724{
2725 public:
2726 GetNamedProjectColorObject( const QgsProject *project );
2727
2732 GetNamedProjectColorObject( const QHash< QString, QColor > &colors );
2733
2734 QVariant func( const QVariantList &values, const QgsExpressionContext *, QgsExpression *, const QgsExpressionNodeFunction * ) override;
2735 QgsScopedExpressionFunction *clone() const override;
2736
2737 private:
2738 QHash< QString, QColor > mColors;
2739};
2740
2741
2742class GetSensorData : public QgsScopedExpressionFunction
2743{
2744 public:
2745 GetSensorData( const QMap<QString, QgsAbstractSensor::SensorData> &sensorData = QMap<QString, QgsAbstractSensor::SensorData>() );
2746 QVariant func( const QVariantList &values, const QgsExpressionContext *, QgsExpression *, const QgsExpressionNodeFunction * ) override;
2747 QgsScopedExpressionFunction *clone() const override;
2748
2749 private:
2750 QMap<QString, QgsAbstractSensor::SensorData> mSensorData;
2751};
2752#endif
2754
2755#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:62
QFlags< ProjectCapability > ProjectCapabilities
Flags which control project capabilities.
Definition qgis.h:4487
DistanceUnit
Units of distance.
Definition qgis.h:5170
@ ProjectStyles
Enable the project embedded style library. Enabling this flag can increase the time required to clear...
Definition qgis.h:4478
AreaUnit
Units of area.
Definition qgis.h:5247
ProjectFlag
Flags which control the behavior of QgsProjects.
Definition qgis.h:4220
ScaleCalculationMethod
Scale calculation logic.
Definition qgis.h:5447
QFlags< ProjectFlag > ProjectFlags
Definition qgis.h:4228
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:113
QgsRelationManager * relationManager
Definition qgsproject.h:124
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:131
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:215
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:129
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:121
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:116
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:132
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:792
QgsSnappingConfig snappingConfig
Definition qgsproject.h:123
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:149
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:126
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:122
Qgis::TransactionMode transactionMode
Definition qgsproject.h:134
QgsAnnotationManager * annotationManager()
Returns pointer to the project's annotation manager.
QgsProjectDisplaySettings * displaySettings
Definition qgsproject.h:133
QgsProjectMetadata metadata
Definition qgsproject.h:127
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:120
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:117
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:119
QStringList nonIdentifiableLayers
Definition qgsproject.h:115
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:808
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.
Qgis::ProjectCapabilities capabilities() const
Returns the project's capabilities, which dictate optional functionality which can be selectively ena...
Definition qgsproject.h:205
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:128
void layerLoaded(int i, int n)
Emitted when a layer from a projects was read.
void selectionColorChanged()
Emitted whenever the project's selection color has been changed.
bool topologicalEditing
Definition qgsproject.h:130
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:135
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:125
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:118
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.
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.
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:239
#define SIP_DEPRECATED
Definition qgis_sip.h:113
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_SKIP
Definition qgis_sip.h:133
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
Definition qgis_sip.h:267
#define SIP_PYNAME(name)
Definition qgis_sip.h:88
#define SIP_PYARGREMOVE
Definition qgis_sip.h:158
#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.