What is the best practice to use PyQt with non PyQt back-end code
Unsolved
Language Bindings
-
Hi, I am working on an application development where the UI part is to be coded using PyQt (front-end) and back-end should be coded using non PyQt coding (python). So before proceeding on the development I wanted to know the best practices.
I can list the options as below
- Using Signal and Slot to connect PyQt and non PyQt (python)
- Using flag and threads on non PyQt (threading.Thread) to continuously monitor and update certain flag and take action accordingly on PyQt using Qthreads
- By importing the UI class object directly into the non PyQt (python) code, update the PyQt UI element.
So, which among these is the best.
-
@QtFranchise
I do not like either #2 or #3.The best is #1. Depends which direction you want signals to be sent. You cannot emit signals in non-PyQt code; but I think you can actually
connect()
non-PyQt functions as slots without issue. Can't you write a "thin wrapper" with PyQt to allow signals/slots between your PyQt and non-PyQt code? -
@JonB
That sounds cool. Will follow your suggestion.