[QGIS-Developer] QGIS3.0 and QgsShapeburstFillSymbolLayer

Olcay Ebcin olcay.ebcin at odakent.com.tr
Thu Jan 11 08:03:28 PST 2018


Hi,

I run script in python console as shown below. It Works fine if you select a
polygon layer and make it activeLayer.

I am actually trying to connect the script with a pushButton

Therefore, if I run same sctipt in a function then QGIS always crash.

Am I doing something wrong or there is a bug in QGIS3.0

Thanks,

Olcay Ebcin

 

WORKS

 

myLayer=iface.activeLayer()

slyr = QgsShapeburstFillSymbolLayer()

slyr.setColorType(QgsShapeburstFillSymbolLayer.SimpleTwoColor)

slyr.setColor = QColor(181, 123, 169, 255)

slyr.setColor2 = QColor(0, 0, 255, 255)

slyr.setBlurRadius(0)

slyr.setEnabled(True)

slyr.setLocked(False)

slyr.setUseWholeShape(False)

slyr.setMaxDistance(5)

 

fs = QgsFillSymbol([slyr])

sr = QgsSingleSymbolRenderer(fs)

rend = QgsInvertedPolygonRenderer(sr)

myLayer.setOpacity(0.5)

myLayer.-setRenderer(rend)

 

CRASH QGIS3.0

def test():

myLayer=iface.activeLayer()

slyr = QgsShapeburstFillSymbolLayer()

slyr.setColorType(QgsShapeburstFillSymbolLayer.SimpleTwoColor)

slyr.setColor = QColor(181, 123, 169, 255)

slyr.setColor2 = QColor(0, 0, 255, 255)

slyr.setBlurRadius(0)

slyr.setEnabled(True)

slyr.setLocked(False)

slyr.setUseWholeShape(False)

slyr.setMaxDistance(5)

 

fs = QgsFillSymbol([slyr])

sr = QgsSingleSymbolRenderer(fs)

rend = QgsInvertedPolygonRenderer(sr)

myLayer.setOpacity(0.5)

myLayer.-setRenderer(rend)

 

test()

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180111/e9570623/attachment-0001.html>


More information about the QGIS-Developer mailing list