diff --git a/python/custom_widgets/qgis_customwidgets.py b/python/custom_widgets/qgis_customwidgets.py index e95a9ce9d9c9..af0e3195cfb1 100644 --- a/python/custom_widgets/qgis_customwidgets.py +++ b/python/custom_widgets/qgis_customwidgets.py @@ -17,21 +17,33 @@ *************************************************************************** """ -# If pluginType is MODULE, the plugin loader will call moduleInformation. The -# variable MODULE is inserted into the local namespace by the plugin loader. -pluginType = MODULE +""" +This file is used by pyuic to redirect includes +in custom widgets to the correct QGIS python packages. +It is copied on installation in /pythonX/dist-packages/PyQt4/uic/widget-plugins/ +""" + +#pluginType = CW_FILTER +#def getFilter(): +# import qgis.gui +# +# QGIS_widgets = {} +# for pyClass in dir(qgis.gui): +# QGIS_widgets[pyClass] = 'qgis.gui' +# +# def _QGISfilter(widgetname, baseclassname, module): +# print widgetname, baseclassname, module +# if widgetname in QGIS_widgets: +# return (MATCH, (widgetname, baseclassname, QGIS_widgets[widgetname])) +# else: +# return (NO_MATCH, None) +# +# return _QGISfilter -# moduleInformation() must return a tuple (module, widget_list). If "module" -# is "A" and any widget from this module is used, the code generator will write -# "import A". If "module" is "A[.B].C", the code generator will write -# "from A[.B] import C". Each entry in "widget_list" must be unique. + +pluginType = MODULE def moduleInformation(): - return "qgis.gui", \ - ("QgsCollapsibleGroupbox" ,\ - "QgsFieldComboBox" ,\ - "QgsFieldExpressionWidget",\ - "QgsMapLayerComboBox" ,\ - "QgsMapLayerProxyModel" ,\ - "QgsScalevisibilityWidget",\ - ) + import qgis.gui + return "qgis.gui", dir(qgis.gui) +