QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Properties | Friends | List of all members
QgsProject Class Reference

Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc. More...

#include <qgsproject.h>

Inheritance diagram for QgsProject:
Inheritance graph
[legend]

Public Types

enum class  DataDefinedServerProperty : int { NoProperty = 0 , AllProperties = 1 , WMSOnlineResource = 2 }
 Data defined properties. More...
 

Public Slots

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 to startEditing().
 
QgsPropertyCollection dataDefinedServerProperties () const
 Returns the data defined properties used for overrides in user defined server parameters.
 
void registerTranslatableContainers (QgsTranslationContext *translationContext, QgsAttributeEditorContainer *parent, const QString &layerId)
 Registers the containers that require translation into the translationContext.
 
void registerTranslatableObjects (QgsTranslationContext *translationContext)
 Registers the objects that require translation into the translationContext.
 
bool rollBack (QStringList &rollbackErrors, bool stopEditing=true, QgsVectorLayer *vectorLayer=nullptr)
 Stops a current editing operation on vectorLayer and discards any uncommitted edits.
 
void setDataDefinedServerProperties (const QgsPropertyCollection &properties)
 Sets the data defined properties used for overrides in user defined server parameters to properties.
 
void setDirty (bool b=true)
 Flag the project as dirty (modified).
 
void setPresetHomePath (const QString &path)
 Sets the project's home path.
 
void setSnappingConfig (const QgsSnappingConfig &snappingConfig)
 The snapping configuration for this project.
 
bool startEditing (QgsVectorLayer *vectorLayer=nullptr)
 Makes the layer editable.
 

Signals

void aboutToBeCleared ()
 Emitted when the project is about to be cleared.
 
void areaUnitsChanged ()
 Emitted when the default area units changes.
 
void avoidIntersectionsLayersChanged ()
 Emitted whenever avoidIntersectionsLayers has changed.
 
void avoidIntersectionsModeChanged ()
 Emitted whenever the avoid intersections mode has changed.
 
void backgroundColorChanged ()
 Emitted whenever the project's canvas background color has been changed.
 
void cleared ()
 Emitted when the project is cleared (and additionally when an open project is cleared just before a new project is read).
 
void crsChanged ()
 Emitted when the CRS of the project has changed.
 
void customVariablesChanged ()
 Emitted whenever the expression variables stored in the project have been changed.
 
void dirtySet ()
 Emitted when setDirty(true) is called.
 
void distanceUnitsChanged ()
 Emitted when the default distance units changes.
 
void elevationShadingRendererChanged ()
 Emitted when the map shading renderer changes.
 
void ellipsoidChanged (const QString &ellipsoid)
 Emitted when the project ellipsoid is changed.
 
void fileNameChanged ()
 Emitted when the file name of the project changes.
 
void homePathChanged ()
 Emitted when the home path of the project changes.
 
void isDirtyChanged (bool dirty)
 Emitted when the project dirty status changes.
 
void labelingEngineSettingsChanged ()
 Emitted when global configuration of the labeling engine changes.
 
void layerLoaded (int i, int n)
 Emitted when a layer from a projects was read.
 
void layerRemoved (const QString &layerId)
 Emitted after a layer was removed from the registry.
 
void layersAdded (const QList< QgsMapLayer * > &layers)
 Emitted when one or more layers were added to the registry.
 
void layersRemoved (const QStringList &layerIds)
 Emitted after one or more layers were removed from the registry.
 
void layersWillBeRemoved (const QList< QgsMapLayer * > &layers)
 Emitted when one or more layers are about to be removed from the registry.
 
void layersWillBeRemoved (const QStringList &layerIds)
 Emitted when one or more layers are about to be removed from the registry.
 
void layerWasAdded (QgsMapLayer *layer)
 Emitted when a layer was added to the registry.
 
void layerWillBeRemoved (const QString &layerId)
 Emitted when a layer is about to be removed from the registry.
 
void layerWillBeRemoved (QgsMapLayer *layer)
 Emitted when a layer is about to be removed from the registry.
 
void legendLayersAdded (const QList< QgsMapLayer * > &layers)
 Emitted, when a layer was added to the registry and the legend.
 
void loadingLayer (const QString &layerName)
 Emitted when a layer is loaded.
 
void loadingLayerMessageReceived (const QString &layerName, const QList< QgsReadWriteContext::ReadWriteMessage > &messages)
 Emitted when loading layers has produced some messages.
 
Q_DECL_DEPRECATED void mapScalesChanged ()
 Emitted when the list of custom project map scales changes.
 
void mapThemeCollectionChanged ()
 Emitted when the map theme collection changes.
 
void metadataChanged ()
 Emitted when the project's metadata is changed.
 
void missingDatumTransforms (const QStringList &missingTransforms)
 Emitted when datum transforms stored in the project are not available locally.
 
Q_DECL_DEPRECATED void nonIdentifiableLayersChanged (QStringList nonIdentifiableLayers)
 Emitted when the list of layer which are excluded from map identification changes.
 
Q_DECL_DEPRECATED void oldProjectVersionWarning (const QString &)
 Emitted when an old project file is read.
 
void projectColorsChanged ()
 Emitted whenever the project's color scheme has been changed.
 
void projectSaved ()
 Emitted when the project file has been written and closed.
 
void readMapLayer (QgsMapLayer *mapLayer, const QDomElement &layerNode)
 Emitted after the basic initialization of a layer from the project file is done.
 
void readProject (const QDomDocument &)
 Emitted when a project is being read.
 
void readProjectWithContext (const QDomDocument &, QgsReadWriteContext &context)
 Emitted when a project is being read.
 
void readVersionMismatchOccurred (const QString &fileVersion)
 Emitted when a project is read and the version of QGIS used to save the project differs from the current QGIS version.
 
void removeAll ()
 Emitted when all layers are removed, before layersWillBeRemoved() and layerWillBeRemoved() signals are emitted.
 
void selectionColorChanged ()
 Emitted whenever the project's selection color has been changed.
 
void snappingConfigChanged (const QgsSnappingConfig &config)
 Emitted whenever the configuration for snapping has changed.
 
void topologicalEditingChanged ()
 Emitted when the topological editing flag has changed.
 
void transactionGroupsChanged ()
 Emitted whenever a new transaction group has been created or a transaction group has been removed.
 
void transformContextChanged ()
 Emitted when the project transformContext() is changed.
 
void writeMapLayer (QgsMapLayer *mapLayer, QDomElement &layerElem, QDomDocument &doc)
 Emitted when a layer is being saved.
 
void writeProject (QDomDocument &)
 Emitted when the project is being written.
 

Public Member Functions

 QgsProject (QObject *parent=nullptr, Qgis::ProjectCapabilities capabilities=Qgis::ProjectCapability::ProjectStyles)
 Create a new QgsProject.
 
 ~QgsProject () override
 
QString absoluteFilePath () const
 Returns full absolute path to the project file if the project is stored in a file system - derived from fileName().
 
QString absolutePath () const
 Returns full absolute path to the project folder if the project is stored in a file system - derived from fileName().
 
bool accept (QgsStyleEntityVisitorInterface *visitor) const
 Accepts the specified style entity visitor, causing it to visit all style entities associated with the project.
 
QgsMapLayeraddMapLayer (QgsMapLayer *mapLayer, bool addToLegend=true, bool takeOwnership=true)
 Add a layer to the map of loaded layers.
 
QList< QgsMapLayer * > addMapLayers (const QList< QgsMapLayer * > &mapLayers, bool addToLegend=true, bool takeOwnership=true)
 Add a list of layers to the map of loaded layers.
 
QgsAnnotationManagerannotationManager ()
 Returns pointer to the project's annotation manager.
 
const QgsAnnotationManagerannotationManager () const
 Returns a const pointer to the project's annotation manager.
 
Qgis::AreaUnit areaUnits () const
 Convenience function to query default area measurement units for project.
 
QStringList attachedFiles () const
 Returns a map of all attached files with identifier and real paths.
 
QString attachmentIdentifier (const QString &attachedFile) const
 Returns an identifier for an attachment file path An attachment identifier is a string which does not depend on the project archive storage location.
 
Q_DECL_DEPRECATED bool autoTransaction () const
 Transactional editing means that on supported datasources (postgres databases) the edit state of all tables that originate from the same database are synchronized and executed in a server side transaction.
 
QgsAuxiliaryStorageauxiliaryStorage ()
 Returns the current auxiliary storage.
 
const QgsAuxiliaryStorageauxiliaryStorage () const
 Returns the current const auxiliary storage.
 
QList< QgsVectorLayer * > avoidIntersectionsLayers () const
 A list of layers with which intersections should be avoided.
 
Qgis::AvoidIntersectionsMode avoidIntersectionsMode () const
 Returns the current avoid intersections mode.
 
QColor backgroundColor () const
 Returns the default background color used by default map canvases.
 
QString baseName () const
 Returns the base name of the project file without the path and without extension - derived from fileName().
 
QgsBookmarkManagerbookmarkManager ()
 Returns the project's bookmark manager, which manages bookmarks within the project.
 
const QgsBookmarkManagerbookmarkManager () const
 Returns the project's bookmark manager, which manages bookmarks within the project.
 
Qgis::ProjectCapabilities capabilities () const
 Returns the project's capabilities, which dictate optional functionality which can be selectively enabled for a QgsProject object.
 
void clear ()
 Clears the project, removing all settings and resetting it back to an empty, default state.
 
int count () const
 Returns the number of registered layers.
 
QString createAttachedFile (const QString &nameTemplate)
 Attaches a file to the project.
 
QgsLayerTreeGroupcreateEmbeddedGroup (const QString &groupName, const QString &projectFilePath, const QStringList &invisibleLayers, Qgis::ProjectReadFlags flags=Qgis::ProjectReadFlags())
 Create layer group instance defined in an arbitrary project file.
 
bool createEmbeddedLayer (const QString &layerId, const QString &projectFilePath, QList< QDomNode > &brokenNodes, bool saveFlag=true, Qgis::ProjectReadFlags flags=Qgis::ProjectReadFlags())
 Creates a maplayer instance defined in an arbitrary project file.
 
QgsExpressionContext createExpressionContext () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context.
 
QgsExpressionContextScopecreateExpressionContextScope () const override
 This method needs to be reimplemented in all classes which implement this interface and return an expression context scope.
 
QgsCoordinateReferenceSystem crs () const
 Returns the project's native coordinate reference system.
 
QVariantMap customVariables () const
 A map of custom project variables.
 
QgsCoordinateReferenceSystem defaultCrsForNewLayers () const
 Returns the default CRS for new layers based on the settings and the current project CRS.
 
QgsProjectDisplaySettingsdisplaySettings ()
 Returns the project's display settings, which contains settings and properties relating to how a QgsProject should display values such as map coordinates and bearings.
 
const QgsProjectDisplaySettingsdisplaySettings () const
 Returns the project's display settings, which contains settings and properties relating to how a QgsProject should display values such as map coordinates and bearings.
 
Qgis::DistanceUnit distanceUnits () const
 Convenience function to query default distance measurement units for project.
 
void dumpProperties () const
 Dump out current project properties to stderr.
 
QgsVectorLayerEditBufferGroupeditBufferGroup ()
 Returns the edit buffer group.
 
QgsProjectElevationPropertieselevationProperties ()
 Returns the project's elevation properties, which contains the project's elevation related settings.
 
const QgsProjectElevationPropertieselevationProperties () const
 Returns the project's elevation properties, which contains the project's elevation related settings.
 
QgsElevationShadingRenderer elevationShadingRenderer () const
 Returns the elevation shading renderer used for map shading.
 
QString ellipsoid () const
 Returns a proj string representing the project's ellipsoid setting, e.g., "WGS84".
 
QStringList entryList (const QString &scope, const QString &key) const
 Returns a list of child keys with values which exist within the the specified scope and key.
 
QString error () const
 Returns error message from previous read/write.
 
Q_DECL_DEPRECATED bool evaluateDefaultValues () const
 Should default values be evaluated on provider side when requested and not when committed.
 
Q_DECL_DEPRECATED QFileInfo fileInfo () const
 Returns QFileInfo object for the project's associated file.
 
QString fileName () const
 Returns the project's file name.
 
Qgis::FilePathType filePathStorage () const
 Returns the type of paths used when storing file paths in a QGS/QGZ project file.
 
Qgis::ProjectFlags flags () const
 Returns the project's flags, which dictate the behavior of the project.
 
void generateTsFile (const QString &locale)
 Triggers the collection strings of .qgs to be included in ts file and calls writeTsFile()
 
