61using namespace Qt::StringLiterals;
157 WMSOnlineResource = 2,
172 static void setInstance(
QgsProject *project );
194 void setTitle(
const QString &title );
202 QString title()
const;
249 QString saveUser()
const;
258 QString saveUserFullName()
const;
265 QDateTime lastSaveDateTime()
const;
277 bool isDirty()
const;
285 void setFileName(
const QString &name );
293 QString fileName()
const;
306 void setOriginalPath(
const QString &path );
319 QString originalPath()
const;
345 QDateTime lastModified() const;
352 QString absoluteFilePath() const;
359 QString absolutePath() const;
365 QString baseName() const;
373 Qgis::FilePathType filePathStorage() const;
381 void setFilePathStorage(
Qgis::FilePathType type );
440 QString ellipsoid() const;
449 void setEllipsoid( const QString &ellipsoid );
524 bool read( const QString &filename,
Qgis::ProjectReadFlags flags =
Qgis::ProjectReadFlags() );
534 bool read(
Qgis::ProjectReadFlags flags =
Qgis::ProjectReadFlags() );
545 bool readLayer( const QDomNode &layerNode );
554 bool write( const QString &filename );
574 bool writeEntry( const QString &scope, const QString &key,
bool value )
SIP_PYNAME( writeEntryBool );
587 bool writeEntry( const QString &scope, const QString &key,
double value )
SIP_PYNAME( writeEntryDouble );
599 bool writeEntry( const QString &scope, const QString &key,
int value );
611 bool writeEntry( const QString &scope, const QString &key, const QString &value );
623 bool writeEntry( const QString &scope, const QString &key, const QStringList &value );
635 QStringList readListEntry( const QString &scope, const QString &key, const QStringList &def = QStringList(),
bool *ok
SIP_OUT =
nullptr ) const;
647 QString readEntry( const QString &scope, const QString &key, const QString &def = QString(),
bool *ok
SIP_OUT =
nullptr ) const;
659 int readNumEntry( const QString &scope, const QString &key,
int def = 0,
bool *ok
SIP_OUT =
nullptr ) const;
671 double readDoubleEntry( const QString &scope, const QString &key,
double def = 0,
bool *ok
SIP_OUT =
nullptr ) const;
683 bool readBoolEntry( const QString &scope, const QString &key,
bool def = false,
bool *ok
SIP_OUT =
nullptr ) const;
688 bool removeEntry( const QString &scope, const QString &key );
698 QStringList entryList( const QString &scope, const QString &key ) const;
708 QStringList subkeyList( const QString &scope, const QString &key ) const;
716 void dumpProperties() const;
729 QString writePath( const QString &filename ) const;
734 QString readPath( const QString &filename ) const;
737 QString error() const;
750 QString layerIsEmbedded( const QString &
id ) const;
760 bool createEmbeddedLayer( const QString &layerId, const QString &projectFilePath, QList<QDomNode> &brokenNodes,
bool saveFlag = true,
Qgis::ProjectReadFlags flags =
Qgis::ProjectReadFlags() )
770 const QString &groupName, const QString &projectFilePath, const QStringList &invisibleLayers,
Qgis::ProjectReadFlags flags =
Qgis::ProjectReadFlags()
774 void setTopologicalEditing(
bool enabled );
777 bool topologicalEditing() const;
836 QString homePath()
const;
850 QString presetHomePath()
const;
1202 QVariantMap customVariables()
const;
1208 void setCustomVariables(
const QVariantMap &customVariables );
1238 int validCount()
const;
1247 Q_INVOKABLE
QgsMapLayer *mapLayer(
const QString &layerId )
const;
1266 template<
class T> T
mapLayer(
const QString &layerId )
const {
return qobject_cast<T>(
mapLayer( layerId ) ); }
1276 Q_INVOKABLE QList<QgsMapLayer *> mapLayersByName(
const QString &layerName )
const;
1287 QList<QgsMapLayer *> mapLayersByShortName(
const QString &shortName )
const;
1298 QMap<QString, QgsMapLayer *> mapLayers(
const bool validOnly =
false )
const;
1303 bool isZipped()
const;
1317 template<
typename T> QVector<T>
layers()
const {
return mLayerStore->layers<T>(); }
1333 const auto constMapLayers { mLayerStore->layers<T>() };
1334 for (
const auto l : constMapLayers )
1336 if ( !l->serverProperties()->shortName().isEmpty() )
1338 if ( l->serverProperties()->shortName() == shortName )
1341 else if ( l->name() == shortName )
1375 QList<QgsMapLayer *> addMapLayers(
const QList<QgsMapLayer *> &mapLayers
SIP_TRANSFER,
bool addToLegend =
true,
bool takeOwnership
SIP_PYARGREMOVE =
true );
1420 void removeMapLayers(
const QStringList &layerIds );
1437 void removeMapLayers(
const QList<QgsMapLayer *> &layers );
1456 if ( !PyList_Check( a0 ) )
1459 PyErr_SetString( PyExc_TypeError,
"Expected a list of layers or layers IDs" );
1461 else if ( PyList_GET_SIZE( a0 ) )
1463 PyObject *firstLayerPyObj = PyList_GetItem( a0, 0 );
1464 if ( firstLayerPyObj )
1467 if ( sipCanConvertToType( firstLayerPyObj, sipType_QgsMapLayer, SIP_NOT_NONE ) )
1469 const sipTypeDef *qlist_type = sipFindType(
"QList<QgsMapLayer *>" );
1470 QList<QgsMapLayer *> *layersList =
reinterpret_cast<QList<QgsMapLayer *> *
>( sipConvertToType( a0, qlist_type, 0, SIP_NOT_NONE, &state, &sipIsErr ) );
1473 sipCpp->removeMapLayers( *layersList );
1475 sipReleaseType( layersList, qlist_type, state );
1477 else if ( sipCanConvertToType( firstLayerPyObj, sipType_QString, SIP_NOT_NONE ) )
1479 QStringList *layersId =
reinterpret_cast<QStringList *
>( sipConvertToType( a0, sipType_QStringList, 0, SIP_NOT_NONE, &state, &sipIsErr ) );
1482 sipCpp->removeMapLayers( *layersId );
1484 sipReleaseType( layersId, sipType_QStringList, state );
1489 PyErr_SetString( PyExc_TypeError,
"Expected a list of layers or layers IDs" );
1510 void removeMapLayer(
const QString &layerId );
1525 void removeMapLayer( QgsMapLayer *layer );
1546 QgsAnnotationLayer *mainAnnotationLayer();
1558 void removeAllMapLayers();
1565 void reloadAllLayers();
1571 QgsCoordinateReferenceSystem defaultCrsForNewLayers()
const;
1584 Q_DECL_DEPRECATED
void setTrustLayerMetadata(
bool trust )
SIP_DEPRECATED;
1596 Q_DECL_DEPRECATED
bool trustLayerMetadata() const
SIP_DEPRECATED;
1602 const QgsAuxiliaryStorage *auxiliaryStorage() const
SIP_SKIP;
1608 QgsAuxiliaryStorage *auxiliaryStorage();
1618 QString createAttachedFile( const QString &nameTemplate );
1626 QStringList attachedFiles() const;
1635 bool removeAttachedFile( const QString &path );
1645 QString attachmentIdentifier( const QString &attachedFile ) const;
1653 QString resolveAttachmentIdentifier( const QString &identifier ) const;
1661 const QgsProjectMetadata &metadata() const;
1669 void setMetadata( const QgsProjectMetadata &metadata );
1679 Q_DECL_DEPRECATED QSet<QgsMapLayer *> requiredLayers() const;
1689 Q_DECL_DEPRECATED
void setRequiredLayers( const QSet<QgsMapLayer *> &layers );
1705 void setBackgroundColor( const QColor &color );
1713 QColor backgroundColor() const;
1721 void setSelectionColor( const QColor &color );
1729 QColor selectionColor() const;
1742 Q_DECL_DEPRECATED
void setMapScales( const QVector<
double> &scales )
SIP_DEPRECATED;
1755 Q_DECL_DEPRECATED QVector<
double> mapScales() const
SIP_DEPRECATED;
1765 Q_DECL_DEPRECATED
void setUseProjectScales(
bool enabled )
SIP_DEPRECATED;
1781 void generateTsFile( const QString &locale );
1783 QString translate( const QString &context, const QString &sourceText, const
char *disambiguation =
nullptr,
int n = -1 ) const override;
1794 bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
1805 bool accept( QgsObjectEntityVisitorInterface *visitor, const QgsObjectVisitorContext &context ) const;
1812 QgsElevationShadingRenderer elevationShadingRenderer() const;
1819 void setElevationShadingRenderer( const QgsElevationShadingRenderer &elevationShadingRenderer );
1829 bool loadFunctionsFromProject(
bool force = false )
SIP_SKIP;
1838 void cleanFunctionsFromProject()
SIP_SKIP;
1842 SIP_PYOBJECT __repr__();
1844 QString str = u
"<QgsProject: '%1'%2>"_s.arg( sipCpp->fileName(),
1846 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
2428 void cleanTransactionGroups(
bool force = false );
2429 void updateTransactionGroups();
2443 bool _getMapLayers( const QDomDocument &doc, QList<QDomNode> &brokenNodes,
Qgis::ProjectReadFlags
flags =
Qgis::ProjectReadFlags() );
2449 void setError( const QString &errorMessage )
SIP_SKIP;
2472 void removeAuxiliaryLayer( const
QgsMapLayer *ml );
2488 bool readProjectFile( const QString &filename,
Qgis::ProjectReadFlags
flags =
Qgis::ProjectReadFlags() );
2491 bool writeProjectFile( const QString &filename );
2494 bool unzip( const QString &filename,
Qgis::ProjectReadFlags
flags =
Qgis::ProjectReadFlags() );
2497 bool zip( const QString &filename );
2500 bool saveAuxiliaryStorage( const QString &filename = QString() );
2503 void loadProjectFlags( const QDomDocument *doc );
2509 void preloadProviders(
2517 void releaseHandlesToProjectArchive();
2519 bool rebuildCrs3D( QString *
error =
nullptr );
2521 Qgis::ProjectCapabilities mCapabilities;
2525 QString mErrorMessage;
2534 QHash< QString, QPair< QString,
bool> > mEmbeddedLayers;
2537 Qgis::AvoidIntersectionsMode mAvoidIntersectionsMode =
Qgis::AvoidIntersectionsMode::AllowIntersections;
2578 QVariantMap mCustomVariables;
2586 QString mOriginalPath;
2589 QString mSaveUserFull;
2590 QDateTime mSaveDateTime;
2598 mutable QString mCachedHomePath;
2600 QColor mBackgroundColor;
2601 QColor mSelectionColor;
2603 Qgis::DistanceUnit mDistanceUnits =
Qgis::DistanceUnit::Meters;
2604 Qgis::AreaUnit mAreaUnits =
Qgis::AreaUnit::SquareMeters;
2605 Qgis::ScaleCalculationMethod mScaleMethod =
Qgis::ScaleCalculationMethod::HorizontalMiddle;
2608 Qgis::TransactionMode mTransactionMode =
Qgis::TransactionMode::Disabled;
2610 Qgis::ProjectFlags mFlags;
2615 bool mDirty = false;
2616 int mDirtyBlockCount = 0;
2624 std::unique_ptr< QTranslator > mTranslator;
2626 bool mIsBeingDeleted = false;
2632 bool mBlockChangeSignalsDuringClear = false;
2633 bool mBlockEllipsoidChangedSignal = false;
2634 int mBlockSnappingUpdates = 0;
2683 : mProject( project )
2685 mProject->mDirtyBlockCount++;
2711class GetNamedProjectColor :
public QgsScopedExpressionFunction
2714 GetNamedProjectColor(
const QgsProject *project );
2720 GetNamedProjectColor(
const QHash< QString, QColor > &colors );
2722 QVariant func(
const QVariantList &values,
const QgsExpressionContext *, QgsExpression *,
const QgsExpressionNodeFunction * )
override;
2723 QgsScopedExpressionFunction *clone()
const override;
2726 QHash< QString, QColor > mColors;
2729class GetNamedProjectColorObject :
public QgsScopedExpressionFunction
2732 GetNamedProjectColorObject(
const QgsProject *project );
2738 GetNamedProjectColorObject(
const QHash< QString, QColor > &colors );
2740 QVariant func(
const QVariantList &values,
const QgsExpressionContext *, QgsExpression *,
const QgsExpressionNodeFunction * )
override;
2741 QgsScopedExpressionFunction *clone()
const override;
2744 QHash< QString, QColor > mColors;
2748class GetSensorData :
public QgsScopedExpressionFunction
2751 GetSensorData(
const QMap<QString, QgsAbstractSensor::SensorData> &sensorData = QMap<QString, QgsAbstractSensor::SensorData>() );
2752 QVariant func(
const QVariantList &values,
const QgsExpressionContext *, QgsExpression *,
const QgsExpressionNodeFunction * )
override;
2753 QgsScopedExpressionFunction *clone()
const override;
2756 QMap<QString, QgsAbstractSensor::SensorData> mSensorData;
Provides global constants and enumerations for use throughout the application.
QFlags< ProjectCapability > ProjectCapabilities
Flags which control project capabilities.
DistanceUnit
Units of distance.
@ ProjectStyles
Enable the project embedded style library. Enabling this flag can increase the time required to clear...
ProjectFlag
Flags which control the behavior of QgsProjects.
ScaleCalculationMethod
Scale calculation logic.
QFlags< ProjectFlag > ProjectFlags
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.
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.
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()
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.
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,...
QgsRelationManager * relationManager
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
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.
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.
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...
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.
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.
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.
QgsSnappingConfig snappingConfig
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.
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.
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
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
Qgis::TransactionMode transactionMode
QgsAnnotationManager * annotationManager()
Returns pointer to the project's annotation manager.
QgsProjectDisplaySettings * displaySettings
QgsProjectMetadata metadata
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
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.
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
QStringList nonIdentifiableLayers
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.
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
Qgis::ProjectCapabilities capabilities() const
Returns the project's capabilities, which dictate optional functionality which can be selectively ena...
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...
void layerLoaded(int i, int n)
Emitted when a layer from a projects was read.
static const QgsSettingsEntryBool * settingsAnonymizeNewProjects
void selectionColorChanged()
Emitted whenever the project's selection color has been changed.
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
void transformContextChanged()
Emitted when the project transformContext() is changed.
void setTopologicalEditing(bool enabled)
Convenience function to set topological editing.
Qgis::AvoidIntersectionsMode avoidIntersectionsMode
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.
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
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.
A boolean settings entry.
Stores settings for use within QGIS.
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)
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
QgsProjectVersion getVersion(const QDomDocument &doc)
Returns the version string found in the given DOM document.
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.