hi – been trying to find a good solution but get stuck with old suggestions.
I am working on a fairly simply Qt 5.1 Desktop Application for myself and want to do the following:
/* pseudo code */
1. load an image from file
2. setup a few things (such as rescale image, convert to grayscale, set some start values, disable some menus, etc.)
3. click on some Start! button or select some Start! action from the menu
4. show a modal progress dialog with a cancel button (as following process may take a few hours, or even days, but that’s OK, it’s actually designed that way)
5. foreach pixel do a few things (e.g. talk to microprocessor about pixel via a SerialPort, wait for microprocessor to say ‘ready’)
6. update progress bar in progress dialog
7. next pixel until either finished==true or cancel==pressed
8. do some postprocessing, then back to square 1.
If I add a simple ui.form with such a progressbar and cancel button, and ui.exec() this, and then run my pixel-processing routine in my mainWindow (currently just a dummy doing nothing), and update the progressbar from there, nothing happens and the application sort of freezes.
I can’t really go multithreading as I need to go pixel-by-pixel in proper order, and I need to keep my processing routine inside my mainWindow, as too many other things are linked to it, moving the routine into the progressWindow class would make it too complicated, I think.
Any simple but workable ideas? Input most appreciated.
O.
↧