QgsProjectGpsSettingsgpsSettings ()
 Returns the project's GPS settings, which contains settings and properties relating to how a QgsProject should interact with a GPS device.
 
const QgsProjectGpsSettingsgpsSettings () const
 Returns the project's GPS settings, which contains settings and properties relating to how a QgsProject should interact with a GPS device.
 
QString homePath () const
 Returns the project's home path.
 
bool isDirty () const
 Returns true if the project has been modified since the last write()
 
bool isZipped () const
 Returns true if the project comes from a zip archive, false otherwise.
 
const QgsLabelingEngineSettingslabelingEngineSettings () const
 Returns project's global labeling engine settings.
 
QDateTime lastModified () const
 Returns last modified time of the project file as returned by the file system (or other project storage).
 
QDateTime lastSaveDateTime () const
 Returns the date and time when the project was last saved.
 
QgsProjectVersion lastSaveVersion () const
 Returns the QGIS version which the project was last saved using.
 
QString layerIsEmbedded (const QString &id) const
 Returns the source project file path if the layer with matching id is embedded from other project file.
 
template<typename T >
QVector< T > layers () const
 Returns a list of registered map layers with a specified layer type.
 
QgsMapLayerStorelayerStore ()
 Returns a pointer to the project's internal layer store.
 
const QgsMapLayerStorelayerStore () const
 Returns a pointer to the project's internal layer store.
 
QgsLayerTreeRegistryBridgelayerTreeRegistryBridge () const
 Returns pointer to the helper class that synchronizes map layer registry with layer tree.
 
QgsLayerTreelayerTreeRoot () const
 Returns pointer to the root (invisible) node of the project's layer tree.
 
QgsLayoutManagerlayoutManager ()
 Returns the project's layout manager, which manages print layouts, atlases and reports within the project.
 
const QgsLayoutManagerlayoutManager () const
 Returns the project's layout manager, which manages print layouts, atlases and reports within the project.
 
QgsAnnotationLayermainAnnotationLayer ()
 Returns the main annotation layer associated with the project.
 
Q_INVOKABLE QgsMapLayermapLayer (const QString &layerId) const
 Retrieve a pointer to a registered layer by layer ID.
 
template<class T >
mapLayer (const QString &layerId) const
 Retrieve a pointer to a registered layer by layerId converted to type T.
 
QMap< QString, QgsMapLayer * > mapLayers (const bool validOnly=false) const
 Returns a map of all registered layers by layer ID.
 
QList< QgsMapLayer * > mapLayersByName (const QString &layerName) const
 Retrieve a list of matching registered layers by layer name.
 
QList< QgsMapLayer * > mapLayersByShortName (const QString &shortName) const
 Retrieves a list of matching registered layers by layer shortName.
 
template<typename T >
QVector< T > mapLayersByShortName (const QString &shortName) const
 Retrieves a list of matching registered layers by layer shortName with a specified layer type, if layer's short name is empty a match with layer's name is attempted.
 
Q_DECL_DEPRECATED QVector< double > mapScales () const
 Returns the list of custom project map scales.
 
QgsMapThemeCollectionmapThemeCollection ()
 Returns pointer to the project's map theme collection.
 
const QgsProjectMetadatametadata () const
 Returns a reference to the project's metadata store.
 
Q_DECL_DEPRECATED QStringList nonIdentifiableLayers () const
 Gets the list of layers which currently should not be taken into account on map identification.
 
QString originalPath () const
 Returns the original path associated with the project.
 
QgsPathResolver pathResolver () const
 Returns path resolver object with considering whether the project uses absolute or relative paths and using current project's path.
 
QString presetHomePath () const
 Returns any manual project home path setting, or an empty string if not set.
 
QgsProjectStorageprojectStorage () const
 Returns pointer to project storage implementation that handles read/write of the project file.
 
bool read (const QString &filename, Qgis::ProjectReadFlags flags=Qgis::ProjectReadFlags())
 Reads given project file from the given file.
 
bool read (Qgis::ProjectReadFlags flags=Qgis::ProjectReadFlags())
 Reads the project from its currently associated file (see fileName() ).
 
