Skip to content

Commit 177e5b8

Browse files
committed
fixed #6
1 parent f87bde0 commit 177e5b8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

qgist/workbench/dtype_workbench.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,17 @@ def _activate_uielements(uiobjects_dict, uielements_dict):
192192
@staticmethod
193193
def _get_uielements_from_mainwindow(mainwindow, uielement_type):
194194

195+
def get_parent(el):
196+
"""Fixes #6, Certain other plugins crash Workbench:
197+
Their UI's parent is exposed as a property instead of a method"""
198+
if hasattr(el.parent, '__call__'):
199+
return el.parent()
200+
return el.parent
201+
195202
return {
196203
uielement.objectName(): uielement
197204
for uielement in mainwindow.findChildren(uielement_type)
198-
if uielement.parent().objectName() == 'QgisApp'
205+
if get_parent(uielement).objectName() == 'QgisApp'
199206
}
200207

201208
@staticmethod

0 commit comments

Comments
 (0)