Skip to content

Commit 18e86ab

Browse files
committed
redirect complete qgis.gui for pyuic
1 parent 862367a commit 18e86ab

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

python/custom_widgets/qgis_customwidgets.py

+27-15
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,33 @@
1717
***************************************************************************
1818
"""
1919

20-
# If pluginType is MODULE, the plugin loader will call moduleInformation. The
21-
# variable MODULE is inserted into the local namespace by the plugin loader.
22-
pluginType = MODULE
20+
"""
21+
This file is used by pyuic to redirect includes
22+
in custom widgets to the correct QGIS python packages.
23+
It is copied on installation in /pythonX/dist-packages/PyQt4/uic/widget-plugins/
24+
"""
25+
26+
#pluginType = CW_FILTER
27+
#def getFilter():
28+
# import qgis.gui
29+
#
30+
# QGIS_widgets = {}
31+
# for pyClass in dir(qgis.gui):
32+
# QGIS_widgets[pyClass] = 'qgis.gui'
33+
#
34+
# def _QGISfilter(widgetname, baseclassname, module):
35+
# print widgetname, baseclassname, module
36+
# if widgetname in QGIS_widgets:
37+
# return (MATCH, (widgetname, baseclassname, QGIS_widgets[widgetname]))
38+
# else:
39+
# return (NO_MATCH, None)
40+
#
41+
# return _QGISfilter
2342

2443

25-
# moduleInformation() must return a tuple (module, widget_list). If "module"
26-
# is "A" and any widget from this module is used, the code generator will write
27-
# "import A". If "module" is "A[.B].C", the code generator will write
28-
# "from A[.B] import C". Each entry in "widget_list" must be unique.
44+
45+
pluginType = MODULE
2946
def moduleInformation():
30-
return "qgis.gui", \
31-
("QgsCollapsibleGroupbox" ,\
32-
"QgsFieldComboBox" ,\
33-
"QgsFieldExpressionWidget",\
34-
"QgsMapLayerComboBox" ,\
35-
"QgsMapLayerProxyModel" ,\
36-
"QgsScalevisibilityWidget",\
37-
)
47+
import qgis.gui
48+
return "qgis.gui", dir(qgis.gui)
49+

0 commit comments

Comments
 (0)