We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The QgsexpresisonContextUtils allows to add add layer specific variables to a QgsExpressionContext.
However, accessing the "layer" variable in python raises a python error (see code example below):
TypeError: unable to convert a C++ 'QPointer' instance to a Python object
The following python creates a vector layer and wants to asses it from a QgsExpressionContext:
from qgis.core import QgsExpressionContext, QgsVectorLayer, QgsExpressionContextUtils lyr = QgsVectorLayer('point?crs=epsg:4326&field=id:integer', 'dummy', 'memory') context = QgsExpressionContext() context.appendScope(QgsExpressionContextUtils.layerScope(lyr)) lyr2 = context.variable('layer')
QGIS 3.24 and QGIS 3.25 (master) OSGeo4W & Ubuntu 20.04
No response
The text was updated successfully, but these errors were encountered:
This should already be fixed. Can you confirm which revision of master of you're using?
Sorry, something went wrong.
Obviously I should pull the master more frequently. You are right, it's fixed. Thank's a lot.
No branches or pull requests
What is the bug or the crash?
The QgsexpresisonContextUtils allows to add add layer specific variables to a QgsExpressionContext.
However, accessing the "layer" variable in python raises a python error (see code example below):
TypeError: unable to convert a C++ 'QPointer' instance to a Python object
Steps to reproduce the issue
The following python creates a vector layer and wants to asses it from a QgsExpressionContext:
Versions
QGIS 3.24 and QGIS 3.25 (master) OSGeo4W & Ubuntu 20.04
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: