Looking for suggestions on how to let user know that FreeCAD is still alive during long OCC hidden line removal processing.
The long processing takes place in HLRBRep_Algo::Hide(), so there aren't any convenient steps to use Base::ProgressBar.
AFAICT HLRBrep_Algo does not implement OCC's Message_ProgressIndicator, so no help there. Maybe a change request to OCC?
The only thing I've come up with so far is a QTimer that pops up every n seconds to update a progress bar, but that feels like a hack.
Any thoughts?
Progress Indication Suggestions Wanted
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- wandererfan
- Veteran
- Posts: 6321
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Progress Indication Suggestions Wanted
ooh... i know there are some open bugs requesting this. Lemme see if I can find them and point them to this discussion
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Progress Indication Suggestions Wanted
What about adding some methods to the Base::ProgressBar that implement an "unknown progress state" for the bar? Qt doesn't provide this sort of widget, so we'd have to do the drawing ourselves, but I've seen various progress bars that just bounce a box back and forth in the progress region when the actual progress isn't known.
Re: Progress Indication Suggestions Wanted
In case HLRBrep_Algo is executed in the main thread then the QTimer will be useless because the event loop won't be processed as long as the OCC algorithm is running. So, in order to make this work you should execute HLRBrep_Algo in a worker thread.The only thing I've come up with so far is a QTimer that pops up every n seconds to update a progress bar, but that feels like a hack
Instead of a progress bar you can use the widget StatusWidget that is prominently put into the center of the screen and there some text can be added. This might be an option if the operation only takes several seconds.
If it takes considerably longer then a "dynamic" widget is needed. It would be good if we implemented our own radial progress indicator that could be easily used inside the StatusWidget. But then of course the OCC algorithm has to be executed in a thread.
https://doc.qt.io/qt-5/qprogressbar.html#setRangeQt doesn't provide this sort of widget