-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for progress callback during calls to Python #60
Comments
Yeah, we can probably do this by making it possible to wrap JS callables as arguments to Python (and vice versa might also make sense), so that we don't need to change the signature of Probably not going to have time to implement this in the near future, but feel free to send a pull request or send an e-mail if you actually need this for your commercial project. |
I actually began making a patch, but got distracted with some other things. I'll let you know if I dig into it again. At least the wish is here now :) And yea, to make it generally possible to pass callables as args like you say makes much more sense. |
Haven't had time to do anything on this yet, but just a question: The docs describe how you can pass QObjects to the Python side and call methods on them from there: http://pyotherside.readthedocs.org/en/latest/#accessing-qobjects-from-python Could I perhaps use this mechanism as a "progress callback" for now? I mean, pass in a QObject ( |
Yes, that should work. |
When working with several concurrent calls to long-running Python functions it would be very convenient if the
call
API was something like:Where the
on_progress
is a callable that, when provided, would would be made available as anon_progress
kwarg on the Python side.So for example, with a
mymodule.py
:and the call from QML:
which should output:
I know this functionality can be built on top of the existing
send
mechanism, but having it built in like this would save me from a lot of bookkeeping on the QML side to associate sent progress with the corresponding outstanding call.Thanks a lot for
pyotherside
BTW. It looks very promising, and I'm fairly certain that we'll use it for the UI on our product, which is a machine for mineral analysis to be used in the mining industry.The text was updated successfully, but these errors were encountered: