QGIS/python/core/auto_generated/project/qgsprojectutils.sip.in
Nyall Dawson 354d334e94 Add utility function QgsProjectUtils.updateLayerPath to bulk replace
a file path with a new path for all matching layers in a project
2021-08-06 14:17:28 +10:00

52 lines
1.8 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/project/qgsprojectutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsProjectUtils
{
%Docstring(signature="appended")
Contains utility functions for working with QGIS projects.
.. versionadded:: 3.22
%End
%TypeHeaderCode
#include "qgsprojectutils.h"
%End
public:
static QList< QgsMapLayer * > layersMatchingPath( const QgsProject *project, const QString &path );
%Docstring
Returns a list of all layers in the specified ``project`` which match the given ``path``.
This method can be used to retrieve a list of layers in a project associated with a file path.
%End
static bool updateLayerPath( QgsProject *project, const QString &oldPath, const QString &newPath );
%Docstring
Updates a ``project``, replacing the data source for all layers which match the given ``oldPath``
with sources which point to ``newPath``.
Returns ``True`` if any layers were updated as a result.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/project/qgsprojectutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/