I would like to know if it is possible to focus on my application, even if it has lost focus?
My application launches a thread, and as soon as I exit it, I would like to bring my windowed application to the forefront.
I tried the following code, it works to focus on the widget that I would like, but if you are in firefox, it just blinks once in the taskbar and does not focus :(
this->activateWindow(); this->show(); this->setFocus();
EDIT: That would do it, but I don't want my application to stay on top ... and if I remove the flag, it loses focus = /
this->setWindowFlags(Qt::WindowStaysOnTopHint); this->activateWindow(); this->show(); this->setFocus();
Thank you in advance for your answers.
source share