from typing import Protocol class MainThreadDispatcher(Protocol): def run_on_main_thread(self) -> None: ... # previous ABC implementation was cut due to PyQt conflict, # from abc import ABC, abstractmethod # class MainThreadDispatcher(ABC): # @abstractmethod # def run_on_main_thread(self, func, *args, **kwargs): # """Schedules the given function to run on the main UI thread.""" # pass