bool readBoolEntry (const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
 Reads a boolean from the specified scope and key.
 
double readDoubleEntry (const QString &scope, const QString &key, double def=0, bool *ok=nullptr) const
 Reads a double from the specified scope and key.
 
QString readEntry (const QString &scope, const QString &key, const QString &def=QString(), bool *ok=nullptr) const
 Reads a string from the specified scope and key.
 
bool readLayer (const QDomNode &layerNode)
 Reads the layer described in the associated DOM node.
 
QStringList readListEntry (const QString &scope, const QString &key, const QStringList &def=QStringList(), bool *ok=nullptr) const
 Reads a string list from the specified scope and key.
 
int readNumEntry (const QString &scope, const QString &key, int def=0, bool *ok=nullptr) const
 Reads an integer from the specified scope and key.
 
QString readPath (const QString &filename) const
 Transforms a filename read from the project file to an absolute path.
 
QgsRelationManagerrelationManager () const
 
void reloadAllLayers ()
 Reload all registered layer's provider data caches, synchronising the layer with any changes in the datasource.
 
void removeAllMapLayers ()
 Removes all registered layers.
 
bool removeAttachedFile (const QString &path)
 Removes the attached file.
 
bool removeEntry (const QString &scope, const QString &key)
 Remove the given key from the specified scope.
 
void removeMapLayer (const QString &layerId)
 Remove a layer from the registry by layer ID.
 
void removeMapLayer (QgsMapLayer *layer)
 Remove a layer from the registry.
 
void removeMapLayers (const QList< QgsMapLayer * > &layers)
 Remove a set of layers from the registry.
 
void removeMapLayers (const QStringList &layerIds)
 Remove a set of layers from the registry by layer ID.
 
Q_DECL_DEPRECATED QSet< QgsMapLayer * > requiredLayers () const
 Returns a set of map layers that are required in the project and therefore they should not get removed from the project.
 
QString resolveAttachmentIdentifier (const QString &identifier) const
 Resolves an attachment identifier to a attachment file path.
 
QString saveUser () const
 Returns the user name that did the last save.
 
QString saveUserFullName () const
 Returns the full user name that did the last save.
 
QColor selectionColor () const
 Returns the color used to highlight selected features.
 
QgsSensorManagersensorManager ()
 Returns the project's sensor manager, which manages sensors within the project.
 
const QgsSensorManagersensorManager () const
 Returns the project's sensor manager, which manages sensors within the project.
 
void setAreaUnits (Qgis::AreaUnit unit)
 Sets the default area measurement units for the project.
 
Q_DECL_DEPRECATED void setAutoTransaction (bool autoTransaction)
 Transactional editing means that on supported datasources (postgres databases) the edit state of all tables that originate from the same database are synchronized and executed in a server side transaction.
 
void setAvoidIntersectionsLayers (const QList< QgsVectorLayer * > &layers)
 Sets the list of layers with which intersections should be avoided.
 
void setAvoidIntersectionsMode (const Qgis::AvoidIntersectionsMode mode)
 Sets the avoid intersections mode.
 
void setBackgroundColor (const QColor &color)
 Sets the default background color used by default map canvases.
 
void setBadLayerHandler (QgsProjectBadLayerHandler *handler)
 Change handler for missing layers.
 
void setCrs (const QgsCoordinateReferenceSystem &crs, bool adjustEllipsoid=false)
 Sets the project's native coordinate reference system.
 
void setCustomVariables (const QVariantMap &customVariables)
 A map of custom project variables.
 
void setDistanceUnits (Qgis::DistanceUnit unit)
 Sets the default distance measurement units for the project.
 
void setElevationShadingRenderer (const QgsElevationShadingRenderer &elevationShadingRenderer)
 Sets the elevation shading renderer used for global map shading.
 
void setEllipsoid (const QString &ellipsoid)
 Sets the project's ellipsoid from a proj string representation, e.g., "WGS84".
 
Q_DECL_DEPRECATED void setEvaluateDefaultValues (bool evaluateDefaultValues)
 Defines if default values should be evaluated on provider side when requested and not when committed.
 
void setFileName (const QString &name)
 Sets the file name associated with the project.
 
void setFilePathStorage (Qgis::FilePathType type)
 Sets the type of paths used when storing file paths in a QGS/QGZ project file.
 
void setFlag (Qgis::ProjectFlag flag, bool enabled=true)
 Sets whether a project flag is enabled.
 
void setFlags (Qgis::ProjectFlags flags)
 Sets the project's flags, which dictate the behavior of the project.
 
void setLabelingEngineSettings (const QgsLabelingEngineSettings &settings)
 Sets project's global labeling engine settings.
 
Q_DECL_DEPRECATED void setMapScales (const QVector< double > &scales)
 Sets the list of custom project map scales.
 
void setMetadata (const QgsProjectMetadata &metadata)
 Sets the project's metadata store.
 
Q_DECL_DEPRECATED void setNonIdentifiableLayers (const QList< QgsMapLayer * > &layers)
 Set a list of layers which should not be taken into account on map identification.
 
Q_DECL_DEPRECATED void setNonIdentifiableLayers (const QStringList &layerIds)
 Set a list of layers which should not be taken into account on map identification.
 
void setOriginalPath (const QString &path)
 Sets the original path associated with the project.
 
void setProjectColors (const QgsNamedColorList &colors)
 Sets the colors for the project's color scheme (see QgsProjectColorScheme).
 
Q_DECL_DEPRECATED void setRequiredLayers (const QSet< QgsMapLayer * > &layers)
 Configures a set of map layers that are required in the project and therefore they should not get removed from the project.
 
void setSelectionColor (const QColor &color)
 Sets the color used to highlight selected features.
 
void setTitle (const QString &title)
 Sets the project's title.
 
void setTopologicalEditing (bool enabled)
 Convenience function to set topological editing.
 
bool setTransactionMode (Qgis::TransactionMode transactionMode)
 Set transaction mode.
 
void setTransformContext (const QgsCoordinateTransformContext &context)
 Sets the project's coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.
 
Q_DECL_DEPRECATED void setTrustLayerMetadata (bool trust)
 Sets the trust option allowing to indicate if the extent has to be read from the XML document when data source has no metadata or if the data provider has to determine it.
 
Q_DECL_DEPRECATED void setUseProjectScales (bool enabled)
 Sets whether project mapScales() are enabled.
 
QgsSnappingConfig snappingConfig () const
 The snapping configuration for this project.
 
QgsProjectStyleSettingsstyleSettings ()
 Returns the project's style settings, which contains settings and properties relating to how a QgsProject should handle styling.
 
const QgsProjectStyleSettingsstyleSettings () const
 Returns the project's style settings, which contains settings and properties relating to how a QgsProject should handle styling.
 
QStringList subkeyList (const QString &scope, const QString &key) const
 Returns a list of child keys which contain other keys that exist within the the specified scope and key.
 
QgsMapLayertakeMapLayer (QgsMapLayer *layer)
 Takes a layer from the registry.
 
QgsProjectTimeSettingstimeSettings ()
 Returns the project's time settings, which contains the project's temporal range and other time based settings.
 
const QgsProjectTimeSettingstimeSettings () const
 Returns the project's time settings, which contains the project's temporal range and other time based settings.
 
QString title () const
 Returns the project's title.
 
bool topologicalEditing () const
 Convenience function to query topological editing status.
 
QgsTransactionGrouptransactionGroup (const QString &providerKey, const QString &connString)
 Returns the matching transaction group from a provider key and connection string.
 
QMap< QPair< QString, QString >, QgsTransactionGroup * > transactionGroups ()
 Map of transaction groups.
 
Qgis::TransactionMode transactionMode () const
 Returns the transaction mode.
 
QgsCoordinateTransformContext transformContext () const
 Returns a copy of the project's coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.
 
QString translate (const QString &context, const QString &sourceText, const char *disambiguation=nullptr, int n=-1) const override
 Translates the project with QTranslator and qm file.
 
Q_DECL_DEPRECATED bool trustLayerMetadata () const
 Returns true if the trust option is activated, false otherwise.
 
Q_DECL_DEPRECATED bool useProjectScales () const
 Returns true if project mapScales() are enabled.
 
int validCount () const
 Returns the number of registered valid layers.
 
QgsProjectViewSettingsviewSettings ()
 Returns the project's view settings, which contains settings and properties relating to how a QgsProject should be viewed and behave inside a map canvas (e.g.
 
const QgsProjectViewSettingsviewSettings () const
 Returns the project's view settings, which contains settings and properties relating to how a QgsProject should be viewed and behave inside a map canvas (e.g.
 
QgsMapViewsManagerviewsManager ()
 Returns the project's views manager, which manages map views (including 3d maps) in the project.
 
const QgsMapViewsManagerviewsManager () const
 Returns the project's views manager, which manages map views (including 3d maps) in the project.
 
bool write ()
 Writes the project to its current associated file (see fileName() ).
 
bool write (const QString &filename)
 Writes the project to a file.
 
bool writeEntry (const QString &scope, const QString &key, bool value)
 Write a boolean value to the project file.
 
bool writeEntry (const QString &scope, const QString &key, const QString &value)
 Write a string value to the project file.
 
bool writeEntry (const QString &scope, const QString &key, const QStringList &value)
 Write a string list value to the project file.
 
bool writeEntry (const QString &scope, const QString &key, double value)
 Write a double value to the project file.
 
bool writeEntry (const QString &scope, const QString &key, int value)
 Write an integer value to the project file.
 
QString writePath (const QString &filename) const
 Prepare a filename to save it to the project file.
 
- Public Member Functions inherited from QgsExpressionContextGenerator
virtual ~QgsExpressionContextGenerator ()=default
 
- Public Member Functions inherited from QgsExpressionContextScopeGenerator
virtual ~QgsExpressionContextScopeGenerator ()=default
 
- Public Member Functions inherited from QgsProjectTranslator
virtual ~QgsProjectTranslator ()=default
 

Static Public Member Functions

static QgsProjectinstance ()
 Returns the QgsProject singleton instance.
 
static void setInstance (QgsProject *project)
 Set the current project singleton instance to project.
 

Properties

Qgis::AreaUnit areaUnits
 
QList< QgsVectorLayer * > avoidIntersectionsLayers
 
Qgis::AvoidIntersectionsMode avoidIntersectionsMode
 
QColor backgroundColor
 
QgsCoordinateReferenceSystem crs
 
QgsProjectDisplaySettingsdisplaySettings
 
Qgis::DistanceUnit distanceUnits
 
QString ellipsoid
 
QString fileName
 
QString homePath
 
QgsMapThemeCollectionmapThemeCollection
 
QgsProjectMetadata metadata
 
QStringList nonIdentifiableLayers
 
QgsRelationManagerrelationManager
 
QColor selectionColor
 
QgsSnappingConfig snappingConfig
 
bool topologicalEditing
 
QgsCoordinateTransformContext transformContext
 

Friends

class QgsApplication
 
class QgsProjectDirtyBlocker
 
class QgsProviderRegistry
 
class QgsServer
 
class TestQgsProject
 

Detailed Description

Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.

QgsProject is available both as a singleton (QgsProject::instance()) and for use as standalone objects. The QGIS project singleton always gives access to the canonical project reference open within the main QGIS application.

Note
QgsProject has two general kinds of state to make persistent. (I.e., to read and write.) First, QGIS proprietary information. Second plugin information.

Definition at line 106 of file qgsproject.h.

Member Enumeration Documentation

◆ DataDefinedServerProperty

enum class QgsProject::DataDefinedServerProperty : int
strong

Data defined properties.

Overrides of user defined server parameters are stored in a property collection and they can be retrieved using the indexes specified in this enum.

Since
QGIS 3.14
Enumerator
NoProperty 

No property.

AllProperties 

All properties for item.

WMSOnlineResource 

Alias.

Definition at line 140 of file qgsproject.h.

Constructor & Destructor Documentation

◆ QgsProject()

QgsProject::QgsProject ( QObject *  parent = nullptr,
Qgis::ProjectCapabilities  capabilities = Qgis::ProjectCapability::ProjectStyles 
)
explicit

Create a new QgsProject.

Most of the time you want to use QgsProject::instance() instead as many components of QGIS work with the singleton.

Since QGIS 3.26.1 the capabilities argument specifies optional capabilities which can be selectively enabled for the project. These affect the QgsProject object for its entire lifetime.

Definition at line 369 of file qgsproject.cpp.

◆ ~QgsProject()

QgsProject::~QgsProject ( )
override

Definition at line 459 of file qgsproject.cpp.

Member Function Documentation

◆ aboutToBeCleared

void QgsProject::aboutToBeCleared ( )
signal

Emitted when the project is about to be cleared.

See also
clear()
Since
QGIS 3.34

◆ absoluteFilePath()

QString QgsProject::absoluteFilePath ( ) const

Returns full absolute path to the project file if the project is stored in a file system - derived from fileName().

Returns empty string when the project is stored in a project storage (there is no concept of paths for custom project storages).

Since
QGIS 3.2

Definition at line 882 of file qgsproject.cpp.

◆ absolutePath()

QString QgsProject::absolutePath ( ) const

Returns full absolute path to the project folder if the project is stored in a file system - derived from fileName().

Returns empty string when the project is stored in a project storage (there is no concept of paths for custom project storages).

Since
QGIS 3.2

Definition at line 869 of file qgsproject.cpp.

◆ accept()

bool QgsProject::accept ( QgsStyleEntityVisitorInterface visitor) const

Accepts the specified style entity visitor, causing it to visit all style entities associated with the project.

Returns true if the visitor should continue visiting other objects, or false if visiting should be canceled.

Since
QGIS 3.10

Definition at line 4945 of file qgsproject.cpp.

◆ addMapLayer()

QgsMapLayer * QgsProject::addMapLayer ( QgsMapLayer mapLayer,
bool  addToLegend = true,
bool  takeOwnership = true 
)

Add a layer to the map of loaded layers.

The layersAdded() and layerWasAdded() signals will always be emitted. The legendLayersAdded() signal is emitted only if addToLegend is true. If you are adding multiple layers at once, you should use addMapLayers() instead.

Parameters
mapLayerA layer to add to the registry
addToLegendIf true (by default), the layer will be added to the legend and to the main canvas. If you have a private layer you can set this parameter to false to hide it.
takeOwnershipOwnership will be transferred to the layer registry. If you specify false here you have take care of deleting the layer yourself. Not available in Python.
Returns
nullptr if unable to add layer, otherwise pointer to newly added layer
See also
addMapLayers
Note
As a side-effect QgsProject is made dirty.
Use addMapLayers if adding more than one layer at a time
takeOwnership is not available in the Python bindings - the registry will always take ownership
See also
addMapLayers()

Definition at line 4481 of file qgsproject.cpp.

◆ addMapLayers()

QList< QgsMapLayer * > QgsProject::addMapLayers ( const QList< QgsMapLayer * > &  mapLayers,
bool  addToLegend = true,
bool  takeOwnership = true 
)

Add a list of layers to the map of loaded layers.

The layersAdded() and layerWasAdded() signals will always be emitted. The legendLayersAdded() signal is emitted only if addToLegend is true.

Parameters
mapLayersA list of layer which should be added to the registry
addToLegendIf true (by default), the layers will be added to the legend and to the main canvas. If you have a private layer you can set this parameter to false to hide it.
takeOwnershipOwnership will be transferred to the layer registry. If you specify false here you have take care of deleting the layers yourself. Not available in Python.
Returns
a list of the map layers that were added successfully. If a layer or already exists in the registry, it will not be part of the returned QList.
Note
As a side-effect QgsProject is made dirty.
takeOwnership is not available in the Python bindings - the registry will always take ownership
See also
addMapLayer()

Definition at line 4439 of file qgsproject.cpp.

◆ annotationManager() [1/2]

QgsAnnotationManager * QgsProject::annotationManager ( )

Returns pointer to the project's annotation manager.

Definition at line 4105 of file qgsproject.cpp.

◆ annotationManager() [2/2]

const QgsAnnotationManager * QgsProject::annotationManager ( ) const

Returns a const pointer to the project's annotation manager.

Definition at line 4112 of file qgsproject.cpp.

◆ areaUnits()

Qgis::AreaUnit QgsProject::areaUnits ( ) const
inline

Convenience function to query default area measurement units for project.

See also
distanceUnits()

Definition at line 705 of file qgsproject.h.

◆ areaUnitsChanged

void QgsProject::areaUnitsChanged ( )
signal

Emitted when the default area units changes.

See also
setAreaUnits()
Since
QGIS 3.28

◆ attachedFiles()

QStringList QgsProject::attachedFiles ( ) const

Returns a map of all attached files with identifier and real paths.

See also
createAttachedFile()
Since
QGIS 3.22

Definition at line 4728 of file qgsproject.cpp.

◆ attachmentIdentifier()

QString QgsProject::attachmentIdentifier ( const QString &  attachedFile) const

Returns an identifier for an attachment file path An attachment identifier is a string which does not depend on the project archive storage location.

Parameters
attachedFileAn attachment file path
Returns
An identifier for the attached file
Since
QGIS 3.22

Definition at line 4753 of file qgsproject.cpp.

◆ autoTransaction()

bool QgsProject::autoTransaction ( ) const

Transactional editing means that on supported datasources (postgres databases) the edit state of all tables that originate from the same database are synchronized and executed in a server side transaction.

Deprecated:
QGIS 3.26 use transactionMode instead

Definition at line 4174 of file qgsproject.cpp.

◆ auxiliaryStorage() [1/2]

QgsAuxiliaryStorage * QgsProject::auxiliaryStorage ( )

Returns the current auxiliary storage.

Definition at line 4709 of file qgsproject.cpp.

◆ auxiliaryStorage() [2/2]

const QgsAuxiliaryStorage * QgsProject::auxiliaryStorage ( ) const

Returns the current const auxiliary storage.

Definition at line 4702 of file qgsproject.cpp.

◆ avoidIntersectionsLayers()

QList< QgsVectorLayer * > QgsProject::avoidIntersectionsLayers ( ) const

A list of layers with which intersections should be avoided.

Definition at line 2542 of file qgsproject.cpp.

◆ avoidIntersectionsLayersChanged

void QgsProject::avoidIntersectionsLayersChanged ( )
signal

Emitted whenever avoidIntersectionsLayers has changed.

◆ avoidIntersectionsMode()

Qgis::AvoidIntersectionsMode QgsProject::avoidIntersectionsMode ( ) const
inline

Returns the current avoid intersections mode.

Since
QGIS 3.14

Definition at line 1054 of file qgsproject.h.

◆ avoidIntersectionsModeChanged

void QgsProject::avoidIntersectionsModeChanged ( )
signal

Emitted whenever the avoid intersections mode has changed.

Since
QGIS 3.14

◆ backgroundColor()

QColor QgsProject::backgroundColor ( ) const

Returns the default background color used by default map canvases.

See also
setBackgroundColor()
Since
QGIS 3.10

Definition at line 4861 of file qgsproject.cpp.

◆ backgroundColorChanged

void QgsProject::backgroundColorChanged ( )
signal

Emitted whenever the project's canvas background color has been changed.

See also
setBackgroundColor()
Since
QGIS 3.10

◆ baseName()

QString QgsProject::baseName ( ) const

Returns the base name of the project file without the path and without extension - derived from fileName().

Since
QGIS 3.2

Definition at line 896 of file qgsproject.cpp.

◆ bookmarkManager() [1/2]

QgsBookmarkManager * QgsProject::bookmarkManager ( )

Returns the project's bookmark manager, which manages bookmarks within the project.

Since
QGIS 3.10

Definition at line 3985 of file qgsproject.cpp.

◆ bookmarkManager() [2/2]

const QgsBookmarkManager * QgsProject::bookmarkManager ( ) const

Returns the project's bookmark manager, which manages bookmarks within the project.

Note
not available in Python bindings
Since
QGIS 3.10

Definition at line 3978 of file qgsproject.cpp.

◆ capabilities()

Qgis::ProjectCapabilities QgsProject::capabilities ( ) const
inline

Returns the project's capabilities, which dictate optional functionality which can be selectively enabled for a QgsProject object.

Since
QGIS 3.26.1

Definition at line 197 of file qgsproject.h.

◆ clear()

void QgsProject::clear ( )

Clears the project, removing all settings and resetting it back to an empty, default state.

See also
cleared()

Definition at line 1016 of file qgsproject.cpp.

◆ cleared

void QgsProject::cleared ( )
signal

Emitted when the project is cleared (and additionally when an open project is cleared just before a new project is read).

See also
clear()
Since
QGIS 3.2

◆ commitChanges

bool QgsProject::commitChanges ( QStringList &  commitErrors,
bool  stopEditing = true,
QgsVectorLayer vectorLayer = nullptr 
)
slot

Attempts to commit to the underlying data provider any buffered changes made since the last to call to startEditing().

Returns the result of the attempt. If a commit fails (i.e. false is returned), the in-memory changes are left untouched and are not discarded. This allows editing to continue if the commit failed on e.g. a disallowed value in a Postgres database - the user can re-edit and try again.

The commits occur in distinct stages, (add attributes, add features, change attribute values, change geometries, delete features, delete attributes) so if a stage fails, it can be difficult to roll back cleanly. Therefore any error message returned by commitErrors also includes which stage failed so that the user has some chance of repairing the damage cleanly.

Parameters
commitErrorswill be set to a list of descriptive errors if the commit fails.
stopEditingif set to false, the layer will stay in editing mode. Otherwise the layer editing mode will be disabled if the commit is successful.
vectorLayerfor which the changes will be committed. For buffered transactions this parameter is not mandatory, as the changes from all layers will be committed.
Returns
true if the commit was successful.
See also
startEditing()
rollBack()
Since
QGIS 3.26

Definition at line 742 of file qgsproject.cpp.

◆ count()

int QgsProject::count ( ) const

Returns the number of registered layers.

Definition at line 4244 of file qgsproject.cpp.

◆ createAttachedFile()

QString QgsProject::createAttachedFile ( const QString &  nameTemplate)

Attaches a file to the project.

Parameters
nameTemplateAny filename template, used as a basename for attachment file, i.e. "myfile.ext"
Returns
The path to the file where the contents can be written to.
Note
If the attachment file is used as a source for a project layer, the attachment will be removed automatically when the layer is deleted.
Since
QGIS 3.22

Definition at line 4716 of file qgsproject.cpp.

◆ createEmbeddedGroup()

QgsLayerTreeGroup * QgsProject::createEmbeddedGroup ( const QString &  groupName,
const QString &  projectFilePath,
const QStringList &  invisibleLayers,
Qgis::ProjectReadFlags  flags = Qgis::ProjectReadFlags() 
)

Create layer group instance defined in an arbitrary project file.

The optional flags argument can be used to control layer reading behavior.

Definition at line 3726 of file qgsproject.cpp.

◆ createEmbeddedLayer()

bool QgsProject::createEmbeddedLayer ( const QString &  layerId,
const QString &  projectFilePath,
QList< QDomNode > &  brokenNodes,
bool  saveFlag = true,
Qgis::ProjectReadFlags  flags = Qgis::ProjectReadFlags() 
)

Creates a maplayer instance defined in an arbitrary project file.

Caller takes ownership.

The optional flags argument can be used to specify flags which control layer reading.

Returns
the layer or 0 in case of error
Note
not available in Python bindings

Definition at line 3630 of file qgsproject.cpp.

◆ createExpressionContext()

QgsExpressionContext QgsProject::createExpressionContext ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context.

Implements QgsExpressionContextGenerator.

Definition at line 2569 of file qgsproject.cpp.

◆ createExpressionContextScope()

QgsExpressionContextScope * QgsProject::createExpressionContextScope ( ) const
overridevirtual

This method needs to be reimplemented in all classes which implement this interface and return an expression context scope.

Implements QgsExpressionContextScopeGenerator.

Definition at line 2581 of file qgsproject.cpp.

◆ crs()

QgsCoordinateReferenceSystem QgsProject::crs ( ) const

Returns the project's native coordinate reference system.

See also
setCrs()
ellipsoid()

Definition at line 936 of file qgsproject.cpp.

◆ crsChanged

void QgsProject::crsChanged ( )
signal

Emitted when the CRS of the project has changed.

◆ customVariables()

QVariantMap QgsProject::customVariables ( ) const

A map of custom project variables.

To get all available variables including generated ones use QgsExpressionContextUtils::projectScope() instead.

Definition at line 2477 of file qgsproject.cpp.

◆ customVariablesChanged

void QgsProject::customVariablesChanged ( )
signal

Emitted whenever the expression variables stored in the project have been changed.

◆ dataDefinedServerProperties

QgsPropertyCollection QgsProject::dataDefinedServerProperties ( ) const
slot

Returns the data defined properties used for overrides in user defined server parameters.

Since
QGIS 3.14

Definition at line 714 of file qgsproject.cpp.

◆ defaultCrsForNewLayers()

QgsCoordinateReferenceSystem QgsProject::defaultCrsForNewLayers ( ) const

Returns the default CRS for new layers based on the settings and the current project CRS.

Definition at line 4613 of file qgsproject.cpp.

◆ dirtySet

void QgsProject::dirtySet ( )
signal

Emitted when setDirty(true) is called.

Note
As opposed to isDirtyChanged(), this signal is invoked every time setDirty(true) is called, regardless of whether the project was already dirty.
Since
QGIS 3.20

◆ displaySettings() [1/2]

QgsProjectDisplaySettings * QgsProject::displaySettings ( )

Returns the project's display settings, which contains settings and properties relating to how a QgsProject should display values such as map coordinates and bearings.

Since
QGIS 3.12

◆ displaySettings() [2/2]

const QgsProjectDisplaySettings * QgsProject::displaySettings ( ) const

Returns the project's display settings, which contains settings and properties relating to how a QgsProject should display values such as map coordinates and bearings.

Note
not available in Python bindings
Since
QGIS 3.12

Definition at line 4063 of file qgsproject.cpp.

◆ distanceUnits()

Qgis::DistanceUnit QgsProject::distanceUnits ( ) const
inline

Convenience function to query default distance measurement units for project.

See also
setDistanceUnits()
areaUnits()

Definition at line 692 of file qgsproject.h.

◆ distanceUnitsChanged

void QgsProject::distanceUnitsChanged ( )
signal

Emitted when the default distance units changes.

See also
setDistanceUnits()
Since
QGIS 3.28

◆ dumpProperties()

void QgsProject::dumpProperties ( ) const

Dump out current project properties to stderr.

Definition at line 3538 of file qgsproject.cpp.

◆ editBufferGroup()

QgsVectorLayerEditBufferGroup * QgsProject::editBufferGroup ( )

Returns the edit buffer group.

Since
QGIS 3.26

Definition at line 4606 of file qgsproject.cpp.

◆ elevationProperties() [1/2]

QgsProjectElevationProperties * QgsProject::elevationProperties ( )

Returns the project's elevation properties, which contains the project's elevation related settings.

Since
QGIS 3.26

Definition at line 4056 of file qgsproject.cpp.

◆ elevationProperties() [2/2]

const QgsProjectElevationProperties * QgsProject::elevationProperties ( ) const

Returns the project's elevation properties, which contains the project's elevation related settings.

Note
not available in Python bindings
Since
QGIS 3.26

Definition at line 4049 of file qgsproject.cpp.

◆ elevationShadingRenderer()

QgsElevationShadingRenderer QgsProject::elevationShadingRenderer ( ) const

Returns the elevation shading renderer used for map shading.

Since
QGIS 3.30

Definition at line 4975 of file qgsproject.cpp.

◆ elevationShadingRendererChanged

void QgsProject::elevationShadingRendererChanged ( )
signal

Emitted when the map shading renderer changes.

Since
QGIS 3.30

◆ ellipsoid()

QString QgsProject::ellipsoid ( ) const

Returns a proj string representing the project's ellipsoid setting, e.g., "WGS84".

See also
setEllipsoid()
crs()

Definition at line 967 of file qgsproject.cpp.

◆ ellipsoidChanged

void QgsProject::ellipsoidChanged ( const QString &  ellipsoid)
signal

Emitted when the project ellipsoid is changed.

See also
setEllipsoid()
ellipsoid()

◆ entryList()

QStringList QgsProject::entryList ( const QString &  scope,
const QString &  key 
) const

Returns a list of child keys with values which exist within the the specified scope and key.

This method does not return keys that contain other keys. See subkeyList() to retrieve keys which contain other keys.

Note
equivalent to QgsSettings entryList()

Definition at line 3500 of file qgsproject.cpp.

◆ error()

QString QgsProject::error ( ) const

Returns error message from previous read/write.

Definition at line 3596 of file qgsproject.cpp.

◆ evaluateDefaultValues()

bool QgsProject::evaluateDefaultValues ( ) const

Should default values be evaluated on provider side when requested and not when committed.

Deprecated:
Test whether the flags() method returns the Qgis::ProjectFlag::EvaluateDefaultValuesOnProviderSide flag instead.

Definition at line 3827 of file qgsproject.cpp.

◆ fileInfo()

QFileInfo QgsProject::fileInfo ( ) const

Returns QFileInfo object for the project's associated file.

Note
The use of this method is discouraged since QGIS 3.2 as it only works with project files stored in the file system. It is recommended to use absoluteFilePath(), baseName(), lastModifiedTime() as replacements that are aware of the fact that projects may be saved in other project storages.
See also
fileName()
Deprecated:
since QGIS 3.2 use absoluteFilePath(), baseName() or lastModifiedTime() instead

Definition at line 838 of file qgsproject.cpp.

◆ fileName()

QString QgsProject::fileName ( ) const

Returns the project's file name.

This is the file or the storage URI which contains the project's XML representation.

See also
setFileName()
fileInfo()

Definition at line 816 of file qgsproject.cpp.

◆ fileNameChanged

void QgsProject::fileNameChanged ( )
signal

Emitted when the file name of the project changes.

◆ filePathStorage()

Qgis::FilePathType QgsProject::filePathStorage ( ) const

Returns the type of paths used when storing file paths in a QGS/QGZ project file.

See also
setFilePathStorage()
Since
QGIS 3.22

Definition at line 913 of file qgsproject.cpp.

◆ flags()

Qgis::ProjectFlags QgsProject::flags ( ) const
inline

Returns the project's flags, which dictate the behavior of the project.

See also
setFlags()
setFlag()
Since
QGIS 3.26

Definition at line 207 of file qgsproject.h.

◆ generateTsFile()

void QgsProject::generateTsFile ( const QString &  locale)

Triggers the collection strings of .qgs to be included in ts file and calls writeTsFile()

Since
QGIS 3.4

Definition at line 4914 of file qgsproject.cpp.

◆ gpsSettings() [1/2]

QgsProjectGpsSettings * QgsProject::gpsSettings ( )

Returns the project's GPS settings, which contains settings and properties relating to how a QgsProject should interact with a GPS device.

Since
QGIS 3.30

Definition at line 4084 of file qgsproject.cpp.

◆ gpsSettings() [2/2]

const QgsProjectGpsSettings * QgsProject::gpsSettings ( ) const

Returns the project's GPS settings, which contains settings and properties relating to how a QgsProject should interact with a GPS device.

Note
not available in Python bindings
Since
QGIS 3.30

Definition at line 4077 of file qgsproject.cpp.

◆ homePath()

QString QgsProject::homePath ( ) const

Returns the project's home path.

This will either be a manually set home path (see presetHomePath()) or the path containing the project file itself.

This method always returns the absolute path to the project's home. See presetHomePath() to retrieve any manual project home path override (e.g. relative home paths).

See also
setPresetHomePath()
presetHomePath()
homePathChanged()

Definition at line 3880 of file qgsproject.cpp.

◆ homePathChanged

void QgsProject::homePathChanged ( )
signal

Emitted when the home path of the project changes.

See also
setPresetHomePath()
homePath()
presetHomePath()

◆ instance()

QgsProject * QgsProject::instance ( )
static

Returns the QgsProject singleton instance.

Definition at line 481 of file qgsproject.cpp.

◆ isDirty()

bool QgsProject::isDirty ( ) const

Returns true if the project has been modified since the last write()

Definition at line 592 of file qgsproject.cpp.

◆ isDirtyChanged

void QgsProject::isDirtyChanged ( bool  dirty)
signal

Emitted when the project dirty status changes.

Parameters
dirtytrue if the project is in a dirty state and has pending unsaved changes.
Since
QGIS 3.2

◆ isZipped()

bool QgsProject::isZipped ( ) const

Returns true if the project comes from a zip archive, false otherwise.

Definition at line 4432 of file qgsproject.cpp.

◆ labelingEngineSettings()

const QgsLabelingEngineSettings & QgsProject::labelingEngineSettings ( ) const

Returns project's global labeling engine settings.

Definition at line 2520 of file qgsproject.cpp.

◆ labelingEngineSettingsChanged

void QgsProject::labelingEngineSettingsChanged ( )
signal

Emitted when global configuration of the labeling engine changes.

◆ lastModified()

QDateTime QgsProject::lastModified ( ) const

Returns last modified time of the project file as returned by the file system (or other project storage).

Since
QGIS 3.2

Definition at line 853 of file qgsproject.cpp.

◆ lastSaveDateTime()

QDateTime QgsProject::lastSaveDateTime ( ) const

Returns the date and time when the project was last saved.

Since
QGIS 3.14

Definition at line 578 of file qgsproject.cpp.

◆ lastSaveVersion()

QgsProjectVersion QgsProject::lastSaveVersion ( ) const

Returns the QGIS version which the project was last saved using.

Since
QGIS 3.14

Definition at line 585 of file qgsproject.cpp.

◆ layerIsEmbedded()

QString QgsProject::layerIsEmbedded ( const QString &  id) const

Returns the source project file path if the layer with matching id is embedded from other project file.

Returns an empty string if the matching layer is not embedded.

Definition at line 3618 of file qgsproject.cpp.

◆ layerLoaded

void QgsProject::layerLoaded ( int  i,
int  n 
)
signal

Emitted when a layer from a projects was read.

Parameters
icurrent layer
nnumber of layers

◆ layerRemoved

void QgsProject::layerRemoved ( const QString &  layerId)
signal

Emitted after a layer was removed from the registry.

Parameters
layerIdThe ID of the layer removed.
Note
Consider using layersRemoved() instead
See also
layerWillBeRemoved()

◆ layers()

template<typename T >
QVector< T > QgsProject::layers ( ) const
inline

Returns a list of registered map layers with a specified layer type.

Example

QVector<QgsVectorLayer*> vectorLayers = QgsProject::instance()->layers<QgsVectorLayer*>();
Note
not available in Python bindings
See also
mapLayers()

Definition at line 1181 of file qgsproject.h.

◆ layersAdded

void QgsProject::layersAdded ( const QList< QgsMapLayer * > &  layers)
signal

Emitted when one or more layers were added to the registry.

This signal is also emitted for layers added to the registry, but not to the legend.

Parameters
layersList of layers which have been added.
See also
legendLayersAdded()
layerWasAdded()

◆ layersRemoved

void QgsProject::layersRemoved ( const QStringList &  layerIds)
signal

Emitted after one or more layers were removed from the registry.

Parameters
layerIdsA list of IDs of the layers which were removed.
See also
layersWillBeRemoved()

◆ layerStore() [1/2]

QgsMapLayerStore * QgsProject::layerStore ( )

Returns a pointer to the project's internal layer store.

Definition at line 2527 of file qgsproject.cpp.

◆ layerStore() [2/2]

const QgsMapLayerStore * QgsProject::layerStore ( ) const

Returns a pointer to the project's internal layer store.

Definition at line 2535 of file qgsproject.cpp.

◆ layersWillBeRemoved [1/2]

void QgsProject::layersWillBeRemoved ( const QList< QgsMapLayer * > &  layers)
signal

Emitted when one or more layers are about to be removed from the registry.

Parameters
layersA list of layers which are to be removed.
See also
layerWillBeRemoved()
layersRemoved()

◆ layersWillBeRemoved [2/2]

void QgsProject::layersWillBeRemoved ( const QStringList &  layerIds)
signal

Emitted when one or more layers are about to be removed from the registry.

Parameters
layerIdsA list of IDs for the layers which are to be removed.
See also
layerWillBeRemoved()
layersRemoved()

◆ layerTreeRegistryBridge()

QgsLayerTreeRegistryBridge * QgsProject::layerTreeRegistryBridge ( ) const
inline

Returns pointer to the helper class that synchronizes map layer registry with layer tree.

Definition at line 906 of file qgsproject.h.

◆ layerTreeRoot()

QgsLayerTree * QgsProject::layerTreeRoot ( ) const

Returns pointer to the root (invisible) node of the project's layer tree.

Definition at line 4091 of file qgsproject.cpp.

◆ layerWasAdded

void QgsProject::layerWasAdded ( QgsMapLayer layer)
signal

Emitted when a layer was added to the registry.

Note
Consider using layersAdded() instead
See also
layersAdded()

◆ layerWillBeRemoved [1/2]

void QgsProject::layerWillBeRemoved ( const QString &  layerId)
signal

Emitted when a layer is about to be removed from the registry.

Parameters
layerIdThe ID of the layer to be removed.
Note
Consider using layersWillBeRemoved() instead
See also
layersWillBeRemoved()
layerRemoved()

◆ layerWillBeRemoved [2/2]

void QgsProject::layerWillBeRemoved ( QgsMapLayer layer)
signal

Emitted when a layer is about to be removed from the registry.

Parameters
layerThe layer to be removed.
Note
Consider using layersWillBeRemoved() instead
See also
layersWillBeRemoved()
layerRemoved()

◆ layoutManager() [1/2]

QgsLayoutManager * QgsProject::layoutManager ( )

Returns the project's layout manager, which manages print layouts, atlases and reports within the project.

Definition at line 3957 of file qgsproject.cpp.

◆ layoutManager() [2/2]

const QgsLayoutManager * QgsProject::layoutManager ( ) const

Returns the project's layout manager, which manages print layouts, atlases and reports within the project.

Note
not available in Python bindings

Definition at line 3950 of file qgsproject.cpp.

◆ legendLayersAdded

void QgsProject::legendLayersAdded ( const QList< QgsMapLayer * > &  layers)
signal

Emitted, when a layer was added to the registry and the legend.

Layers can also be private layers, which are signalled by layersAdded() and layerWasAdded() but will not be advertised by this signal.

Parameters
layersList of QgsMapLayer which were added to the legend.

◆ loadingLayer

void QgsProject::loadingLayer ( const QString &  layerName)
signal

Emitted when a layer is loaded.

◆ loadingLayerMessageReceived

void QgsProject::loadingLayerMessageReceived ( const QString &  layerName,
const QList< QgsReadWriteContext::ReadWriteMessage > &  messages 
)
signal

Emitted when loading layers has produced some messages.

Parameters
layerNamethe layer name
messagesa list of pairs of Qgis::MessageLevel and messages
Since
QGIS 3.2

◆ mainAnnotationLayer()

QgsAnnotationLayer * QgsProject::mainAnnotationLayer ( )

Returns the main annotation layer associated with the project.

This layer is always present in projects, and will always be rendered above any other map layers during map render jobs.

It forms the default location to place new annotation items which should appear above all map layers.

Since
QGIS 3.16

Definition at line 4555 of file qgsproject.cpp.

◆ mapLayer() [1/2]

QgsMapLayer * QgsProject::mapLayer ( const QString &  layerId) const

Retrieve a pointer to a registered layer by layer ID.

Parameters
layerIdID of layer to retrieve
Returns
matching layer, or nullptr if no matching layer found
See also
mapLayersByName()
mapLayers()

Definition at line 4258 of file qgsproject.cpp.

◆ mapLayer() [2/2]

template<class T >
T QgsProject::mapLayer ( const QString &  layerId) const
inline

Retrieve a pointer to a registered layer by layerId converted to type T.

This is a convenience template. A nullptr will be returned if the layer is not found or if it cannot be cast to type T.

QgsVectorLayer *layer = project->mapLayer<QgsVectorLayer*>( layerId );
Represents a vector layer which manages a vector based data sets.
See also
mapLayer()
mapLayers()
Since
QGIS 3.6

Definition at line 1126 of file qgsproject.h.

◆ mapLayers()

QMap< QString, QgsMapLayer * > QgsProject::mapLayers ( const bool  validOnly = false) const

Returns a map of all registered layers by layer ID.

Parameters
validOnlyif set only valid layers will be returned
See also
mapLayer()
mapLayersByName()
layers()

Definition at line 4591 of file qgsproject.cpp.

◆ mapLayersByName()

QList< QgsMapLayer * > QgsProject::mapLayersByName ( const QString &  layerName) const

Retrieve a list of matching registered layers by layer name.

Parameters
layerNamename of layers to match
Returns
list of matching layers
See also
mapLayer()
mapLayers()

Definition at line 4266 of file qgsproject.cpp.

◆ mapLayersByShortName() [1/2]

QList< QgsMapLayer * > QgsProject::mapLayersByShortName ( const QString &  shortName) const

Retrieves a list of matching registered layers by layer shortName.

If layer's short name is empty a match with layer's name is attempted.

Returns
list of matching layers
See also
mapLayer()
mapLayers()
Since
QGIS 3.10

Definition at line 4273 of file qgsproject.cpp.

◆ mapLayersByShortName() [2/2]

template<typename T >
QVector< T > QgsProject::mapLayersByShortName ( const QString &  shortName) const
inline

Retrieves a list of matching registered layers by layer shortName with a specified layer type, if layer's short name is empty a match with layer's name is attempted.

Parameters
shortNameshort name of layers to match
Returns
list of matching layers
See also
mapLayer()
mapLayers()
Note
not available in Python bindings
Since
QGIS 3.10

Definition at line 1198 of file qgsproject.h.

◆ mapScales()

QVector< double > QgsProject::mapScales ( ) const

Returns the list of custom project map scales.

The scales list consists of a list of scale denominator values, e.g. 1000 for a 1:1000 scale.

See also
setMapScales()
mapScalesChanged()
Deprecated:
Use viewSettings() instead

Definition at line 4893 of file qgsproject.cpp.

◆ mapScalesChanged

Q_DECL_DEPRECATED void QgsProject::mapScalesChanged ( )
signal

Emitted when the list of custom project map scales changes.

See also
mapScales()
setMapScales()
Deprecated:
Use viewSettings() instead

◆ mapThemeCollection()

QgsMapThemeCollection * QgsProject::mapThemeCollection ( )

Returns pointer to the project's map theme collection.

Note
renamed in QGIS 3.0, formerly QgsVisibilityPresetCollection

◆ mapThemeCollectionChanged

void QgsProject::mapThemeCollectionChanged ( )
signal

Emitted when the map theme collection changes.

This only happens when the map theme collection is reset. Any pointer previously received from mapThemeCollection() must no longer be used after this signal is emitted. You must still connect to signals from the map theme collection if you want to be notified about new map themes being added and map themes being removed.

◆ metadata()

const QgsProjectMetadata & QgsProject::metadata ( ) const

Returns a reference to the project's metadata store.

See also
setMetadata()
metadataChanged()
Since
QGIS 3.2

Definition at line 4771 of file qgsproject.cpp.

◆ metadataChanged

void QgsProject::metadataChanged ( )
signal

Emitted when the project's metadata is changed.

See also
setMetadata()
metadata()
Since
QGIS 3.2

◆ missingDatumTransforms

void QgsProject::missingDatumTransforms ( const QStringList &  missingTransforms)
signal

Emitted when datum transforms stored in the project are not available locally.

◆ nonIdentifiableLayers()

QStringList QgsProject::nonIdentifiableLayers ( ) const

Gets the list of layers which currently should not be taken into account on map identification.

Deprecated:
since QGIS 3.4 use QgsMapLayer::setFlags() instead

Definition at line 4157 of file qgsproject.cpp.

◆ nonIdentifiableLayersChanged

Q_DECL_DEPRECATED void QgsProject::nonIdentifiableLayersChanged ( QStringList  nonIdentifiableLayers)
signal

Emitted when the list of layer which are excluded from map identification changes.

Deprecated:
since QGIS 3.4

◆ oldProjectVersionWarning

Q_DECL_DEPRECATED void QgsProject::oldProjectVersionWarning ( const QString &  )
signal

Emitted when an old project file is read.

Deprecated:
use readVersionMismatchOccurred() instead.

◆ originalPath()

QString QgsProject::originalPath ( ) const

Returns the original path associated with the project.

This is intended for use with non-qgs/qgz project files (see QgsCustomProjectOpenHandler) in order to allow custom project open handlers to specify the original file name of the project. For custom project formats, it is NOT appropriate to call setFileName() with the original project path, as this causes the original (non QGIS) project file to be overwritten when the project is next saved.

See also
setOriginalPath()
Since
QGIS 3.14

Definition at line 831 of file qgsproject.cpp.

◆ pathResolver()

QgsPathResolver QgsProject::pathResolver ( ) const

Returns path resolver object with considering whether the project uses absolute or relative paths and using current project's path.

Definition at line 3545 of file qgsproject.cpp.

◆ presetHomePath()

QString QgsProject::presetHomePath ( ) const

Returns any manual project home path setting, or an empty string if not set.

This path may be a relative path. See homePath() to retrieve a path which is always an absolute path.

See also
homePath()
setPresetHomePath()
homePathChanged()
Since
QGIS 3.2

Definition at line 3935 of file qgsproject.cpp.

◆ projectColorsChanged

void QgsProject::projectColorsChanged ( )
signal

Emitted whenever the project's color scheme has been changed.

See also
setProjectColors()
Since
QGIS 3.6

◆ projectSaved

void QgsProject::projectSaved ( )
signal

Emitted when the project file has been written and closed.

◆ projectStorage()

QgsProjectStorage * QgsProject::projectStorage ( ) const

Returns pointer to project storage implementation that handles read/write of the project file.

If the project file is stored in the local file system, returns nullptr. The project storage object is inferred from fileName() of the project.

Since
QGIS 3.2

Definition at line 845 of file qgsproject.cpp.

◆ read() [1/2]

bool QgsProject::read ( const QString &  filename,
Qgis::ProjectReadFlags  flags = Qgis::ProjectReadFlags() 
)

Reads given project file from the given file.

Parameters
filenamename of project file to read
flagsoptional flags which control the read behavior of projects
Returns
true if project file has been read successfully

Definition at line 1717 of file qgsproject.cpp.

◆ read() [2/2]

bool QgsProject::read ( Qgis::ProjectReadFlags  flags = Qgis::ProjectReadFlags())

Reads the project from its currently associated file (see fileName() ).

The flags argument can be used to specify optional flags which control the read behavior of projects.

Returns
true if project file has been read successfully

Definition at line 1728 of file qgsproject.cpp.

◆ readBoolEntry()

bool QgsProject::readBoolEntry ( const QString &  scope,
const QString &  key,
bool  def = false,
bool *  ok = nullptr 
) const

Reads a boolean from the specified scope and key.

Parameters
scopeentry scope (group) name
keyentry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values.
defdefault value to return if the specified key does not exist within the scope.
okset to true if key exists and has been successfully retrieved as a boolean
Returns
entry value as boolean from scope given its key

Definition at line 3463 of file qgsproject.cpp.

◆ readDoubleEntry()

double QgsProject::readDoubleEntry ( const QString &  scope,
const QString &  key,
double  def = 0,
bool *  ok = nullptr 
) const

Reads a double from the specified scope and key.

Parameters
scopeentry scope (group) name
keyentry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values.
defdefault value to return if the specified key does not exist within the scope.
okset to true if key exists and has been successfully retrieved as a double
Returns
entry value as double from scope given its key

Definition at line 3439 of file qgsproject.cpp.

◆ readEntry()

QString QgsProject::readEntry ( const QString &  scope,
const QString &  key,
const QString &  def = QString(),
bool *  ok = nullptr 
) const

Reads a string from the specified scope and key.

Parameters
scopeentry scope (group) name
keyentry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values.
defdefault value to return if the specified key does not exist within the scope.
okset to true if key exists and has been successfully retrieved as a string value
Returns
entry value as string from scope given its key

Definition at line 3382 of file qgsproject.cpp.

◆ readLayer()

bool QgsProject::readLayer ( const QDomNode &  layerNode)

Reads the layer described in the associated DOM node.

Note
This method is mainly for use by QgsProjectBadLayerHandler subclasses that may fix definition of bad layers with the user's help in GUI. Calling this method with corrected DOM node adds the layer back to the project.
Parameters
layerNoderepresents a QgsProject DOM node that encodes a specific layer.

Definition at line 2813 of file qgsproject.cpp.

◆ readListEntry()

QStringList QgsProject::readListEntry ( const QString &  scope,
const QString &  key,
const QStringList &  def = QStringList(),
bool *  ok = nullptr 
) const

Reads a string list from the specified scope and key.

Parameters
scopeentry scope (group) name
keyentry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values.
defdefault value to return if the specified key does not exist within the scope.
okset to true if key exists and has been successfully retrieved as a string list
Returns
entry value as a string list

Definition at line 3350 of file qgsproject.cpp.

◆ readMapLayer

void QgsProject::readMapLayer ( QgsMapLayer mapLayer,
const QDomElement &  layerNode 
)
signal

Emitted after the basic initialization of a layer from the project file is done.

You can use this signal to read additional information from the project file.

Parameters
mapLayerThe map layer which is being initialized
layerNodeThe layer node from the project file

◆ readNumEntry()

int QgsProject::readNumEntry ( const QString &  scope,
const QString &  key,
int  def = 0,
bool *  ok = nullptr 
) const

Reads an integer from the specified scope and key.

Parameters
scopeentry scope (group) name
keyentry key name. Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values.
defdefault value to return if the specified key does not exist within the scope.
okset to true if key exists and has been successfully retrieved as an integer
Returns
entry value as integer from scope given its key

Definition at line 3410 of file qgsproject.cpp.

◆ readPath()

QString QgsProject::readPath ( const QString &  filename) const

Transforms a filename read from the project file to an absolute path.

Definition at line 3575 of file qgsproject.cpp.

◆ readProject

void QgsProject::readProject ( const QDomDocument &  )
signal

Emitted when a project is being read.

◆ readProjectWithContext

void QgsProject::readProjectWithContext ( const QDomDocument &  ,
QgsReadWriteContext context 
)
signal

Emitted when a project is being read.

And passing the /a context

◆ readVersionMismatchOccurred

void QgsProject::readVersionMismatchOccurred ( const QString &  fileVersion)
signal

Emitted when a project is read and the version of QGIS used to save the project differs from the current QGIS version.

The fileVersion argument indicates the version of QGIS used to save the project.

Note
Not available in Python bindings
Since
QGIS 3.26

◆ registerTranslatableContainers

void QgsProject::registerTranslatableContainers ( QgsTranslationContext translationContext,
QgsAttributeEditorContainer parent,
const QString &  layerId 
)
slot

Registers the containers that require translation into the translationContext.

This is a recursive function to get all the child containers.

Parameters
translationContextwhere the objects will be registered
parentparent-container containing list of children
layerIdto store under the correct context
Since
QGIS 3.4

Definition at line 632 of file qgsproject.cpp.

◆ registerTranslatableObjects

void QgsProject::registerTranslatableObjects ( QgsTranslationContext translationContext)
slot

Registers the objects that require translation into the translationContext.

So there can be created a ts file with these values.

Since
QGIS 3.4

Definition at line 652 of file qgsproject.cpp.

◆ relationManager()

QgsRelationManager * QgsProject::relationManager ( ) const

Definition at line 3942 of file qgsproject.cpp.

◆ reloadAllLayers()

void QgsProject::reloadAllLayers ( )

Reload all registered layer's provider data caches, synchronising the layer with any changes in the datasource.

See also
QgsMapLayer::reload()

Definition at line 4579 of file qgsproject.cpp.

◆ removeAll

void QgsProject::removeAll ( )
signal

Emitted when all layers are removed, before layersWillBeRemoved() and layerWillBeRemoved() signals are emitted.

The layersWillBeRemoved() and layerWillBeRemoved() signals will still be emitted following this signal. You can use this signal to do easy (and fast) cleanup.

◆ removeAllMapLayers()

void QgsProject::removeAllMapLayers ( )

Removes all registered layers.

If the registry has ownership of any layers these layers will also be deleted.

Note
As a side-effect the QgsProject instance is marked dirty.
Calling this method will cause the removeAll() signal to be emitted.
See also
removeMapLayer()
removeMapLayers()

Definition at line 4562 of file qgsproject.cpp.

◆ removeAttachedFile()

bool QgsProject::removeAttachedFile ( const QString &  path)

Removes the attached file.

Parameters
pathPath to the attached file
Returns
Whether removal succeeded.
See also
createAttachedFile()
Since
QGIS 3.22

Definition at line 4746 of file qgsproject.cpp.

◆ removeEntry()

bool QgsProject::removeEntry ( const QString &  scope,
const QString &  key 
)

Remove the given key from the specified scope.

Definition at line 3487 of file qgsproject.cpp.

◆ removeMapLayer() [1/2]

void QgsProject::removeMapLayer ( const QString &  layerId)

Remove a layer from the registry by layer ID.

The specified layer will be removed from the registry. If the registry has ownership of the layer then it will also be deleted.

Parameters
layerIdID of the layer to remove
Note
As a side-effect the QgsProject instance is marked dirty.
See also
removeMapLayers()
removeAllMapLayers()

Definition at line 4529 of file qgsproject.cpp.

◆ removeMapLayer() [2/2]

void QgsProject::removeMapLayer ( QgsMapLayer layer)

Remove a layer from the registry.

The specified layer will be removed from the registry. If the registry has ownership of the layer then it will also be deleted.

Parameters
layerThe layer to remove. nullptr values are ignored.
Note
As a side-effect the QgsProject instance is marked dirty.
See also
removeMapLayers()
removeAllMapLayers()

Definition at line 4538 of file qgsproject.cpp.

◆ removeMapLayers() [1/2]

void QgsProject::removeMapLayers ( const QList< QgsMapLayer * > &  layers)

Remove a set of layers from the registry.

The specified layers will be removed from the registry. If the registry has ownership of any layers these layers will also be deleted.

Parameters
layersA list of layers to remove. nullptr values are ignored.
Note
As a side-effect the QgsProject instance is marked dirty.
See also
removeMapLayer()
removeAllMapLayers()

Definition at line 4518 of file qgsproject.cpp.

◆ removeMapLayers() [2/2]

void QgsProject::removeMapLayers ( const QStringList &  layerIds)

Remove a set of layers from the registry by layer ID.

The specified layers will be removed from the registry. If the registry has ownership of any layers these layers will also be deleted.

Parameters
layerIdslist of IDs of the layers to remove
Note
As a side-effect the QgsProject instance is marked dirty.
See also
removeMapLayer()
removeAllMapLayers()

Definition at line 4507 of file qgsproject.cpp.

◆ requiredLayers()

QSet< QgsMapLayer * > QgsProject::requiredLayers ( ) const

Returns a set of map layers that are required in the project and therefore they should not get removed from the project.

The set of layers may be configured by users in project properties. and it is mainly a hint for the user interface to protect users from removing layers that important in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.

Deprecated:
since QGIS 3.4 use QgsMapLayer::flags() instead
Since
QGIS 3.2

Definition at line 4794 of file qgsproject.cpp.

◆ resolveAttachmentIdentifier()

QString QgsProject::resolveAttachmentIdentifier ( const QString &  identifier) const

Resolves an attachment identifier to a attachment file path.

Parameters
identifierAn attachment identifier
Returns
The attachment file path, or an empty string if the identifier is invalid
Since
QGIS 3.22

Definition at line 4760 of file qgsproject.cpp.

◆ rollBack

bool QgsProject::rollBack ( QStringList &  rollbackErrors,
bool  stopEditing = true,
QgsVectorLayer vectorLayer = nullptr 
)
slot

Stops a current editing operation on vectorLayer and discards any uncommitted edits.

Parameters
rollbackErrorswill be set to a list of descriptive errors if the rollback fails.
stopEditingif set to false, the layer will stay in editing mode. Otherwise the layer editing mode will be disabled if the rollback is successful.
vectorLayerfor which the changes will be rolled back. For buffered transactions this parameter is not mandatory, as the changes from all layers will be rolled back.
Returns
true if the rollback was successful.
See also
startEditing()
commitChanges()
Since
QGIS 3.26

Definition at line 768 of file qgsproject.cpp.

◆ saveUser()

QString QgsProject::saveUser ( ) const

Returns the user name that did the last save.

See also
saveUserFullName()
Since
QGIS 3.12

Definition at line 564 of file qgsproject.cpp.

◆ saveUserFullName()

QString QgsProject::saveUserFullName ( ) const

Returns the full user name that did the last save.

See also
saveUser()
Since
QGIS 3.12

Definition at line 571 of file qgsproject.cpp.

◆ selectionColor()

QColor QgsProject::selectionColor ( ) const

Returns the color used to highlight selected features.

See also
setSelectionColor()
Since
QGIS 3.10

Definition at line 4879 of file qgsproject.cpp.

◆ selectionColorChanged

void QgsProject::selectionColorChanged ( )
signal

Emitted whenever the project's selection color has been changed.

See also
setSelectionColor()
Since
QGIS 3.10

◆ sensorManager() [1/2]

QgsSensorManager * QgsProject::sensorManager ( )

Returns the project's sensor manager, which manages sensors within the project.

Since
QGIS 3.32

Definition at line 3999 of file qgsproject.cpp.

◆ sensorManager() [2/2]

const QgsSensorManager * QgsProject::sensorManager ( ) const

Returns the project's sensor manager, which manages sensors within the project.

Note
not available in Python bindings
Since
QGIS 3.32

Definition at line 3992 of file qgsproject.cpp.

◆ setAreaUnits()

void QgsProject::setAreaUnits ( Qgis::AreaUnit  unit)

Sets the default area measurement units for the project.

See also
areaUnits()
setDistanceUnits()

Definition at line 3868 of file qgsproject.cpp.

◆ setAutoTransaction()

void QgsProject::setAutoTransaction ( bool  autoTransaction)

Transactional editing means that on supported datasources (postgres databases) the edit state of all tables that originate from the same database are synchronized and executed in a server side transaction.

Warning
Make sure that this is only called when all layers are not in edit mode.
Deprecated:
QGIS 3.26 use setTransactionMode instead

Definition at line 4181 of file qgsproject.cpp.

◆ setAvoidIntersectionsLayers()

void QgsProject::setAvoidIntersectionsLayers ( const QList< QgsVectorLayer * > &  layers)

Sets the list of layers with which intersections should be avoided.

Only used if the avoid intersection mode is set to advanced.

Definition at line 2557 of file qgsproject.cpp.

◆ setAvoidIntersectionsMode()

void QgsProject::setAvoidIntersectionsMode ( const Qgis::AvoidIntersectionsMode  mode)

Sets the avoid intersections mode.

Since
QGIS 3.14

Definition at line 1304 of file qgsproject.cpp.

◆ setBackgroundColor()

void QgsProject::setBackgroundColor ( const QColor &  color)

Sets the default background color used by default map canvases.

See also
backgroundColor()
Since
QGIS 3.10

Definition at line 4850 of file qgsproject.cpp.

◆ setBadLayerHandler()

void QgsProject::setBadLayerHandler ( QgsProjectBadLayerHandler handler)

Change handler for missing layers.

Deletes old handler and takes ownership of the new one.

Definition at line 3610 of file qgsproject.cpp.

◆ setCrs()

void QgsProject::setCrs ( const QgsCoordinateReferenceSystem crs,
bool  adjustEllipsoid = false 
)

Sets the project's native coordinate reference system.

If adjustEllipsoid is set to true, the ellpsoid of this project will be set to the ellipsoid imposed by the CRS.

See also
crs()
setEllipsoid()

Definition at line 944 of file qgsproject.cpp.

◆ setCustomVariables()

void QgsProject::setCustomVariables ( const QVariantMap &  customVariables)

A map of custom project variables.

Be careful not to set generated variables.

Definition at line 2485 of file qgsproject.cpp.

◆ setDataDefinedServerProperties

void QgsProject::setDataDefinedServerProperties ( const QgsPropertyCollection properties)
slot

Sets the data defined properties used for overrides in user defined server parameters to properties.

Since
QGIS 3.14

Definition at line 707 of file qgsproject.cpp.

◆ setDirty

void QgsProject::setDirty ( bool  b = true)
slot

Flag the project as dirty (modified).

If this flag is set, the user will be asked to save changes to the project before closing the current project.

Note
promoted to public slot in 2.16

Definition at line 599 of file qgsproject.cpp.

◆ setDistanceUnits()

void QgsProject::setDistanceUnits ( Qgis::DistanceUnit  unit)

Sets the default distance measurement units for the project.

See also
distanceUnits()
setAreaUnits()

Definition at line 3856 of file qgsproject.cpp.

◆ setElevationShadingRenderer()

void QgsProject::setElevationShadingRenderer ( const QgsElevationShadingRenderer elevationShadingRenderer)

Sets the elevation shading renderer used for global map shading.

Since
QGIS 3.30

Definition at line 4696 of file qgsproject.cpp.

◆ setEllipsoid()

void QgsProject::setEllipsoid ( const QString &  ellipsoid)

Sets the project's ellipsoid from a proj string representation, e.g., "WGS84".

See also
ellipsoid()
setCrs()

Definition at line 978 of file qgsproject.cpp.

◆ setEvaluateDefaultValues()

void QgsProject::setEvaluateDefaultValues ( bool  evaluateDefaultValues)

Defines if default values should be evaluated on provider side when requested and not when committed.

Deprecated:
use setFlag( Qgis::ProjectFlag::EvaluateDefaultValuesOnProviderSide ) instead.

Definition at line 3834 of file qgsproject.cpp.

◆ setFileName()

void QgsProject::setFileName ( const QString &  name)

Sets the file name associated with the project.

This is the file or the storage URI which contains the project's XML representation.

Parameters
nameproject file name
See also
fileName()

Definition at line 794 of file qgsproject.cpp.

◆ setFilePathStorage()

void QgsProject::setFilePathStorage ( Qgis::FilePathType  type)

Sets the type of paths used when storing file paths in a QGS/QGZ project file.

See also
filePathStorage()
Since
QGIS 3.22

Definition at line 921 of file qgsproject.cpp.

◆ setFlag()

void QgsProject::setFlag ( Qgis::ProjectFlag  flag,
bool  enabled = true 
)

Sets whether a project flag is enabled.

See also
flags()
setFlags()
Since
QGIS 3.26

Definition at line 552 of file qgsproject.cpp.

◆ setFlags()

void QgsProject::setFlags ( Qgis::ProjectFlags  flags)

Sets the project's flags, which dictate the behavior of the project.

See also
flags()
setFlag()
Since
QGIS 3.26

Definition at line 514 of file qgsproject.cpp.

◆ setInstance()

void QgsProject::setInstance ( QgsProject project)
static

Set the current project singleton instance to project.

Note
this method is provided mainly for the server, which caches the projects and (potentially) needs to switch the current instance on every request.
Warning
calling this method can have serious, unintended consequences, including instability, data loss and undefined behavior. Use with EXTREME caution!
See also
instance()
Since
QGIS 3.10.11

Definition at line 475 of file qgsproject.cpp.

◆ setLabelingEngineSettings()

void QgsProject::setLabelingEngineSettings ( const QgsLabelingEngineSettings settings)

Sets project's global labeling engine settings.

Definition at line 2512 of file qgsproject.cpp.

◆ setMapScales()

void QgsProject::setMapScales ( const QVector< double > &  scales)

Sets the list of custom project map scales.

The scales list consists of a list of scale denominator values, e.g. 1000 for a 1:1000 scale.

See also
mapScales()
mapScalesChanged()
Deprecated:
Use viewSettings() instead

Definition at line 4886 of file qgsproject.cpp.

◆ setMetadata()

void QgsProject::setMetadata ( const QgsProjectMetadata metadata)

Sets the project's metadata store.

See also
metadata()
metadataChanged()
Since
QGIS 3.2

Definition at line 4779 of file qgsproject.cpp.

◆ setNonIdentifiableLayers() [1/2]

void QgsProject::setNonIdentifiableLayers ( const QList< QgsMapLayer * > &  layers)

Set a list of layers which should not be taken into account on map identification.

Deprecated:
since QGIS 3.4 use QgsMapLayer::setFlags() instead

Definition at line 4119 of file qgsproject.cpp.

◆ setNonIdentifiableLayers() [2/2]

void QgsProject::setNonIdentifiableLayers ( const QStringList &  layerIds)

Set a list of layers which should not be taken into account on map identification.

Deprecated:
since QGIS 3.4 use QgsMapLayer::setFlags() instead

Definition at line 4140 of file qgsproject.cpp.

◆ setOriginalPath()

void QgsProject::setOriginalPath ( const QString &  path)

Sets the original path associated with the project.

This is intended for use with non-qgs/qgz project files (see QgsCustomProjectOpenHandler) in order to allow custom project open handlers to specify the original file name of the project. For custom project formats, it is NOT appropriate to call setFileName() with the original project path, as this causes the original (non QGIS) project file to be overwritten when the project is next saved.

See also
originalPath()
Since
QGIS 3.14

Definition at line 824 of file qgsproject.cpp.

◆ setPresetHomePath

void QgsProject::setPresetHomePath ( const QString &  path)
slot

Sets the project's home path.

If an empty path is specified than the home path will be automatically determined from the project's file path.

See also
presetHomePath()
homePath()
homePathChanged()
Since
QGIS 3.2

Definition at line 616 of file qgsproject.cpp.

◆ setProjectColors()

void QgsProject::setProjectColors ( const QgsNamedColorList colors)

Sets the colors for the project's color scheme (see QgsProjectColorScheme).

See also
projectColorsChanged()
Since
QGIS 3.6

Definition at line 4828 of file qgsproject.cpp.

◆ setRequiredLayers()

void QgsProject::setRequiredLayers ( const QSet< QgsMapLayer * > &  layers)

Configures a set of map layers that are required in the project and therefore they should not get removed from the project.

The set of layers may be configured by users in project properties. and it is mainly a hint for the user interface to protect users from removing layers that important in the project. The removeMapLayer(), removeMapLayers() calls do not block removal of layers listed here.

Deprecated:
since QGIS 3.4 use QgsMapLayer::setFlags() instead
Since
QGIS 3.2

Definition at line 4811 of file qgsproject.cpp.

◆ setSelectionColor()

void QgsProject::setSelectionColor ( const QColor &  color)

Sets the color used to highlight selected features.

See also
selectionColor()
Since
QGIS 3.10

Definition at line 4868 of file qgsproject.cpp.

◆ setSnappingConfig

void QgsProject::setSnappingConfig ( const QgsSnappingConfig snappingConfig)
slot

The snapping configuration for this project.

Definition at line 1292 of file qgsproject.cpp.

◆ setTitle()

void QgsProject::setTitle ( const QString &  title)

Sets the project's title.

Parameters
titlenew title
Note
Since QGIS 3.2 this is just a shortcut to setting the title in the project's metadata().
See also
title()

Definition at line 492 of file qgsproject.cpp.

◆ setTopologicalEditing()

void QgsProject::setTopologicalEditing ( bool  enabled)

Convenience function to set topological editing.

Definition at line 3841 of file qgsproject.cpp.

◆ setTransactionMode()

bool QgsProject::setTransactionMode ( Qgis::TransactionMode  transactionMode)

Set transaction mode.

Returns
true if the transaction mode could be changed
Note
Transaction mode can be changed only when all layers are not in edit mode.
See also
Qgis::TransactionMode
Since
QGIS 3.26

Definition at line 4208 of file qgsproject.cpp.

◆ setTransformContext()

void QgsProject::setTransformContext ( const QgsCoordinateTransformContext context)

Sets the project's coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.

See also
transformContext()
transformContextChanged()

Definition at line 998 of file qgsproject.cpp.

◆ setTrustLayerMetadata()

void QgsProject::setTrustLayerMetadata ( bool  trust)

Sets the trust option allowing to indicate if the extent has to be read from the XML document when data source has no metadata or if the data provider has to determine it.

Moreover, when this option is activated, primary key unicity is not checked for views and materialized views with Postgres provider.

Parameters
trusttrue to trust the project, false otherwise
Deprecated:
Use setFlag( Qgis::ProjectFlag::TrustStoredLayerStatistics ) instead.

Definition at line 4637 of file qgsproject.cpp.

◆ setUseProjectScales()

void QgsProject::setUseProjectScales ( bool  enabled)

Sets whether project mapScales() are enabled.

See also
useProjectScales()
setMapScales()
Deprecated:
Use viewSettings() instead

Definition at line 4900 of file qgsproject.cpp.

◆ snappingConfig()

QgsSnappingConfig QgsProject::snappingConfig ( ) const

The snapping configuration for this project.

Definition at line 1285 of file qgsproject.cpp.

◆ snappingConfigChanged

void QgsProject::snappingConfigChanged ( const QgsSnappingConfig config)
signal

Emitted whenever the configuration for snapping has changed.

◆ startEditing

bool QgsProject::startEditing ( QgsVectorLayer vectorLayer = nullptr)
slot

Makes the layer editable.

This starts an edit session on vectorLayer. Changes made in this edit session will not be made persistent until commitChanges() is called, and can be reverted by calling rollBack().

Returns
true if the layer was successfully made editable, or false if the operation failed (e.g. due to an underlying read-only data source, or lack of edit support by the backend data provider).
See also
commitChanges()
rollBack()
Since
QGIS 3.26

Definition at line 721 of file qgsproject.cpp.

◆ styleSettings() [1/2]

QgsProjectStyleSettings * QgsProject::styleSettings ( )

Returns the project's style settings, which contains settings and properties relating to how a QgsProject should handle styling.

(e.g. styling of a newly added vector layer)

Since
QGIS 3.26

Definition at line 4027 of file qgsproject.cpp.

◆ styleSettings() [2/2]

const QgsProjectStyleSettings * QgsProject::styleSettings ( ) const

Returns the project's style settings, which contains settings and properties relating to how a QgsProject should handle styling.

(e.g. styling of a newly added vector layer)

Note
not available in Python bindings
Since
QGIS 3.26

Definition at line 4020 of file qgsproject.cpp.

◆ subkeyList()

QStringList QgsProject::subkeyList ( const QString &  scope,
const QString &  key 
) const

Returns a list of child keys which contain other keys that exist within the the specified scope and key.

This method only returns keys with keys, it will not return keys that contain only values. See entryList() to retrieve keys with values.

Note
equivalent to QgsSettings subkeyList()

Definition at line 3519 of file qgsproject.cpp.

◆ takeMapLayer()

QgsMapLayer * QgsProject::takeMapLayer ( QgsMapLayer layer)

Takes a layer from the registry.

If the layer was owned by the project, the layer will be returned without deleting it. The caller takes ownership of the layer and is responsible for deleting it.

See also
removeMapLayer()

Definition at line 4547 of file qgsproject.cpp.

◆ timeSettings() [1/2]

QgsProjectTimeSettings * QgsProject::timeSettings ( )

Returns the project's time settings, which contains the project's temporal range and other time based settings.

Since
QGIS 3.14

Definition at line 4042 of file qgsproject.cpp.

◆ timeSettings() [2/2]

const QgsProjectTimeSettings * QgsProject::timeSettings ( ) const

Returns the project's time settings, which contains the project's temporal range and other time based settings.

Note
not available in Python bindings
Since
QGIS 3.14

Definition at line 4035 of file qgsproject.cpp.

◆ title()

QString QgsProject::title ( ) const

Returns the project's title.

See also
setTitle()
Note
Since QGIS 3.2 this is just a shortcut to retrieving the title from the project's metadata().

Definition at line 506 of file qgsproject.cpp.

◆ topologicalEditing()

bool QgsProject::topologicalEditing ( ) const

Convenience function to query topological editing status.

Definition at line 3849 of file qgsproject.cpp.

◆ topologicalEditingChanged

void QgsProject::topologicalEditingChanged ( )
signal

Emitted when the topological editing flag has changed.

◆ transactionGroup()

QgsTransactionGroup * QgsProject::transactionGroup ( const QString &  providerKey,
const QString &  connString 
)

Returns the matching transaction group from a provider key and connection string.

Returns nullptr if a matching transaction group is not available.

Since
QGIS 3.2

Definition at line 4599 of file qgsproject.cpp.

◆ transactionGroups()

QMap< QPair< QString, QString >, QgsTransactionGroup * > QgsProject::transactionGroups ( )

Map of transaction groups.

QPair( providerKey, connString ) -> transactionGroup

Note
Not available in Python bindings

Definition at line 4231 of file qgsproject.cpp.

◆ transactionGroupsChanged

void QgsProject::transactionGroupsChanged ( )
signal

Emitted whenever a new transaction group has been created or a transaction group has been removed.

◆ transactionMode()

Qgis::TransactionMode QgsProject::transactionMode ( ) const

Returns the transaction mode.

See also
Qgis::TransactionMode
Since
QGIS 3.26

Definition at line 4201 of file qgsproject.cpp.

◆ transformContext()

QgsCoordinateTransformContext QgsProject::transformContext ( ) const

Returns a copy of the project's coordinate transform context, which stores various information regarding which datum transforms should be used when transforming points from a source to destination coordinate reference system.

See also
setTransformContext()
transformContextChanged()

Definition at line 990 of file qgsproject.cpp.

◆ transformContextChanged

void QgsProject::transformContextChanged ( )
signal

Emitted when the project transformContext() is changed.

See also
transformContext()

◆ translate()

QString QgsProject::translate ( const QString &  context,
const QString &  sourceText,
const char *  disambiguation = nullptr,
int  n = -1 
) const
overridevirtual

Translates the project with QTranslator and qm file.

Returns
the result string (in case there is no QTranslator loaded the sourceText)
Parameters
contextdescribing layer etc.
sourceTextis the identifier of this text
disambiguationit's the disambiguation
nif -1 uses the appropriate form
Since
QGIS 3.4

Implements QgsProjectTranslator.

Definition at line 4927 of file qgsproject.cpp.

◆ trustLayerMetadata()

bool QgsProject::trustLayerMetadata ( ) const

Returns true if the trust option is activated, false otherwise.

This option allows indicateing if the extent has to be read from the XML document when data source has no metadata or if the data provider has to determine it. Moreover, when this option is activated, primary key unicity is not checked for views and materialized views with Postgres provider.

Deprecated:
Test whether the flags() method returns the Qgis::ProjectFlag::TrustStoredLayerStatistics flag instead.

Definition at line 4644 of file qgsproject.cpp.

◆ useProjectScales()

bool QgsProject::useProjectScales ( ) const

Returns true if project mapScales() are enabled.

See also
setUseProjectScales()
mapScales()
Deprecated:
Use viewSettings() instead

Definition at line 4907 of file qgsproject.cpp.

◆ validCount()

int QgsProject::validCount ( ) const

Returns the number of registered valid layers.

Definition at line 4251 of file qgsproject.cpp.

◆ viewSettings() [1/2]

QgsProjectViewSettings * QgsProject::viewSettings ( )

Returns the project's view settings, which contains settings and properties relating to how a QgsProject should be viewed and behave inside a map canvas (e.g.

map scales and default view extent)

