SearchBar/SearchResults.py
2023-04-13 03:12:42 +01:00

19 lines
592 B
Python

actionHandlers = { }
toolTipHandlers = { }
resultProvidersCached = { }
resultProvidersUncached = { }
# name : string
# getItemGroupsCached: () -> [itemGroup]
# getItemGroupsUncached: () -> [itemGroup]
def registerResultProvider(name, getItemGroupsCached, getItemGroupsUncached):
resultProvidersCached[name] = getItemGroupsCached
resultProvidersUncached[name] = getItemGroupsUncached
# name : str
# action : act -> None
# toolTip : groupId, setParent -> (str or QWidget)
def registerResultHandler(name, action, toolTip):
actionHandlers[name] = action
toolTipHandlers[name] = toolTip