I have a point shapefile in QGIS 2.10 and I want to display one of its fields attributes based on its unique values (I always know that it has 4 unique values and their values so I do not care for the moment to extract them) I just want points to be displayed with different symbols depending on its value for the specified field.
The categorized symbol renderer styles features based on unique values in the layer's attribute table (QGIS python programming cookbook, chapter 5, page: 145). Looking at the API for QgsSymbolV2 I think that maybe I have to use the public member fuction changeSymbolLayer instead of
QgsSymbolV2.defaultSymbol(lyr.geometryType())
but I get very confused on how to follow the API.
Then, there is the option to use icons as vector layer symbols (QGIS python programming cookbook, chapter 5, page: 140) but I am not sure in how to achieve to have different icons for different categories.