Since
QGIS 3.10.1

Definition at line 4013 of file qgsproject.cpp.

◆ viewSettings() [2/2]

const QgsProjectViewSettings * QgsProject::viewSettings ( ) const

Returns the project's view settings, which contains settings and properties relating to how a QgsProject should be viewed and behave inside a map canvas (e.g.

map scales and default view extent)

Note
not available in Python bindings
Since
QGIS 3.10.1

Definition at line 4006 of file qgsproject.cpp.

◆ viewsManager() [1/2]

QgsMapViewsManager * QgsProject::viewsManager ( )

Returns the project's views manager, which manages map views (including 3d maps) in the project.

Since
QGIS 3.24

Definition at line 3971 of file qgsproject.cpp.

◆ viewsManager() [2/2]

const QgsMapViewsManager * QgsProject::viewsManager ( ) const

Returns the project's views manager, which manages map views (including 3d maps) in the project.

Note
not available in Python bindings
Since
QGIS 3.24

Definition at line 3964 of file qgsproject.cpp.

◆ write() [1/2]

bool QgsProject::write ( )

Writes the project to its current associated file (see fileName() ).

Returns
true if project was written successfully
Note
isDirty() will be set to false if project is successfully written

Definition at line 2852 of file qgsproject.cpp.

◆ write() [2/2]

