1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsreadwritecontext.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsReadWriteContext
{
%Docstring(signature="appended")
The class is used as a container of context for various read/write
operations on other objects.
%End
%TypeHeaderCode
#include "qgsreadwritecontext.h"
%End
public:
struct ReadWriteMessage
{
ReadWriteMessage( const QString &message = QString(), Qgis::MessageLevel level = Qgis::MessageLevel::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
bool operator==( const QgsReadWriteContext::ReadWriteMessage &other ) const;
bool operator!=( const QgsReadWriteContext::ReadWriteMessage &other ) const;
SIP_PYOBJECT __repr__();
%MethodCode
QString str = QStringLiteral( "<QgsReadWriteContext.ReadWriteMessage: %1>" ).arg( sipCpp->message() );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%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::MessageLevel::Warning ) const;
%Docstring
Append a message to the context
.. versionadded:: 3.2
%End
QgsReadWriteContextCategoryPopper enterCategory( const QString &category, const QString &details = QString() ) const /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. It's usually the :py:class:`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
};
class QgsReadWriteContextCategoryPopper
{
%Docstring(signature="appended")
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( const QgsReadWriteContext &context );
%Docstring
Creates a popper
%End
~QgsReadWriteContextCategoryPopper();
private:
QgsReadWriteContextCategoryPopper &operator=( const QgsReadWriteContextCategoryPopper & );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsreadwritecontext.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|