qgis - Iterative selection of features and export to shapefile using PyQGIS

pyqgis 3 – Why QGIS crashes after I assemble a QgsGraduatedSymbolRenderer objective by QgsGraduatedSymbolRenderer.createRenderer() system? Answer

Hello pricey customer to our community We will proffer you an answer to this query pyqgis 3 – Why QGIS crashes after I assemble a QgsGraduatedSymbolRenderer objective by QgsGraduatedSymbolRenderer.createRenderer() system? ,and the respond will breathe typical via documented data sources, We welcome you and proffer you fresh questions and solutions, Many customer are questioning in regards to the respond to this query.

pyqgis 3 – Why QGIS crashes after I assemble a QgsGraduatedSymbolRenderer objective by QgsGraduatedSymbolRenderer.createRenderer() system?

Today I need to render a vector layer in QGIS by utilizing PyQGIS QgsGraduatedSymbolRenderer renderer. When I straight assemble it by utilizing the constructor, it really works. But after I need to employ the createRenderer() system, QGIS then crashed unexpectedly. I’ve executed my code in QGIS 3.14.0 and QGIS 3.16.3 python console and QGIS crashed all. I need to know if there’s a drawback in my code or a bug with QGIS.

Here is the code:

LayerPath = r"C:Users15239DesktopQGISdln.gpkg"
DelaunayLayer = QgsVectorLayer(LayerPath,"Delaunay","ogr")
QgsProject.occasion().addMapLayer(DelaunayLayer)
CpyRamp = QgsCptCityColorRamp("cb/div/BrBG_","05")
SimpleSymbol = QgsFillSymbol([QgsSimpleFillSymbolLayer(QColor(0,50,70))])
DelaunayLayer.setRenderer(QgsGraduatedSymbolRenderer.createRenderer(DelaunayLayer,'AREA',5,1,SimpleSymbol,CpyRamp))
DelaunayLayer.triggerRepaint()

Here are the take a look at knowledge and its character desk:
enter image description here
enter image description here

we’ll proffer you the answer to pyqgis 3 – Why QGIS crashes after I assemble a QgsGraduatedSymbolRenderer objective by QgsGraduatedSymbolRenderer.createRenderer() system? query by way of our community which brings all of the solutions from a number of dependable sources.

Add comment