diff --git a/pyqtgraph/multiprocess/bootstrap.py b/pyqtgraph/multiprocess/bootstrap.py index f9cb0b0e..a8a03d41 100644 --- a/pyqtgraph/multiprocess/bootstrap.py +++ b/pyqtgraph/multiprocess/bootstrap.py @@ -22,6 +22,12 @@ if __name__ == '__main__': while len(sys.path) > 0: sys.path.pop() sys.path.extend(path) + + pyqtapis = opts.pop('pyqtapis', None) + if pyqtapis is not None: + import sip + for k,v in pyqtapis.items(): + sip.setapi(k, v) if opts.pop('pyside', False): import PySide diff --git a/pyqtgraph/multiprocess/processes.py b/pyqtgraph/multiprocess/processes.py index 7560ff70..1be7e50b 100644 --- a/pyqtgraph/multiprocess/processes.py +++ b/pyqtgraph/multiprocess/processes.py @@ -39,7 +39,7 @@ class Process(RemoteEventHandler): """ _process_count = 1 # just used for assigning colors to each process for debugging - def __init__(self, name=None, target=None, executable=None, copySysPath=True, debug=False, timeout=20, wrapStdout=None): + def __init__(self, name=None, target=None, executable=None, copySysPath=True, debug=False, timeout=20, wrapStdout=None, pyqtapis=None): """ ============== ============================================================= **Arguments:** @@ -47,7 +47,7 @@ class Process(RemoteEventHandler): from the remote process. target Optional function to call after starting remote process. By default, this is startEventLoop(), which causes the remote - process to process requests from the parent process until it + process to handle requests from the parent process until it is asked to quit. If you wish to specify a different target, it must be picklable (bound methods are not). copySysPath If True, copy the contents of sys.path to the remote process. @@ -61,6 +61,8 @@ class Process(RemoteEventHandler): for a python bug: http://bugs.python.org/issue3905 but has the side effect that child output is significantly delayed relative to the parent output. + pyqtapis Optional dictionary of PyQt API version numbers to set before + importing pyqtgraph in the remote process. ============== ============================================================= """ if target is None: @@ -130,7 +132,8 @@ class Process(RemoteEventHandler): targetStr=targetStr, path=sysPath, pyside=USE_PYSIDE, - debug=procDebug + debug=procDebug, + pyqtapis=pyqtapis, ) pickle.dump(data, self.proc.stdin) self.proc.stdin.close()