bool QgsProject::write ( const QString &  filename)

Writes the project to a file.

Parameters
filenamedestination file
Returns
true if project was written successfully
Note
calling this implicitly sets the project's filename (see setFileName() )
isDirty() will be set to false if project is successfully written

Definition at line 2843 of file qgsproject.cpp.

◆ writeEntry() [1/5]

bool QgsProject::writeEntry ( const QString &  scope,
const QString &  key,
bool  value 
)

Write a boolean value to the project file.

Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values

Note
The key string must be valid xml tag names in order to be saved to the file.
available in Python bindings as writeEntryBool
See also
readBoolEntry()

Definition at line 3285 of file qgsproject.cpp.

◆ writeEntry() [2/5]

bool QgsProject::writeEntry ( const QString &  scope,
const QString &  key,
const QString &  value 
)

Write a string value to the project file.

Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values

Note
The key string must be valid xml tag names in order to be saved to the file.
See also
readEntry()

Definition at line 3324 of file qgsproject.cpp.

◆ writeEntry() [3/5]

bool QgsProject::writeEntry ( const QString &  scope,
const QString &  key,
const QStringList &  value 
)

Write a string list value to the project file.

Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values

Note
The key string must be valid xml tag names in order to be saved to the file.
See also
readListEntry()

Definition at line 3337 of file qgsproject.cpp.

