[QGIS-Developer] QGIS Seg fault from python
Chris Crook
ccrook at linz.govt.nz
Mon Oct 7 16:48:18 PDT 2019
For the record it seems that the seg fault is coming from the line
symbol=QgsLineSymbol([basePointLine])
It works perfectly using:
symbol=QgsLineSymbol()
symbol.changeSymbolLayer(0,basePointLine)
________________________________________
From: Chris Crook
Sent: Saturday, 5 October 2019 9:03 a.m.
To: qgis-developer at lists.osgeo.org
Subject: QGIS Seg fault from python
Hi All
I am trying to configure a renderer with a marker line in python. Currently it is killing QGIS with seg fault. Running recent dev build or 3.8.4 on ubuntu 18.04.
Below is the code I am running in python console which crashes QGIS. Any ideas as to what I am doing wrong?
Thanks in advance
Chris
#!/usr/bin/python3
from qgis.core import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
def tryit():
basePointSymbol = QgsMarkerSymbol.createSimple({})
basePointLine = QgsMarkerLineSymbolLayer()
basePointLine.setPlacement(QgsMarkerLineSymbolLayer.FirstVertex)
basePointLine.setSubSymbol(basePointSymbol)
symbol=QgsLineSymbol([basePointLine])
renderer = QgsSingleSymbolRenderer(symbol)
layer=iface.mapCanvas().currentLayer()
layer.setRenderer(renderer)
layer.triggerRepaint()
tryit()
________________________________
This message contains information, which may be in confidence and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.
More information about the QGIS-Developer
mailing list