I have a QGIS plugin which has a combobox (QComboBox) element with a list of layers currently opened in QGIS. The problem is that the layer list is only updated on initialization of the plugin (I do it with QgsMapLayerRegistry method described here), so every layer added afterwards is not listed until I I force plugin reload.
So the question is - how do I implement automatic refresh of current layer list in my combo box? For example, it is clearly implemented in all built-in modules like "Select by location" etc.
There is a workaround here which uses click event on a combobox, but I think there must be a more elegant way.