◆ writeEntry() [4/5]

bool QgsProject::writeEntry ( const QString &  scope,
const QString &  key,
double  value 
)

Write a double value to the project file.

Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values

Note
The key string must be valid xml tag names in order to be saved to the file.
available in Python bindings as writeEntryDouble
See also
readDoubleEntry()

Definition at line 3298 of file qgsproject.cpp.

◆ writeEntry() [5/5]

bool QgsProject::writeEntry ( const QString &  scope,
const QString &  key,
int  value 
)

Write an integer value to the project file.

Keys are '/'-delimited entries, implying a hierarchy of keys and corresponding values

Note
The key string must be valid xml tag names in order to be saved to the file.
See also
readNumEntry()

Definition at line 3311 of file qgsproject.cpp.

◆ writeMapLayer

void QgsProject::writeMapLayer ( QgsMapLayer mapLayer,
QDomElement &  layerElem,
QDomDocument &  doc 
)
signal

Emitted when a layer is being saved.

You can use this method to save additional information to the layer.

Parameters
mapLayerThe map layer which is being initialized
layerElemThe layer element from the project file
docThe document

◆ writePath()

QString QgsProject::writePath ( const QString &  filename) const

Prepare a filename to save it to the project file.

Creates an absolute or relative path according to the project settings. Paths written to the project file should be prepared with this method.

