The code snipped mentioned in Automatic pyqgis categorized renderer classification and Apply symbol to each feature (Categorized symbol) automatically create categorized renderers and determine categories using PyQGIS.
I (using QGIS 2.18.18 LTR) have a layer with
uniqueValues for a field
[0, 1, 2, 4, 5, 6, 7, 8, 9, NULL] for which the above referred to approaches correctly create a category with value
0 and Legend
0, but incorrectly (from my understanding) create a category with value
0 and legend
NULL hiding the first one, screenshot:
Created with the
Classify Button, there is a category with no value, covering all except
[0, ..., 9] (including
Hence, question: Using PyQGIS, how can I create a
QgsRendererCategoryV2() with no value, i.e. all other values (or a category for
NULL value, respectively)?