mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-09 00:35:20 -05:00
for QgsVectorLayer, when constructing a layer with a URI which may be invalid These may be used for layers where the geometry type/CRS is known in advance, and where the layer path may not be initially resolvable. (E.g. layers with a URI pointing to a non-existant file). It is only ever used if the layer cannot be resolved, otherwise the actual layer geometry type will be detected and used for the layer.
166 lines
4.3 KiB
Plaintext
166 lines
4.3 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsreadwritecontext.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsReadWriteContext
|
|
{
|
|
%Docstring
|
|
The class is used as a container of context for various read/write operations on other objects.
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsreadwritecontext.h"
|
|
%End
|
|
public:
|
|
|
|
struct ReadWriteMessage
|
|
{
|
|
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, const QStringList &categories = QStringList() );
|
|
%Docstring
|
|
Construct a container for QgsReadWriteContext error or warning messages
|
|
%End
|
|
|
|
QString message() const;
|
|
%Docstring
|
|
Returns the message string
|
|
%End
|
|
|
|
Qgis::MessageLevel level() const;
|
|
%Docstring
|
|
Returns the message level
|
|
%End
|
|
|
|
QStringList categories() const;
|
|
%Docstring
|
|
Returns the stack of categories of the message
|
|
%End
|
|
|
|
};
|
|
|
|
QgsReadWriteContext();
|
|
%Docstring
|
|
Constructor for QgsReadWriteContext.
|
|
%End
|
|
|
|
~QgsReadWriteContext();
|
|
|
|
const QgsPathResolver &pathResolver() const;
|
|
%Docstring
|
|
Returns path resolver for conversion between relative and absolute paths
|
|
%End
|
|
|
|
void setPathResolver( const QgsPathResolver &resolver );
|
|
%Docstring
|
|
Sets up path resolver for conversion between relative and absolute paths
|
|
%End
|
|
|
|
void pushMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning );
|
|
%Docstring
|
|
Append a message to the context
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
QgsReadWriteContextCategoryPopper enterCategory( const QString &category, const QString &details = QString() ) /PyName=_enterCategory/;
|
|
%Docstring
|
|
Push a category to the stack
|
|
|
|
.. note::
|
|
|
|
The return value should always be used so category can be automatically left.
|
|
|
|
.. note::
|
|
|
|
It is not aimed at being used in Python. Instead use the context manager.
|
|
.. code-block:: python
|
|
|
|
context = QgsReadWriteContext()
|
|
with QgsReadWriteContext.enterCategory(context, category, details):
|
|
# do something
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
QList<QgsReadWriteContext::ReadWriteMessage> takeMessages();
|
|
%Docstring
|
|
Returns the stored messages and remove them
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
const QgsProjectTranslator *projectTranslator( ) const;
|
|
%Docstring
|
|
Returns the project translator
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
void setProjectTranslator( QgsProjectTranslator *projectTranslator );
|
|
%Docstring
|
|
Sets the project translator. Means it shouldn't conform mDefaultTranslator anymore.
|
|
It's usually the QgsProject where the function with the context is made and won't be changed anymore.
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
QgsCoordinateTransformContext transformContext() const;
|
|
%Docstring
|
|
Returns data provider coordinate transform context
|
|
|
|
.. seealso:: :py:func:`setTransformContext`
|
|
|
|
.. versionadded:: 3.8
|
|
%End
|
|
|
|
void setTransformContext( const QgsCoordinateTransformContext &transformContext );
|
|
%Docstring
|
|
Sets data coordinate transform context to ``transformContext``
|
|
|
|
.. seealso:: :py:func:`transformContext`
|
|
|
|
.. versionadded:: 3.8
|
|
%End
|
|
|
|
public:
|
|
};
|
|
|
|
|
|
class QgsReadWriteContextCategoryPopper
|
|
{
|
|
%Docstring
|
|
Allows entering a context category and takes care of
|
|
leaving this category on deletion of the class.
|
|
This would happen when it gets out of scope.
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsreadwritecontext.h"
|
|
%End
|
|
public:
|
|
QgsReadWriteContextCategoryPopper( QgsReadWriteContext &context );
|
|
%Docstring
|
|
Creates a popper
|
|
%End
|
|
~QgsReadWriteContextCategoryPopper();
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/core/qgsreadwritecontext.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|