Definition at line 3582 of file qgsproject.cpp.

◆ writeProject

void QgsProject::writeProject ( QDomDocument &  )
signal

Emitted when the project is being written.

Friends And Related Symbol Documentation

◆ QgsApplication

friend class QgsApplication
friend

Definition at line 2358 of file qgsproject.h.

◆ QgsProjectDirtyBlocker

friend class QgsProjectDirtyBlocker
friend

Definition at line 2360 of file qgsproject.h.

◆ QgsProviderRegistry

friend class QgsProviderRegistry
friend

Definition at line 2363 of file qgsproject.h.

◆ QgsServer

friend class QgsServer
friend

Definition at line 2366 of file qgsproject.h.

◆ TestQgsProject

friend class TestQgsProject
friend

Definition at line 2368 of file qgsproject.h.

Property Documentation

◆ areaUnits

Qgis::AreaUnit QgsProject::areaUnits
readwrite

Definition at line 125 of file qgsproject.h.

◆ avoidIntersectionsLayers

QList<QgsVectorLayer *> QgsProject::avoidIntersectionsLayers
readwrite

Definition at line 119 of file qgsproject.h.

◆ avoidIntersectionsMode

Qgis::AvoidIntersectionsMode QgsProject::avoidIntersectionsMode
readwrite

