Display number of features of a layer in QGIS

GUI: QGIS has an option 'Show feature count' in the layers context menus in the legend tree that displays the count of features in the layer right beside it's name.

API: In PyQGIS one would write QgsVectorLayer().featureCount() to obtain number of features.

history | excerpt history