Quite often I find that I need to show and bring a window to a front. For example when the user attempts to reload the same document I simply bring up the old one. To do this I have code like this:
widget->raise();
widget->activateWindow();
widget->showNormal();
It's starting to feel like I'm missing a shortcut function. Surely this type of behaviour is quite common. Is there some preferred function that will do all of the above and/or just do the right thing on each target OS?
Note: I've just noticed a defect, thus a special function is even more important now. If the window is minimized, activateWindow
does not work. This happens even if you reorder the above to showNormal
first.