Definition at line 118 of file qgsproject.h.

◆ backgroundColor

QColor QgsProject::backgroundColor
readwrite

Definition at line 121 of file qgsproject.h.

◆ crs

QgsCoordinateReferenceSystem QgsProject::crs
readwrite

Definition at line 112 of file qgsproject.h.

◆ displaySettings

QgsProjectDisplaySettings * QgsProject::displaySettings
read

Definition at line 126 of file qgsproject.h.

◆ distanceUnits

Qgis::DistanceUnit QgsProject::distanceUnits
readwrite

Definition at line 124 of file qgsproject.h.

◆ ellipsoid

QString QgsProject::ellipsoid
readwrite

Definition at line 114 of file qgsproject.h.

◆ fileName

QString QgsProject::fileName
readwrite

Definition at line 110 of file qgsproject.h.

◆ homePath

QString QgsProject::homePath
readwrite

Definition at line 111 of file qgsproject.h.

◆ mapThemeCollection

QgsMapThemeCollection * QgsProject::mapThemeCollection
read

Definition at line 115 of file qgsproject.h.

◆ metadata

QgsProjectMetadata QgsProject::metadata
readwrite

Definition at line 120 of file qgsproject.h.

◆ nonIdentifiableLayers

QStringList QgsProject::nonIdentifiableLayers
readwrite

Definition at line 109 of file qgsproject.h.

◆ relationManager

QgsRelationManager * QgsProject::relationManager
read

Definition at line 117 of file qgsproject.h.

◆ selectionColor

QColor QgsProject::selectionColor
readwrite

Definition at line 122 of file qgsproject.h.

◆ snappingConfig

QgsSnappingConfig QgsProject::snappingConfig
readwrite

Definition at line 116 of file qgsproject.h.

◆ topologicalEditing

bool QgsProject::topologicalEditing
readwrite

Definition at line 123 of file qgsproject.h.

◆ transformContext

QgsCoordinateTransformContext QgsProject::transformContext
readwrite

Definition at line 113 of file qgsproject.h.


The documentation for this class was generated from the following files: