Set Timer to trigger after processing

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
freedman
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Set Timer to trigger after processing

Post by freedman »

I wanted to do some processing after a workbench change so I set a timer to wait for all the events to update. A timer might not be the best coding approach but I found this in the QT docs to help.

Code: Select all

As a special case, a QTimer with a timeout of 0 will time out as soon as all the events in the window system’s event queue have been processed. This can be used to do heavy work while providing a snappy user interface:
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Set Timer to trigger after processing

Post by openBrain »

And what is more precisely your question ?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Set Timer to trigger after processing

Post by vocx »

freedman wrote: Thu Dec 12, 2019 12:34 am ...

Code: Select all

As a special case, a QTimer ...
QTimer is used in the DraftGui.todo class (src/Mod/DraftGui.py) precisely to schedule and trigger the execution of certain commands after others. This is done to prevent crashes with the 3D view manipulation by Coin. Maybe this is interesting to you? What exactly do you want to do?

Also ask Joel Graff who is doing something similar with his pivy_trackers library.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
freedman
Veteran
Posts: 3475
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Set Timer to trigger after processing

Post by freedman »

openBrain
And what is more precisely your question ?
I don't have a question, I am already using this timer and thought it was worth mentioning.
vocx , Maybe this is interesting to you?
It Is interesting. I was thinking this might be useful in the timing of motion simulation. It can be tough to get a call back when doing a graphic process sometimes.
Thanks
Post Reply