-
Notifications
You must be signed in to change notification settings - Fork 35
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
Please provide forced (synchronous) redraw from Julia #32
Comments
I have added an example for this in The key is to use the QTimer and call a function every time it fires. On the Julia side, you can then use a task to run a simulation step when the timer fires. As long as this step runs, the GUI is blocked and between each step the GUI is updated, including processing of input events. The example should also work on QML.jl 0.2.0, if you prefer not to Pkg.checkout. If you do Pkg.checkout, you need to do that for CxxWrap too and run |
Thanks, this is a reasonable workaround. I got a toy case more like my project to work with tasks and a timer, following your example. (It will take some time to fit the pattern into my real project.) I did observe that with the default timer only about half of the window redraws were actually done (both for my toy case and yours). I found that setting |
Yes, I had noticed that when taking smaller steps it also jumps quickly to about 20% and then moves slowly. Ideally this should be done using threads of course, but the obstacles there are that all Julia code must run in the main thread for now, and for OS X the GUI too has too run in the main thread. The QTimer solution is also officially recommended in the Qt docs, however. |
I tried this example on Linux with both v0.5 and nightly.
|
Are you using a Gallium-3D based graphics driver by any chance? If so, setting the environment variable: export GALLIUM_DRIVER="softpipe" before running Julia should fix it. |
Closing this, because example how to do this is provided now. |
I am building an application which triggers a Julia function that runs for several minutes and provides status updates as it goes. I want to show those updates in the GUI, but I have not found a way to get the Qt window redrawn before the Julia function returns. The objects I am aiming to update are Text objects and JuliaDisplay panels. All I see now is the final version of these. (I have tried interposing sleep() and readline() calls in Julia to yield to anything scheduled, and to calling the show() method of the ApplicationWindow from a signal, all to no avail.) For now, I would be content with some way to call into Qt to force a redraw with up-to-date object states. I am using Qt 5.7.1 on Linux, Julia 0.5 and QML 0.2.0.
The text was updated successfully, but these errors were encountered: