qgis / QGIS-Documentation

QGIS Documentation
https://docs.qgis.org/latest
478 stars 700 forks source link

PyQGIS CookBook. Reccommendation for plugin writers: customization menu #470

Closed alexbruy closed 9 years ago

alexbruy commented 9 years ago

From Radim comments.

Customization only works for objects with objectName. objectName is automatically set by Qt for objects created in designer (compiled from .ui). For objects created programmatically it has to be set. Object names have to be added in all plugins. Recommendation for plugin authors: when you are adding QMenu or QAction, always set its object name, e.g.: myMenu = QMenu('My menu") myMenu.setObjectName("myMenu")

See also http://hub.qgis.org/issues/9134

This should be added to Python manual/guidelines.

Original ticket https://hub.qgis.org/issues/10133

alexbruy commented 9 years ago

Seems already added to PyQGIS CookBook