What would be the optimal way to achieve better performing and reliable said in Optimal way to update GUI from another thread?: Although, this method works but I noticed my GUI sometimes gets choppy, like: laggy when i move QSplitter or responsiveness of QPushButtons etc. I feel emitting signals from another thread also keeps the GUI thread busy in updating the UI forever. But i would like to know, is emitting signals in a loop to update GUI a good idea? Why? - To keep my GUI thread free and keep the whole application responsive. calls slot to render images on QLabels QtConcurrent::run(this, &Class::asyncFunction) Īsync function runs in a loop receiving frames and doing pre processing on the images and emits signals to update UIs. start a loop to receive frames on a different thread Since receiving frames from a sensor is a never ending while loop, this is how it looks like: void Class::startSensor() I have a sensor which delivers 30 fps and I would like to pre process the images received and then visualize it on a QLabel.
0 Comments
Leave a Reply. |